diff --git a/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts index b6c26d3069014..cd50f57915a40 100644 --- a/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts +++ b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3323,11 +3324,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-account/src/protocols/Aws_restJson1.ts b/clients/client-account/src/protocols/Aws_restJson1.ts index f911f1116b9e7..ddd48acdd122c 100644 --- a/clients/client-account/src/protocols/Aws_restJson1.ts +++ b/clients/client-account/src/protocols/Aws_restJson1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -968,11 +969,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts index 64196f6cdbea5..bb9055946824e 100644 --- a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2377,11 +2378,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-acm/src/protocols/Aws_json1_1.ts b/clients/client-acm/src/protocols/Aws_json1_1.ts index fe009ddac0f7d..8244d66e8a9fb 100644 --- a/clients/client-acm/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1599,11 +1600,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts index 94be0a721676e..b8dd5865f21a6 100644 --- a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts +++ b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7152,11 +7153,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-amp/src/protocols/Aws_restJson1.ts b/clients/client-amp/src/protocols/Aws_restJson1.ts index 5a51dc0fe8fc0..15718b226d3a5 100644 --- a/clients/client-amp/src/protocols/Aws_restJson1.ts +++ b/clients/client-amp/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2264,11 +2265,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-amplify/src/protocols/Aws_restJson1.ts b/clients/client-amplify/src/protocols/Aws_restJson1.ts index c16ede91f30fe..bfaebdbd39b10 100644 --- a/clients/client-amplify/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplify/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3778,11 +3779,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts index c8c560e74a69b..859c5a62f999d 100644 --- a/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3892,11 +3893,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts b/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts index c65df5f286cba..b92a12aa45c4d 100644 --- a/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3706,11 +3707,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-api-gateway/src/commands/GetExportCommand.ts b/clients/client-api-gateway/src/commands/GetExportCommand.ts index 1ab25ddbe79c0..c5f83ebffdb51 100644 --- a/clients/client-api-gateway/src/commands/GetExportCommand.ts +++ b/clients/client-api-gateway/src/commands/GetExportCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetExportCommand}. */ export interface GetExportCommandInput extends GetExportRequest {} +/** + * @public + */ +export type GetExportCommandOutputType = Omit & { + body?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetExportCommand}. */ -export interface GetExportCommandOutput extends ExportResponse, __MetadataBearer {} +export interface GetExportCommandOutput extends GetExportCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-api-gateway/src/commands/GetSdkCommand.ts b/clients/client-api-gateway/src/commands/GetSdkCommand.ts index 4809677f15af3..95e4271176e55 100644 --- a/clients/client-api-gateway/src/commands/GetSdkCommand.ts +++ b/clients/client-api-gateway/src/commands/GetSdkCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetSdkCommand}. */ export interface GetSdkCommandInput extends GetSdkRequest {} +/** + * @public + */ +export type GetSdkCommandOutputType = Omit & { + body?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetSdkCommand}. */ -export interface GetSdkCommandOutput extends SdkResponse, __MetadataBearer {} +export interface GetSdkCommandOutput extends GetSdkCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-api-gateway/src/commands/ImportApiKeysCommand.ts b/clients/client-api-gateway/src/commands/ImportApiKeysCommand.ts index fd2848ce8d97b..930178c9ecaeb 100644 --- a/clients/client-api-gateway/src/commands/ImportApiKeysCommand.ts +++ b/clients/client-api-gateway/src/commands/ImportApiKeysCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_ImportApiKeysCommand, se_ImportApiKeysCommand } from "../protocols/A * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type ImportApiKeysCommandInputType = Omit & { + body: BlobTypes; +}; /** * @public * * The input for {@link ImportApiKeysCommand}. */ -export interface ImportApiKeysCommandInput extends ImportApiKeysRequest {} +export interface ImportApiKeysCommandInput extends ImportApiKeysCommandInputType {} /** * @public * diff --git a/clients/client-api-gateway/src/commands/ImportDocumentationPartsCommand.ts b/clients/client-api-gateway/src/commands/ImportDocumentationPartsCommand.ts index 136c0194d9449..47a958ef626bb 100644 --- a/clients/client-api-gateway/src/commands/ImportDocumentationPartsCommand.ts +++ b/clients/client-api-gateway/src/commands/ImportDocumentationPartsCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_ImportDocumentationPartsCommand, se_ImportDocumentationPartsCommand * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type ImportDocumentationPartsCommandInputType = Omit & { + body: BlobTypes; +}; /** * @public * * The input for {@link ImportDocumentationPartsCommand}. */ -export interface ImportDocumentationPartsCommandInput extends ImportDocumentationPartsRequest {} +export interface ImportDocumentationPartsCommandInput extends ImportDocumentationPartsCommandInputType {} /** * @public * diff --git a/clients/client-api-gateway/src/commands/ImportRestApiCommand.ts b/clients/client-api-gateway/src/commands/ImportRestApiCommand.ts index 3243e24301ce1..8b7e710b10d81 100644 --- a/clients/client-api-gateway/src/commands/ImportRestApiCommand.ts +++ b/clients/client-api-gateway/src/commands/ImportRestApiCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_ImportRestApiCommand, se_ImportRestApiCommand } from "../protocols/A * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type ImportRestApiCommandInputType = Omit & { + body: BlobTypes; +}; /** * @public * * The input for {@link ImportRestApiCommand}. */ -export interface ImportRestApiCommandInput extends ImportRestApiRequest {} +export interface ImportRestApiCommandInput extends ImportRestApiCommandInputType {} /** * @public * diff --git a/clients/client-api-gateway/src/commands/PutRestApiCommand.ts b/clients/client-api-gateway/src/commands/PutRestApiCommand.ts index 387e5ccd1df3f..f7da3bba39c58 100644 --- a/clients/client-api-gateway/src/commands/PutRestApiCommand.ts +++ b/clients/client-api-gateway/src/commands/PutRestApiCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_PutRestApiCommand, se_PutRestApiCommand } from "../protocols/Aws_res * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type PutRestApiCommandInputType = Omit & { + body: BlobTypes; +}; /** * @public * * The input for {@link PutRestApiCommand}. */ -export interface PutRestApiCommandInput extends PutRestApiRequest {} +export interface PutRestApiCommandInput extends PutRestApiCommandInputType {} /** * @public * diff --git a/clients/client-api-gateway/src/protocols/Aws_restJson1.ts b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts index 43632e790c316..750af319139c8 100644 --- a/clients/client-api-gateway/src/protocols/Aws_restJson1.ts +++ b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts @@ -20,6 +20,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -12172,11 +12173,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-apigatewaymanagementapi/src/commands/PostToConnectionCommand.ts b/clients/client-apigatewaymanagementapi/src/commands/PostToConnectionCommand.ts index 5c5bd0049b810..2b428fcde2de8 100644 --- a/clients/client-apigatewaymanagementapi/src/commands/PostToConnectionCommand.ts +++ b/clients/client-apigatewaymanagementapi/src/commands/PostToConnectionCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -25,12 +26,18 @@ import { de_PostToConnectionCommand, se_PostToConnectionCommand } from "../proto * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type PostToConnectionCommandInputType = Omit & { + Data: BlobTypes; +}; /** * @public * * The input for {@link PostToConnectionCommand}. */ -export interface PostToConnectionCommandInput extends PostToConnectionRequest {} +export interface PostToConnectionCommandInput extends PostToConnectionCommandInputType {} /** * @public * diff --git a/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts index 7056b2f391fea..c7bf85f4986b2 100644 --- a/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -369,11 +370,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-apigatewayv2/src/commands/ExportApiCommand.ts b/clients/client-apigatewayv2/src/commands/ExportApiCommand.ts index 621895ceb96e7..addb6543ef01b 100644 --- a/clients/client-apigatewayv2/src/commands/ExportApiCommand.ts +++ b/clients/client-apigatewayv2/src/commands/ExportApiCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link ExportApiCommand}. */ export interface ExportApiCommandInput extends ExportApiRequest {} +/** + * @public + */ +export type ExportApiCommandOutputType = Omit & { + body?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link ExportApiCommand}. */ -export interface ExportApiCommandOutput extends ExportApiResponse, __MetadataBearer {} +export interface ExportApiCommandOutput extends ExportApiCommandOutputType, __MetadataBearer {} export class ExportApiCommand extends $Command< ExportApiCommandInput, diff --git a/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts index fe7d9819adf71..c4274b6450fb9 100644 --- a/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -7371,11 +7372,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-app-mesh/src/protocols/Aws_restJson1.ts b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts index 227af6dd2a3da..b50c9f2ef3fa6 100644 --- a/clients/client-app-mesh/src/protocols/Aws_restJson1.ts +++ b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5142,11 +5143,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-appconfig/src/commands/CreateHostedConfigurationVersionCommand.ts b/clients/client-appconfig/src/commands/CreateHostedConfigurationVersionCommand.ts index 98b8ba41ea6e9..2191541b6634c 100644 --- a/clients/client-appconfig/src/commands/CreateHostedConfigurationVersionCommand.ts +++ b/clients/client-appconfig/src/commands/CreateHostedConfigurationVersionCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -10,6 +11,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -29,18 +31,36 @@ import { * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type CreateHostedConfigurationVersionCommandInputType = Omit< + CreateHostedConfigurationVersionRequest, + "Content" +> & { + Content: BlobTypes; +}; /** * @public * * The input for {@link CreateHostedConfigurationVersionCommand}. */ -export interface CreateHostedConfigurationVersionCommandInput extends CreateHostedConfigurationVersionRequest {} +export interface CreateHostedConfigurationVersionCommandInput + extends CreateHostedConfigurationVersionCommandInputType {} +/** + * @public + */ +export type CreateHostedConfigurationVersionCommandOutputType = Omit & { + Content?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link CreateHostedConfigurationVersionCommand}. */ -export interface CreateHostedConfigurationVersionCommandOutput extends HostedConfigurationVersion, __MetadataBearer {} +export interface CreateHostedConfigurationVersionCommandOutput + extends CreateHostedConfigurationVersionCommandOutputType, + __MetadataBearer {} /** * @public diff --git a/clients/client-appconfig/src/commands/GetConfigurationCommand.ts b/clients/client-appconfig/src/commands/GetConfigurationCommand.ts index 42bf1067b39f3..37db4eb1d1d50 100644 --- a/clients/client-appconfig/src/commands/GetConfigurationCommand.ts +++ b/clients/client-appconfig/src/commands/GetConfigurationCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetConfigurationCommand}. */ export interface GetConfigurationCommandInput extends GetConfigurationRequest {} +/** + * @public + */ +export type GetConfigurationCommandOutputType = Omit & { + Content?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetConfigurationCommand}. */ -export interface GetConfigurationCommandOutput extends Configuration, __MetadataBearer {} +export interface GetConfigurationCommandOutput extends GetConfigurationCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-appconfig/src/commands/GetHostedConfigurationVersionCommand.ts b/clients/client-appconfig/src/commands/GetHostedConfigurationVersionCommand.ts index 2f19c8176897a..44e6607eea459 100644 --- a/clients/client-appconfig/src/commands/GetHostedConfigurationVersionCommand.ts +++ b/clients/client-appconfig/src/commands/GetHostedConfigurationVersionCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -34,12 +35,20 @@ export { __MetadataBearer, $Command }; * The input for {@link GetHostedConfigurationVersionCommand}. */ export interface GetHostedConfigurationVersionCommandInput extends GetHostedConfigurationVersionRequest {} +/** + * @public + */ +export type GetHostedConfigurationVersionCommandOutputType = Omit & { + Content?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetHostedConfigurationVersionCommand}. */ -export interface GetHostedConfigurationVersionCommandOutput extends HostedConfigurationVersion, __MetadataBearer {} +export interface GetHostedConfigurationVersionCommandOutput + extends GetHostedConfigurationVersionCommandOutputType, + __MetadataBearer {} /** * @public diff --git a/clients/client-appconfig/src/protocols/Aws_restJson1.ts b/clients/client-appconfig/src/protocols/Aws_restJson1.ts index 9e4c1c0811ead..7ec3047b9356a 100644 --- a/clients/client-appconfig/src/protocols/Aws_restJson1.ts +++ b/clients/client-appconfig/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4512,11 +4513,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-appconfigdata/src/commands/GetLatestConfigurationCommand.ts b/clients/client-appconfigdata/src/commands/GetLatestConfigurationCommand.ts index e0cf19241df52..62c44703a0319 100644 --- a/clients/client-appconfigdata/src/commands/GetLatestConfigurationCommand.ts +++ b/clients/client-appconfigdata/src/commands/GetLatestConfigurationCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -31,12 +32,20 @@ export { __MetadataBearer, $Command }; * The input for {@link GetLatestConfigurationCommand}. */ export interface GetLatestConfigurationCommandInput extends GetLatestConfigurationRequest {} +/** + * @public + */ +export type GetLatestConfigurationCommandOutputType = Omit & { + Configuration?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetLatestConfigurationCommand}. */ -export interface GetLatestConfigurationCommandOutput extends GetLatestConfigurationResponse, __MetadataBearer {} +export interface GetLatestConfigurationCommandOutput + extends GetLatestConfigurationCommandOutputType, + __MetadataBearer {} /** * @public diff --git a/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts b/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts index 7423b4fb093dd..74ffc4685527b 100644 --- a/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts +++ b/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -302,11 +303,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-appflow/src/protocols/Aws_restJson1.ts b/clients/client-appflow/src/protocols/Aws_restJson1.ts index 17dc67a91147f..323ccce120101 100644 --- a/clients/client-appflow/src/protocols/Aws_restJson1.ts +++ b/clients/client-appflow/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3368,11 +3369,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-appintegrations/src/protocols/Aws_restJson1.ts b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts index 85d09fb4e92ea..3dc6a456a0c9c 100644 --- a/clients/client-appintegrations/src/protocols/Aws_restJson1.ts +++ b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1607,11 +1608,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts index 47599cfac059a..a93f5f5628b13 100644 --- a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1558,11 +1559,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts index 220ecd4946c41..be46965e91bcd 100644 --- a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2518,11 +2519,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-application-insights/src/protocols/Aws_json1_1.ts b/clients/client-application-insights/src/protocols/Aws_json1_1.ts index da210505bad97..9b82002856344 100644 --- a/clients/client-application-insights/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-insights/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2378,11 +2379,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts index 30763432046ea..b5476d5dbbf4c 100644 --- a/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts +++ b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -708,11 +709,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-apprunner/src/protocols/Aws_json1_0.ts b/clients/client-apprunner/src/protocols/Aws_json1_0.ts index 9d9e16015394b..581a2b52fcaaa 100644 --- a/clients/client-apprunner/src/protocols/Aws_json1_0.ts +++ b/clients/client-apprunner/src/protocols/Aws_json1_0.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3254,11 +3255,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-appstream/src/protocols/Aws_json1_1.ts b/clients/client-appstream/src/protocols/Aws_json1_1.ts index fd7daa115984a..cebcf7b90e8cb 100644 --- a/clients/client-appstream/src/protocols/Aws_json1_1.ts +++ b/clients/client-appstream/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5894,11 +5895,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-appsync/src/commands/GetIntrospectionSchemaCommand.ts b/clients/client-appsync/src/commands/GetIntrospectionSchemaCommand.ts index 381b80aa2ee03..f7292b91f0309 100644 --- a/clients/client-appsync/src/commands/GetIntrospectionSchemaCommand.ts +++ b/clients/client-appsync/src/commands/GetIntrospectionSchemaCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,20 @@ export { __MetadataBearer, $Command }; * The input for {@link GetIntrospectionSchemaCommand}. */ export interface GetIntrospectionSchemaCommandInput extends GetIntrospectionSchemaRequest {} +/** + * @public + */ +export type GetIntrospectionSchemaCommandOutputType = Omit & { + schema?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetIntrospectionSchemaCommand}. */ -export interface GetIntrospectionSchemaCommandOutput extends GetIntrospectionSchemaResponse, __MetadataBearer {} +export interface GetIntrospectionSchemaCommandOutput + extends GetIntrospectionSchemaCommandOutputType, + __MetadataBearer {} /** * @public diff --git a/clients/client-appsync/src/protocols/Aws_restJson1.ts b/clients/client-appsync/src/protocols/Aws_restJson1.ts index d6245bd70393d..819b86cf4ae0f 100644 --- a/clients/client-appsync/src/protocols/Aws_restJson1.ts +++ b/clients/client-appsync/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5906,11 +5907,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts b/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts index bf620acbd0955..7e478fbc2011a 100644 --- a/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts +++ b/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -804,11 +805,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-athena/src/protocols/Aws_json1_1.ts b/clients/client-athena/src/protocols/Aws_json1_1.ts index 39565d792157b..6b6ddb83649d8 100644 --- a/clients/client-athena/src/protocols/Aws_json1_1.ts +++ b/clients/client-athena/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5800,11 +5801,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-auditmanager/src/protocols/Aws_restJson1.ts b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts index 5c0e7941788e5..f79e24b1fbd9a 100644 --- a/clients/client-auditmanager/src/protocols/Aws_restJson1.ts +++ b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6558,11 +6559,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts index cb71bba656064..69da3362b0a63 100644 --- a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts +++ b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -935,11 +936,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-auto-scaling/src/protocols/Aws_query.ts b/clients/client-auto-scaling/src/protocols/Aws_query.ts index 7b26f49bbaa98..77decf81e034f 100644 --- a/clients/client-auto-scaling/src/protocols/Aws_query.ts +++ b/clients/client-auto-scaling/src/protocols/Aws_query.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -11232,11 +11233,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts index ef6894e8f898f..5e44a88eeae3e 100644 --- a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts +++ b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2236,11 +2237,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-backup/src/protocols/Aws_restJson1.ts b/clients/client-backup/src/protocols/Aws_restJson1.ts index f0a877e9ed4e4..250101fa40183 100644 --- a/clients/client-backup/src/protocols/Aws_restJson1.ts +++ b/clients/client-backup/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7637,11 +7638,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-backupstorage/src/commands/NotifyObjectCompleteCommand.ts b/clients/client-backupstorage/src/commands/NotifyObjectCompleteCommand.ts index 1d41f3971283a..238132cc266bc 100644 --- a/clients/client-backupstorage/src/commands/NotifyObjectCompleteCommand.ts +++ b/clients/client-backupstorage/src/commands/NotifyObjectCompleteCommand.ts @@ -25,11 +25,6 @@ import { de_NotifyObjectCompleteCommand, se_NotifyObjectCompleteCommand } from " * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link NotifyObjectCompleteCommand}. - */ export type NotifyObjectCompleteCommandInputType = Omit & { /** * For *`NotifyObjectCompleteInput["MetadataBlob"]`*, see {@link NotifyObjectCompleteInput.MetadataBlob}. @@ -37,7 +32,9 @@ export type NotifyObjectCompleteCommandInputType = Omit & { /** * For *`PutChunkInput["Data"]`*, see {@link PutChunkInput.Data}. @@ -33,7 +28,9 @@ export type PutChunkCommandInputType = Omit & { Data: PutChunkInput["Data"] | string | Uint8Array | Buffer; }; /** - * This interface extends from `PutChunkInput` interface. There are more parameters than `Data` defined in {@link PutChunkInput} + * @public + * + * The input for {@link PutChunkCommand}. */ export interface PutChunkCommandInput extends PutChunkCommandInputType {} /** diff --git a/clients/client-backupstorage/src/commands/PutObjectCommand.ts b/clients/client-backupstorage/src/commands/PutObjectCommand.ts index 1950b331d86a5..824e938ea29e4 100644 --- a/clients/client-backupstorage/src/commands/PutObjectCommand.ts +++ b/clients/client-backupstorage/src/commands/PutObjectCommand.ts @@ -21,11 +21,6 @@ import { de_PutObjectCommand, se_PutObjectCommand } from "../protocols/Aws_restJ * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link PutObjectCommand}. - */ export type PutObjectCommandInputType = Omit & { /** * For *`PutObjectInput["InlineChunk"]`*, see {@link PutObjectInput.InlineChunk}. @@ -33,7 +28,9 @@ export type PutObjectCommandInputType = Omit & { InlineChunk?: PutObjectInput["InlineChunk"] | string | Uint8Array | Buffer; }; /** - * This interface extends from `PutObjectInput` interface. There are more parameters than `InlineChunk` defined in {@link PutObjectInput} + * @public + * + * The input for {@link PutObjectCommand}. */ export interface PutObjectCommandInput extends PutObjectCommandInputType {} /** diff --git a/clients/client-backupstorage/src/protocols/Aws_restJson1.ts b/clients/client-backupstorage/src/protocols/Aws_restJson1.ts index 43ffe0dcbc9ed..ba86462ca3ee9 100644 --- a/clients/client-backupstorage/src/protocols/Aws_restJson1.ts +++ b/clients/client-backupstorage/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1209,11 +1210,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-batch/src/protocols/Aws_restJson1.ts b/clients/client-batch/src/protocols/Aws_restJson1.ts index ec740fcdd8894..3333c56220174 100644 --- a/clients/client-batch/src/protocols/Aws_restJson1.ts +++ b/clients/client-batch/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2583,11 +2584,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-billingconductor/src/protocols/Aws_restJson1.ts b/clients/client-billingconductor/src/protocols/Aws_restJson1.ts index 61da9e01634c2..d60ba012987fa 100644 --- a/clients/client-billingconductor/src/protocols/Aws_restJson1.ts +++ b/clients/client-billingconductor/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3520,11 +3521,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-braket/src/protocols/Aws_restJson1.ts b/clients/client-braket/src/protocols/Aws_restJson1.ts index c80d73a17fb65..0debe57d973d5 100644 --- a/clients/client-braket/src/protocols/Aws_restJson1.ts +++ b/clients/client-braket/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1575,11 +1576,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-budgets/src/protocols/Aws_json1_1.ts b/clients/client-budgets/src/protocols/Aws_json1_1.ts index eb37c89e9d35e..ea5257bae57b9 100644 --- a/clients/client-budgets/src/protocols/Aws_json1_1.ts +++ b/clients/client-budgets/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2742,11 +2743,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts index f5211a28d0320..4c4322ffbb80f 100644 --- a/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3423,11 +3424,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts index 2216911fc55aa..e2054ea0e40b0 100644 --- a/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2605,11 +2606,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts index 154178cc27d57..5f053a515274d 100644 --- a/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1884,11 +1885,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts index b2a9924f7f730..1d0f8f7924bf4 100644 --- a/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5644,11 +5645,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts index dbf5331bfc94a..6bfff2d9331cd 100644 --- a/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -10498,11 +10499,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-chime/src/protocols/Aws_restJson1.ts b/clients/client-chime/src/protocols/Aws_restJson1.ts index 163aceb775985..04ad983121da1 100644 --- a/clients/client-chime/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -20671,11 +20672,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts b/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts index 23b3226aa9c4d..8a970476a3a0d 100644 --- a/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts +++ b/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4287,11 +4288,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloud9/src/protocols/Aws_json1_1.ts b/clients/client-cloud9/src/protocols/Aws_json1_1.ts index c690639c4ac94..69fdf90732f60 100644 --- a/clients/client-cloud9/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloud9/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1323,11 +1324,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts index e79b872762ba9..11c61991a8811 100644 --- a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts +++ b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1334,11 +1335,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts index 9d34af4dc66a2..c6896e46e0bbc 100644 --- a/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts +++ b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -8753,11 +8754,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudformation/src/protocols/Aws_query.ts b/clients/client-cloudformation/src/protocols/Aws_query.ts index 5e02af1727896..51cf95a289ce8 100644 --- a/clients/client-cloudformation/src/protocols/Aws_query.ts +++ b/clients/client-cloudformation/src/protocols/Aws_query.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -11063,11 +11064,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudfront/src/commands/GetFunctionCommand.ts b/clients/client-cloudfront/src/commands/GetFunctionCommand.ts index 8f7e9cb2154ec..c8170328b3bb5 100644 --- a/clients/client-cloudfront/src/commands/GetFunctionCommand.ts +++ b/clients/client-cloudfront/src/commands/GetFunctionCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetFunctionCommand}. */ export interface GetFunctionCommandInput extends GetFunctionRequest {} +/** + * @public + */ +export type GetFunctionCommandOutputType = Omit & { + FunctionCode?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetFunctionCommand}. */ -export interface GetFunctionCommandOutput extends GetFunctionResult, __MetadataBearer {} +export interface GetFunctionCommandOutput extends GetFunctionCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-cloudfront/src/protocols/Aws_restXml.ts b/clients/client-cloudfront/src/protocols/Aws_restXml.ts index 264e154db97d9..d523d4d5d5deb 100644 --- a/clients/client-cloudfront/src/protocols/Aws_restXml.ts +++ b/clients/client-cloudfront/src/protocols/Aws_restXml.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -19941,11 +19942,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts index 51157207f862b..e60f518964e52 100644 --- a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1505,11 +1506,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts index 00fd58bd46201..75e49bd4bb59d 100644 --- a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts @@ -5,6 +5,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1525,11 +1526,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudsearch-domain/src/commands/UploadDocumentsCommand.ts b/clients/client-cloudsearch-domain/src/commands/UploadDocumentsCommand.ts index f569a0e2c37fd..efab496340000 100644 --- a/clients/client-cloudsearch-domain/src/commands/UploadDocumentsCommand.ts +++ b/clients/client-cloudsearch-domain/src/commands/UploadDocumentsCommand.ts @@ -29,11 +29,6 @@ import { de_UploadDocumentsCommand, se_UploadDocumentsCommand } from "../protoco * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link UploadDocumentsCommand}. - */ export type UploadDocumentsCommandInputType = Omit & { /** * For *`UploadDocumentsRequest["documents"]`*, see {@link UploadDocumentsRequest.documents}. @@ -41,7 +36,9 @@ export type UploadDocumentsCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudsearch/src/protocols/Aws_query.ts b/clients/client-cloudsearch/src/protocols/Aws_query.ts index 962edddd25877..bf2828f13547e 100644 --- a/clients/client-cloudsearch/src/protocols/Aws_query.ts +++ b/clients/client-cloudsearch/src/protocols/Aws_query.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -4328,11 +4329,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts b/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts index 8fdab5672d9f1..c6a4ffe88b4f0 100644 --- a/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -259,11 +260,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts index 5bde0c5f54e03..771bd5ba07fef 100644 --- a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6350,11 +6351,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts index 1f47084b43db4..42e6bcc371e0b 100644 --- a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4662,11 +4663,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts index e40614372ad07..817e6759fc627 100644 --- a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4123,11 +4124,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cloudwatch/src/protocols/Aws_query.ts b/clients/client-cloudwatch/src/protocols/Aws_query.ts index 02605cf1db4b0..17a279c0d25e9 100644 --- a/clients/client-cloudwatch/src/protocols/Aws_query.ts +++ b/clients/client-cloudwatch/src/protocols/Aws_query.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -6685,11 +6686,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codeartifact/src/commands/PublishPackageVersionCommand.ts b/clients/client-codeartifact/src/commands/PublishPackageVersionCommand.ts index 3fbcc8fa629be..138c387e369fe 100644 --- a/clients/client-codeartifact/src/commands/PublishPackageVersionCommand.ts +++ b/clients/client-codeartifact/src/commands/PublishPackageVersionCommand.ts @@ -25,11 +25,6 @@ import { de_PublishPackageVersionCommand, se_PublishPackageVersionCommand } from * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link PublishPackageVersionCommand}. - */ export type PublishPackageVersionCommandInputType = Omit & { /** * For *`PublishPackageVersionRequest["assetContent"]`*, see {@link PublishPackageVersionRequest.assetContent}. @@ -37,7 +32,9 @@ export type PublishPackageVersionCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codebuild/src/protocols/Aws_json1_1.ts b/clients/client-codebuild/src/protocols/Aws_json1_1.ts index c0239cff37bd0..f10f15c248844 100644 --- a/clients/client-codebuild/src/protocols/Aws_json1_1.ts +++ b/clients/client-codebuild/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4018,11 +4019,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts b/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts index 8f829afa5b14d..5d8bcee9cf011 100644 --- a/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts +++ b/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2945,11 +2946,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codecommit/src/protocols/Aws_json1_1.ts b/clients/client-codecommit/src/protocols/Aws_json1_1.ts index e03b6ec4b8ee0..e4c04436568fb 100644 --- a/clients/client-codecommit/src/protocols/Aws_json1_1.ts +++ b/clients/client-codecommit/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -12534,11 +12535,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts index 0382c34fd39fa..1cbbf2db16baf 100644 --- a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts +++ b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6886,11 +6887,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts index 45cda4cd44a82..dd7bf4373a2e9 100644 --- a/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1686,11 +1687,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts b/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts index 2b973abed7a19..cb317e675d6bc 100644 --- a/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1522,11 +1523,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codeguruprofiler/src/commands/GetProfileCommand.ts b/clients/client-codeguruprofiler/src/commands/GetProfileCommand.ts index 9079d8e585ad6..a81f0f76f3811 100644 --- a/clients/client-codeguruprofiler/src/commands/GetProfileCommand.ts +++ b/clients/client-codeguruprofiler/src/commands/GetProfileCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetProfileCommand}. */ export interface GetProfileCommandInput extends GetProfileRequest {} +/** + * @public + */ +export type GetProfileCommandOutputType = Omit & { + profile: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetProfileCommand}. */ -export interface GetProfileCommandOutput extends GetProfileResponse, __MetadataBearer {} +export interface GetProfileCommandOutput extends GetProfileCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-codeguruprofiler/src/commands/PostAgentProfileCommand.ts b/clients/client-codeguruprofiler/src/commands/PostAgentProfileCommand.ts index fcaf7f8284928..5f8b415e3ccbb 100644 --- a/clients/client-codeguruprofiler/src/commands/PostAgentProfileCommand.ts +++ b/clients/client-codeguruprofiler/src/commands/PostAgentProfileCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_PostAgentProfileCommand, se_PostAgentProfileCommand } from "../proto * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type PostAgentProfileCommandInputType = Omit & { + agentProfile: BlobTypes; +}; /** * @public * * The input for {@link PostAgentProfileCommand}. */ -export interface PostAgentProfileCommandInput extends PostAgentProfileRequest {} +export interface PostAgentProfileCommandInput extends PostAgentProfileCommandInputType {} /** * @public * diff --git a/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts index 213df4ab9cbea..eaf2bd6561960 100644 --- a/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2672,11 +2673,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts index 3dd687dc85ecb..cb87f157a757e 100644 --- a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4241,11 +4242,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts index 48985ba254fb8..144f59b924403 100644 --- a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts +++ b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts @@ -5,6 +5,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -943,11 +944,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts index 750c5d87b6f24..00af3765fc5b9 100644 --- a/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts +++ b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1349,11 +1350,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-codestar/src/protocols/Aws_json1_1.ts b/clients/client-codestar/src/protocols/Aws_json1_1.ts index 3a57386805e85..9ce5e0b758f14 100644 --- a/clients/client-codestar/src/protocols/Aws_json1_1.ts +++ b/clients/client-codestar/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1691,11 +1692,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts index eb00bd30fb1e4..f03e9c15f428f 100644 --- a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -10581,11 +10582,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts index 3d91a8faff44c..8b7f18e61b5fe 100644 --- a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2200,11 +2201,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts index 7beb3f002b51f..24e9d990d0af7 100644 --- a/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts +++ b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2112,11 +2113,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-comprehend/src/protocols/Aws_json1_1.ts b/clients/client-comprehend/src/protocols/Aws_json1_1.ts index 9bd54cdad5d40..72d1340abe3f8 100644 --- a/clients/client-comprehend/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehend/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -9463,11 +9464,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts index c5a1403c187c1..270ac5b6d1a08 100644 --- a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2973,11 +2974,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts index d924fb40778fe..18b7641ed58dd 100644 --- a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts +++ b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3135,11 +3136,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-config-service/src/protocols/Aws_json1_1.ts b/clients/client-config-service/src/protocols/Aws_json1_1.ts index 0a10c2656a32f..323bc3fc28cea 100644 --- a/clients/client-config-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-config-service/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -9506,11 +9507,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts index 8dfe4d6633af2..db87a80e177c6 100644 --- a/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -251,11 +252,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-connect/src/protocols/Aws_restJson1.ts b/clients/client-connect/src/protocols/Aws_restJson1.ts index b59d3098367f4..aca5fdb400186 100644 --- a/clients/client-connect/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect/src/protocols/Aws_restJson1.ts @@ -20,6 +20,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -20715,11 +20716,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts b/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts index ee978e79f92ef..8058df710cd94 100644 --- a/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2351,11 +2352,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-connectcases/src/protocols/Aws_restJson1.ts b/clients/client-connectcases/src/protocols/Aws_restJson1.ts index c9d8815d117a7..3e24a01b79a98 100644 --- a/clients/client-connectcases/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectcases/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3362,11 +3363,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts index 5abbad5ef43cf..4bb623546e1ea 100644 --- a/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -911,11 +912,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-controltower/src/protocols/Aws_restJson1.ts b/clients/client-controltower/src/protocols/Aws_restJson1.ts index d83be4785ed7b..bdd14604d7685 100644 --- a/clients/client-controltower/src/protocols/Aws_restJson1.ts +++ b/clients/client-controltower/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -571,11 +572,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts index ef96cfa27f94c..d81089447baa7 100644 --- a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts @@ -5,6 +5,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -398,11 +399,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts index bf2d9aac665e0..d6f178cdb0d14 100644 --- a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3821,11 +3822,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts index 2c90cfb9b1a1d..7f3b79f839b6d 100644 --- a/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts +++ b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts @@ -19,6 +19,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5496,11 +5497,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts index 4a5af2a7f777f..b522ca9dba846 100644 --- a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts @@ -6,6 +6,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1615,11 +1616,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts index 2eea0895b15fc..6cf363a9adf54 100644 --- a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6562,11 +6563,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-databrew/src/protocols/Aws_restJson1.ts b/clients/client-databrew/src/protocols/Aws_restJson1.ts index 5662895a97531..e11fcd6a2fb1a 100644 --- a/clients/client-databrew/src/protocols/Aws_restJson1.ts +++ b/clients/client-databrew/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4466,11 +4467,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-dataexchange/src/protocols/Aws_restJson1.ts b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts index 6ecdf18dbe923..112a8f96d6bd9 100644 --- a/clients/client-dataexchange/src/protocols/Aws_restJson1.ts +++ b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -3295,11 +3296,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-datasync/src/protocols/Aws_json1_1.ts b/clients/client-datasync/src/protocols/Aws_json1_1.ts index 821fbdb81e45a..d3fd08e2cbf8c 100644 --- a/clients/client-datasync/src/protocols/Aws_json1_1.ts +++ b/clients/client-datasync/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -4872,11 +4873,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-dax/src/protocols/Aws_json1_1.ts b/clients/client-dax/src/protocols/Aws_json1_1.ts index 03e593c78f7a1..8ffa77e55b3d2 100644 --- a/clients/client-dax/src/protocols/Aws_json1_1.ts +++ b/clients/client-dax/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2445,11 +2446,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-detective/src/protocols/Aws_restJson1.ts b/clients/client-detective/src/protocols/Aws_restJson1.ts index 01fd4affbd930..95bfdd3f9c0ae 100644 --- a/clients/client-detective/src/protocols/Aws_restJson1.ts +++ b/clients/client-detective/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2531,11 +2532,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-device-farm/src/protocols/Aws_json1_1.ts b/clients/client-device-farm/src/protocols/Aws_json1_1.ts index 1879fbae35249..d52f3b597a305 100644 --- a/clients/client-device-farm/src/protocols/Aws_json1_1.ts +++ b/clients/client-device-farm/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -7248,11 +7249,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-devops-guru/src/protocols/Aws_restJson1.ts b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts index d045392e8bb3a..72d543a4045c6 100644 --- a/clients/client-devops-guru/src/protocols/Aws_restJson1.ts +++ b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4050,11 +4051,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts index 63b8891a7bbb9..66cd6abaeb31d 100644 --- a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4865,11 +4866,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-directory-service/src/protocols/Aws_json1_1.ts b/clients/client-directory-service/src/protocols/Aws_json1_1.ts index f26ac0234e740..2b392b8f8dab2 100644 --- a/clients/client-directory-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-directory-service/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6812,11 +6813,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-dlm/src/protocols/Aws_restJson1.ts b/clients/client-dlm/src/protocols/Aws_restJson1.ts index edec29aa0f20a..51f1f4a359f57 100644 --- a/clients/client-dlm/src/protocols/Aws_restJson1.ts +++ b/clients/client-dlm/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -981,11 +982,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts b/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts index ad3a2f7662504..545ec3e0a7612 100644 --- a/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts +++ b/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1377,11 +1378,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-docdb/src/protocols/Aws_query.ts b/clients/client-docdb/src/protocols/Aws_query.ts index cd13178def482..fefa2d4f79880 100644 --- a/clients/client-docdb/src/protocols/Aws_query.ts +++ b/clients/client-docdb/src/protocols/Aws_query.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -9627,11 +9628,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-drs/src/protocols/Aws_restJson1.ts b/clients/client-drs/src/protocols/Aws_restJson1.ts index 11bce6a208f23..c848dd2681549 100644 --- a/clients/client-drs/src/protocols/Aws_restJson1.ts +++ b/clients/client-drs/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4975,11 +4976,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts index e47065965a9b9..ac570d0a015fa 100644 --- a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -604,11 +605,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts index 626ebb1ebf0fa..e75ffd561fc21 100644 --- a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7126,11 +7127,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ebs/src/commands/PutSnapshotBlockCommand.ts b/clients/client-ebs/src/commands/PutSnapshotBlockCommand.ts index 14a0e25da6165..63ed3e20344e3 100644 --- a/clients/client-ebs/src/commands/PutSnapshotBlockCommand.ts +++ b/clients/client-ebs/src/commands/PutSnapshotBlockCommand.ts @@ -25,11 +25,6 @@ import { de_PutSnapshotBlockCommand, se_PutSnapshotBlockCommand } from "../proto * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link PutSnapshotBlockCommand}. - */ export type PutSnapshotBlockCommandInputType = Omit & { /** * For *`PutSnapshotBlockRequest["BlockData"]`*, see {@link PutSnapshotBlockRequest.BlockData}. @@ -37,7 +32,9 @@ export type PutSnapshotBlockCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts index 575d6ffdf199d..b4d1085dd255b 100644 --- a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts @@ -5,6 +5,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -402,11 +403,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ec2/src/protocols/Aws_ec2.ts b/clients/client-ec2/src/protocols/Aws_ec2.ts index 5f33882ac3529..c5a366a37667b 100644 --- a/clients/client-ec2/src/protocols/Aws_ec2.ts +++ b/clients/client-ec2/src/protocols/Aws_ec2.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -93473,11 +93474,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts index 671e72de072fb..3605bd9d376c7 100644 --- a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2562,11 +2563,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ecr/src/protocols/Aws_json1_1.ts b/clients/client-ecr/src/protocols/Aws_json1_1.ts index 58737aadbd4a3..74e3d868f1799 100644 --- a/clients/client-ecr/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4436,11 +4437,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ecs/src/protocols/Aws_json1_1.ts b/clients/client-ecs/src/protocols/Aws_json1_1.ts index 083f9a18423e6..79c4b35346723 100644 --- a/clients/client-ecs/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecs/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6177,11 +6178,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-efs/src/protocols/Aws_restJson1.ts b/clients/client-efs/src/protocols/Aws_restJson1.ts index 219104f0da384..6a1435476a6db 100644 --- a/clients/client-efs/src/protocols/Aws_restJson1.ts +++ b/clients/client-efs/src/protocols/Aws_restJson1.ts @@ -19,6 +19,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3686,11 +3687,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-eks/src/protocols/Aws_restJson1.ts b/clients/client-eks/src/protocols/Aws_restJson1.ts index 1d8fbf6ef2b3c..042157955d7dd 100644 --- a/clients/client-eks/src/protocols/Aws_restJson1.ts +++ b/clients/client-eks/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3903,11 +3904,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts index d232050473678..ee7f3293cff39 100644 --- a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts +++ b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -7619,11 +7620,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts index 5a7acbfaca208..a5fff84ce5092 100644 --- a/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -614,11 +615,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts index 92e1d1a57d939..e84f509e7c5ef 100644 --- a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -7216,11 +7217,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts index a926e763b2883..254630b26f6f8 100644 --- a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -5009,11 +5010,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts index 721120f61dfdc..9198c9f70492b 100644 --- a/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1898,11 +1899,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-elasticache/src/protocols/Aws_query.ts b/clients/client-elasticache/src/protocols/Aws_query.ts index ab2c18e3df032..f2078a9fd6302 100644 --- a/clients/client-elasticache/src/protocols/Aws_query.ts +++ b/clients/client-elasticache/src/protocols/Aws_query.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -13298,11 +13299,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts index ee3929c866026..c10c28bf1d093 100644 --- a/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5684,11 +5685,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-emr-containers/src/protocols/Aws_restJson1.ts b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts index 3f8d16200765a..0e16066f1157a 100644 --- a/clients/client-emr-containers/src/protocols/Aws_restJson1.ts +++ b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2257,11 +2258,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts b/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts index 742af5357a014..bdc3aee5b59fe 100644 --- a/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts +++ b/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1759,11 +1760,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-emr/src/protocols/Aws_json1_1.ts b/clients/client-emr/src/protocols/Aws_json1_1.ts index b89936abfbc17..ea17497968cb8 100644 --- a/clients/client-emr/src/protocols/Aws_json1_1.ts +++ b/clients/client-emr/src/protocols/Aws_json1_1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5280,11 +5281,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts index 981b8b96d4bee..aa0dac7b09874 100644 --- a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts +++ b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5110,11 +5111,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-evidently/src/protocols/Aws_restJson1.ts b/clients/client-evidently/src/protocols/Aws_restJson1.ts index eae492ea599ec..77fcfc5f215a9 100644 --- a/clients/client-evidently/src/protocols/Aws_restJson1.ts +++ b/clients/client-evidently/src/protocols/Aws_restJson1.ts @@ -21,6 +21,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -4333,11 +4334,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-finspace-data/src/protocols/Aws_restJson1.ts b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts index 768ac342629c5..da65402865334 100644 --- a/clients/client-finspace-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3247,11 +3248,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-finspace/src/protocols/Aws_restJson1.ts b/clients/client-finspace/src/protocols/Aws_restJson1.ts index b7b9f42dfc8f3..89b9fa1dc7cb3 100644 --- a/clients/client-finspace/src/protocols/Aws_restJson1.ts +++ b/clients/client-finspace/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4018,11 +4019,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-firehose/src/protocols/Aws_json1_1.ts b/clients/client-firehose/src/protocols/Aws_json1_1.ts index 3afc8bfecd78e..fd798b6bc71b2 100644 --- a/clients/client-firehose/src/protocols/Aws_json1_1.ts +++ b/clients/client-firehose/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1644,11 +1645,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-fis/src/protocols/Aws_restJson1.ts b/clients/client-fis/src/protocols/Aws_restJson1.ts index f31245e43515f..8710be59b1399 100644 --- a/clients/client-fis/src/protocols/Aws_restJson1.ts +++ b/clients/client-fis/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1636,11 +1637,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-fms/src/protocols/Aws_json1_1.ts b/clients/client-fms/src/protocols/Aws_json1_1.ts index 21cb4904e879a..4bcb93003fac1 100644 --- a/clients/client-fms/src/protocols/Aws_json1_1.ts +++ b/clients/client-fms/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3836,11 +3837,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-forecast/src/protocols/Aws_json1_1.ts b/clients/client-forecast/src/protocols/Aws_json1_1.ts index df748d1be4362..265762a2c4288 100644 --- a/clients/client-forecast/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecast/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6149,11 +6150,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts index 38756f8140e18..07c37d9faa046 100644 --- a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts @@ -8,6 +8,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -340,11 +341,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts index a2dd0dee3c5c4..4c0ae6cf8325b 100644 --- a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts +++ b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts @@ -8,6 +8,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6625,11 +6626,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-fsx/src/protocols/Aws_json1_1.ts b/clients/client-fsx/src/protocols/Aws_json1_1.ts index c0ff8aee28d47..5747a3f470c8f 100644 --- a/clients/client-fsx/src/protocols/Aws_json1_1.ts +++ b/clients/client-fsx/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5210,11 +5211,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-gamelift/src/protocols/Aws_json1_1.ts b/clients/client-gamelift/src/protocols/Aws_json1_1.ts index 942b99c6068bb..6ad0d97e5f1f1 100644 --- a/clients/client-gamelift/src/protocols/Aws_json1_1.ts +++ b/clients/client-gamelift/src/protocols/Aws_json1_1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -9938,11 +9939,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-gamesparks/src/protocols/Aws_restJson1.ts b/clients/client-gamesparks/src/protocols/Aws_restJson1.ts index 2d17d58137602..87ca3aae13564 100644 --- a/clients/client-gamesparks/src/protocols/Aws_restJson1.ts +++ b/clients/client-gamesparks/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3410,11 +3411,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-glacier/src/commands/UploadArchiveCommand.ts b/clients/client-glacier/src/commands/UploadArchiveCommand.ts index 51f6a99aafa89..f859f0e31dbfa 100644 --- a/clients/client-glacier/src/commands/UploadArchiveCommand.ts +++ b/clients/client-glacier/src/commands/UploadArchiveCommand.ts @@ -21,11 +21,6 @@ import { de_UploadArchiveCommand, se_UploadArchiveCommand } from "../protocols/A * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link UploadArchiveCommand}. - */ export type UploadArchiveCommandInputType = Omit & { /** * For *`UploadArchiveInput["body"]`*, see {@link UploadArchiveInput.body}. @@ -33,7 +28,9 @@ export type UploadArchiveCommandInputType = Omit & { body?: UploadArchiveInput["body"] | string | Uint8Array | Buffer; }; /** - * This interface extends from `UploadArchiveInput` interface. There are more parameters than `body` defined in {@link UploadArchiveInput} + * @public + * + * The input for {@link UploadArchiveCommand}. */ export interface UploadArchiveCommandInput extends UploadArchiveCommandInputType {} /** diff --git a/clients/client-glacier/src/commands/UploadMultipartPartCommand.ts b/clients/client-glacier/src/commands/UploadMultipartPartCommand.ts index bb8078cf6afff..cfe44c1b6c1d8 100644 --- a/clients/client-glacier/src/commands/UploadMultipartPartCommand.ts +++ b/clients/client-glacier/src/commands/UploadMultipartPartCommand.ts @@ -25,11 +25,6 @@ import { de_UploadMultipartPartCommand, se_UploadMultipartPartCommand } from ".. * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link UploadMultipartPartCommand}. - */ export type UploadMultipartPartCommandInputType = Omit & { /** * For *`UploadMultipartPartInput["body"]`*, see {@link UploadMultipartPartInput.body}. @@ -37,7 +32,9 @@ export type UploadMultipartPartCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts index fa65fe36f81b4..5100a6e111130 100644 --- a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts +++ b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4605,11 +4606,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-glue/src/protocols/Aws_json1_1.ts b/clients/client-glue/src/protocols/Aws_json1_1.ts index ffa2d30749820..46cab57e6d172 100644 --- a/clients/client-glue/src/protocols/Aws_json1_1.ts +++ b/clients/client-glue/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -20601,11 +20602,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-grafana/src/protocols/Aws_restJson1.ts b/clients/client-grafana/src/protocols/Aws_restJson1.ts index 7ecf40f545d9f..39b75af8c36b8 100644 --- a/clients/client-grafana/src/protocols/Aws_restJson1.ts +++ b/clients/client-grafana/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2017,11 +2018,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-greengrass/src/protocols/Aws_restJson1.ts b/clients/client-greengrass/src/protocols/Aws_restJson1.ts index 0d07d8b0c63a5..03289b544cdb9 100644 --- a/clients/client-greengrass/src/protocols/Aws_restJson1.ts +++ b/clients/client-greengrass/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -8159,11 +8160,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts index 6e419d9e672f8..e69a907ba5e38 100644 --- a/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts @@ -20,6 +20,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3503,11 +3504,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-groundstation/src/protocols/Aws_restJson1.ts b/clients/client-groundstation/src/protocols/Aws_restJson1.ts index 41dc01795d029..624c45360b2a4 100644 --- a/clients/client-groundstation/src/protocols/Aws_restJson1.ts +++ b/clients/client-groundstation/src/protocols/Aws_restJson1.ts @@ -19,6 +19,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3567,11 +3568,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-guardduty/src/protocols/Aws_restJson1.ts b/clients/client-guardduty/src/protocols/Aws_restJson1.ts index 75ca9108e40fd..b4268a7e6ee22 100644 --- a/clients/client-guardduty/src/protocols/Aws_restJson1.ts +++ b/clients/client-guardduty/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -8629,11 +8630,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-health/src/protocols/Aws_json1_1.ts b/clients/client-health/src/protocols/Aws_json1_1.ts index 12aa91cbb94f2..8c13deaa831ea 100644 --- a/clients/client-health/src/protocols/Aws_json1_1.ts +++ b/clients/client-health/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1349,11 +1350,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-healthlake/src/protocols/Aws_json1_0.ts b/clients/client-healthlake/src/protocols/Aws_json1_0.ts index e2ecaef5e9987..9aaaa413efde2 100644 --- a/clients/client-healthlake/src/protocols/Aws_json1_0.ts +++ b/clients/client-healthlake/src/protocols/Aws_json1_0.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1383,11 +1384,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-honeycode/src/protocols/Aws_restJson1.ts b/clients/client-honeycode/src/protocols/Aws_restJson1.ts index 180e864107f91..86e5945944ad4 100644 --- a/clients/client-honeycode/src/protocols/Aws_restJson1.ts +++ b/clients/client-honeycode/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1912,11 +1913,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iam/src/protocols/Aws_query.ts b/clients/client-iam/src/protocols/Aws_query.ts index 5a35a5be658cc..53b8f0d2a0ed6 100644 --- a/clients/client-iam/src/protocols/Aws_query.ts +++ b/clients/client-iam/src/protocols/Aws_query.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -18542,11 +18543,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-identitystore/src/protocols/Aws_json1_1.ts b/clients/client-identitystore/src/protocols/Aws_json1_1.ts index 3a76716e08b27..23c75817df1be 100644 --- a/clients/client-identitystore/src/protocols/Aws_json1_1.ts +++ b/clients/client-identitystore/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1823,11 +1824,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts index 2850faf69226f..705dd8731a119 100644 --- a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -6483,11 +6484,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-inspector/src/protocols/Aws_json1_1.ts b/clients/client-inspector/src/protocols/Aws_json1_1.ts index 02037e0bce41f..93cd02c4c1db8 100644 --- a/clients/client-inspector/src/protocols/Aws_json1_1.ts +++ b/clients/client-inspector/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3570,11 +3571,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-inspector2/src/protocols/Aws_restJson1.ts b/clients/client-inspector2/src/protocols/Aws_restJson1.ts index 8f15317c9ec9d..7623e38af33a3 100644 --- a/clients/client-inspector2/src/protocols/Aws_restJson1.ts +++ b/clients/client-inspector2/src/protocols/Aws_restJson1.ts @@ -20,6 +20,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4780,11 +4781,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts b/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts index 438de88564656..b134e67195ec8 100644 --- a/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts +++ b/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1291,11 +1292,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts index 0be4dd447e746..8b315d8f9b00b 100644 --- a/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1370,11 +1371,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts index 41786cd492dbb..ae74154c50cc1 100644 --- a/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1618,11 +1619,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot-data-plane/src/commands/DeleteThingShadowCommand.ts b/clients/client-iot-data-plane/src/commands/DeleteThingShadowCommand.ts index 9eff372103daa..a68c7c390ec96 100644 --- a/clients/client-iot-data-plane/src/commands/DeleteThingShadowCommand.ts +++ b/clients/client-iot-data-plane/src/commands/DeleteThingShadowCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link DeleteThingShadowCommand}. */ export interface DeleteThingShadowCommandInput extends DeleteThingShadowRequest {} +/** + * @public + */ +export type DeleteThingShadowCommandOutputType = Omit & { + payload: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link DeleteThingShadowCommand}. */ -export interface DeleteThingShadowCommandOutput extends DeleteThingShadowResponse, __MetadataBearer {} +export interface DeleteThingShadowCommandOutput extends DeleteThingShadowCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-iot-data-plane/src/commands/GetThingShadowCommand.ts b/clients/client-iot-data-plane/src/commands/GetThingShadowCommand.ts index 24809ceda101c..60d20b5ee2b44 100644 --- a/clients/client-iot-data-plane/src/commands/GetThingShadowCommand.ts +++ b/clients/client-iot-data-plane/src/commands/GetThingShadowCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetThingShadowCommand}. */ export interface GetThingShadowCommandInput extends GetThingShadowRequest {} +/** + * @public + */ +export type GetThingShadowCommandOutputType = Omit & { + payload?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetThingShadowCommand}. */ -export interface GetThingShadowCommandOutput extends GetThingShadowResponse, __MetadataBearer {} +export interface GetThingShadowCommandOutput extends GetThingShadowCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-iot-data-plane/src/commands/PublishCommand.ts b/clients/client-iot-data-plane/src/commands/PublishCommand.ts index d713d44c0f7ae..fab1099cc227e 100644 --- a/clients/client-iot-data-plane/src/commands/PublishCommand.ts +++ b/clients/client-iot-data-plane/src/commands/PublishCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_PublishCommand, se_PublishCommand } from "../protocols/Aws_restJson1 * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type PublishCommandInputType = Omit & { + payload?: BlobTypes; +}; /** * @public * * The input for {@link PublishCommand}. */ -export interface PublishCommandInput extends PublishRequest {} +export interface PublishCommandInput extends PublishCommandInputType {} /** * @public * diff --git a/clients/client-iot-data-plane/src/commands/UpdateThingShadowCommand.ts b/clients/client-iot-data-plane/src/commands/UpdateThingShadowCommand.ts index b4162e16e8ead..bd734ae33af8b 100644 --- a/clients/client-iot-data-plane/src/commands/UpdateThingShadowCommand.ts +++ b/clients/client-iot-data-plane/src/commands/UpdateThingShadowCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -10,6 +11,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -21,18 +23,30 @@ import { de_UpdateThingShadowCommand, se_UpdateThingShadowCommand } from "../pro * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type UpdateThingShadowCommandInputType = Omit & { + payload: BlobTypes; +}; /** * @public * * The input for {@link UpdateThingShadowCommand}. */ -export interface UpdateThingShadowCommandInput extends UpdateThingShadowRequest {} +export interface UpdateThingShadowCommandInput extends UpdateThingShadowCommandInputType {} +/** + * @public + */ +export type UpdateThingShadowCommandOutputType = Omit & { + payload?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link UpdateThingShadowCommand}. */ -export interface UpdateThingShadowCommandOutput extends UpdateThingShadowResponse, __MetadataBearer {} +export interface UpdateThingShadowCommandOutput extends UpdateThingShadowCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts index 19b826296bf0d..adc867adc12ea 100644 --- a/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -918,11 +919,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts index 3686eaa7e28b3..2ba612b6b45b8 100644 --- a/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1454,11 +1455,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot-events/src/protocols/Aws_restJson1.ts b/clients/client-iot-events/src/protocols/Aws_restJson1.ts index 2e306c16979d6..50812fe2b11d4 100644 --- a/clients/client-iot-events/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3166,11 +3167,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts index ab447d3825695..9c9daf5a445f3 100644 --- a/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -566,11 +567,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts b/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts index 3b02a003d18b7..691ddb9ae6f93 100644 --- a/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2240,11 +2241,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot-wireless/src/commands/GetPositionEstimateCommand.ts b/clients/client-iot-wireless/src/commands/GetPositionEstimateCommand.ts index 2b5e347331aa0..03685721e2931 100644 --- a/clients/client-iot-wireless/src/commands/GetPositionEstimateCommand.ts +++ b/clients/client-iot-wireless/src/commands/GetPositionEstimateCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetPositionEstimateCommand}. */ export interface GetPositionEstimateCommandInput extends GetPositionEstimateRequest {} +/** + * @public + */ +export type GetPositionEstimateCommandOutputType = Omit & { + GeoJsonPayload?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetPositionEstimateCommand}. */ -export interface GetPositionEstimateCommandOutput extends GetPositionEstimateResponse, __MetadataBearer {} +export interface GetPositionEstimateCommandOutput extends GetPositionEstimateCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-iot-wireless/src/commands/GetResourcePositionCommand.ts b/clients/client-iot-wireless/src/commands/GetResourcePositionCommand.ts index b273571267bc8..61f01ee4c1a75 100644 --- a/clients/client-iot-wireless/src/commands/GetResourcePositionCommand.ts +++ b/clients/client-iot-wireless/src/commands/GetResourcePositionCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetResourcePositionCommand}. */ export interface GetResourcePositionCommandInput extends GetResourcePositionRequest {} +/** + * @public + */ +export type GetResourcePositionCommandOutputType = Omit & { + GeoJsonPayload?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetResourcePositionCommand}. */ -export interface GetResourcePositionCommandOutput extends GetResourcePositionResponse, __MetadataBearer {} +export interface GetResourcePositionCommandOutput extends GetResourcePositionCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-iot-wireless/src/commands/UpdateResourcePositionCommand.ts b/clients/client-iot-wireless/src/commands/UpdateResourcePositionCommand.ts index 0a6a82a4b4813..e6cce2cfb0878 100644 --- a/clients/client-iot-wireless/src/commands/UpdateResourcePositionCommand.ts +++ b/clients/client-iot-wireless/src/commands/UpdateResourcePositionCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_UpdateResourcePositionCommand, se_UpdateResourcePositionCommand } fr * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type UpdateResourcePositionCommandInputType = Omit & { + GeoJsonPayload?: BlobTypes; +}; /** * @public * * The input for {@link UpdateResourcePositionCommand}. */ -export interface UpdateResourcePositionCommandInput extends UpdateResourcePositionRequest {} +export interface UpdateResourcePositionCommandInput extends UpdateResourcePositionCommandInputType {} /** * @public * diff --git a/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts index af655c80a8174..dd4b6a6463ac4 100644 --- a/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts @@ -21,6 +21,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -11077,11 +11078,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iot/src/protocols/Aws_restJson1.ts b/clients/client-iot/src/protocols/Aws_restJson1.ts index e4be41e1bfc99..28298ceccf8bc 100644 --- a/clients/client-iot/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot/src/protocols/Aws_restJson1.ts @@ -19,6 +19,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -26494,11 +26495,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts index 53c3e58d6fe06..3962f649cb2f9 100644 --- a/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4014,11 +4015,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts index b0dfe60e7b4e5..7cb30c3820401 100644 --- a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1478,11 +1479,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts index f7b58c1a633e8..307de7a328eb4 100644 --- a/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -857,11 +858,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts index d070d0177d8ce..fdc5af9116340 100644 --- a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts +++ b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5177,11 +5178,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts index 1bce1bfbec86d..3f67d38bd9c9e 100644 --- a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -684,11 +685,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts index 9176debdcc6aa..4cf8041d6221e 100644 --- a/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -8572,11 +8573,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts index 3f8d8b48a3afc..8aa441dc1f32f 100644 --- a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3256,11 +3257,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts b/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts index 7ba960b3675bf..1d02966cf2ac9 100644 --- a/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts +++ b/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts @@ -19,6 +19,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -4646,11 +4647,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts b/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts index 4b3f7776dded6..647a4f11eddac 100644 --- a/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1610,11 +1611,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ivs/src/protocols/Aws_restJson1.ts b/clients/client-ivs/src/protocols/Aws_restJson1.ts index 18e1a582b4cab..d4a4d0b584210 100644 --- a/clients/client-ivs/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivs/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2797,11 +2798,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ivschat/src/protocols/Aws_restJson1.ts b/clients/client-ivschat/src/protocols/Aws_restJson1.ts index 706db5960013a..b984a24cf41d8 100644 --- a/clients/client-ivschat/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivschat/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1847,11 +1848,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kafka/src/protocols/Aws_restJson1.ts b/clients/client-kafka/src/protocols/Aws_restJson1.ts index 9cbd6735abb04..91ce0a1dfda3d 100644 --- a/clients/client-kafka/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafka/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5703,11 +5704,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts index b229bd0a1d279..2b90463d86a80 100644 --- a/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1695,11 +1696,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts b/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts index e09da7502d255..dd8ecf323d888 100644 --- a/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts +++ b/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1044,11 +1045,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kendra/src/protocols/Aws_json1_1.ts b/clients/client-kendra/src/protocols/Aws_json1_1.ts index 85de908e0e634..d963a42bbee5c 100644 --- a/clients/client-kendra/src/protocols/Aws_json1_1.ts +++ b/clients/client-kendra/src/protocols/Aws_json1_1.ts @@ -19,6 +19,7 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7523,11 +7524,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts index fc69a608e3e3f..8c9e2b835eb36 100644 --- a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts +++ b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1308,11 +1309,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts index 098c500ec7f6e..5cd94967bf046 100644 --- a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3367,11 +3368,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts index f73a79f9c1ef3..b8f88638b0269 100644 --- a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2041,11 +2042,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts index 4926b4590b6bf..65f1ab4fe9606 100644 --- a/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -965,11 +966,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts index 6e74aaa207528..51cec8294df35 100644 --- a/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts @@ -11,6 +11,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -260,11 +261,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts index adffcaf99fb26..ff2aaa2c27933 100644 --- a/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -347,11 +348,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts index b5f8a6784b8d0..3745bec105ac2 100644 --- a/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts @@ -8,6 +8,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -191,11 +192,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts index f87c16b429fe0..553d8f8e068b2 100644 --- a/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3080,11 +3081,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kinesis/src/protocols/Aws_json1_1.ts b/clients/client-kinesis/src/protocols/Aws_json1_1.ts index 6e32b34856035..43c6c7f202f1e 100644 --- a/clients/client-kinesis/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis/src/protocols/Aws_json1_1.ts @@ -17,6 +17,7 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3071,11 +3072,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-kms/src/commands/CreateKeyCommand.ts b/clients/client-kms/src/commands/CreateKeyCommand.ts index 8844c8c9248cc..e3dd7cedbdcf0 100644 --- a/clients/client-kms/src/commands/CreateKeyCommand.ts +++ b/clients/client-kms/src/commands/CreateKeyCommand.ts @@ -581,7 +581,7 @@ export interface CreateKeyCommandOutput extends CreateKeyResponse, __MetadataBea * * @example To create a KMS key for imported key material * ```javascript - * // This example creates a KMS key with no key material. When the operation is complete, you can import your own key material into the KMS key. To create this KMS key, set the Origin parameter to EXTERNAL. + * // This example creates a symmetric KMS key with no key material. When the operation is complete, you can import your own key material into the KMS key. To create this KMS key, set the Origin parameter to EXTERNAL. * const input = { * "Origin": "EXTERNAL" * }; diff --git a/clients/client-kms/src/commands/GetParametersForImportCommand.ts b/clients/client-kms/src/commands/GetParametersForImportCommand.ts index 622b9d01438f2..7cb80c1cf74df 100644 --- a/clients/client-kms/src/commands/GetParametersForImportCommand.ts +++ b/clients/client-kms/src/commands/GetParametersForImportCommand.ts @@ -182,27 +182,6 @@ export interface GetParametersForImportCommandOutput extends GetParametersForImp * @throws {@link KMSServiceException} *

Base exception class for all service exceptions from KMS service.

* - * @example To retrieve the public key and import token for a KMS key - * ```javascript - * // The following example retrieves the public key and import token for the specified KMS key. - * const input = { - * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", - * "WrappingAlgorithm": "RSAES_OAEP_SHA_1", - * "WrappingKeySpec": "RSA_2048" - * }; - * const command = new GetParametersForImportCommand(input); - * const response = await client.send(command); - * /* response == - * { - * "ImportToken": "", - * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", - * "ParametersValidTo": "2016-12-01T14:52:17-08:00", - * "PublicKey": "" - * } - * *\/ - * // example id: to-retrieve-the-public-key-and-import-token-for-a-cmk-1480626483211 - * ``` - * * @example To download the public key and import token for a symmetric encryption KMS key * ```javascript * // The following example downloads a public key and import token to import symmetric encryption key material. It uses the default wrapping key spec and the RSAES_OAEP_SHA_256 wrapping algorithm. diff --git a/clients/client-kms/src/commands/ImportKeyMaterialCommand.ts b/clients/client-kms/src/commands/ImportKeyMaterialCommand.ts index 56cd9132dc9ef..d7f3a1d654db2 100644 --- a/clients/client-kms/src/commands/ImportKeyMaterialCommand.ts +++ b/clients/client-kms/src/commands/ImportKeyMaterialCommand.ts @@ -236,20 +236,6 @@ export interface ImportKeyMaterialCommandOutput extends ImportKeyMaterialRespons * }; * const command = new ImportKeyMaterialCommand(input); * await client.send(command); - * // example id: to-import-key-material-into-a-cmk-1480630551969 - * ``` - * - * @example To import key material into a KMS key - * ```javascript - * // The following example imports key material into the specified KMS key. - * const input = { - * "EncryptedKeyMaterial": "", - * "ExpirationModel": "KEY_MATERIAL_DOES_NOT_EXPIRE", - * "ImportToken": "", - * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab" - * }; - * const command = new ImportKeyMaterialCommand(input); - * await client.send(command); * // example id: to-import-key-material-into-a-kms-key-1 * ``` * diff --git a/clients/client-kms/src/protocols/Aws_json1_1.ts b/clients/client-kms/src/protocols/Aws_json1_1.ts index 0b917143ee9f0..9b15ec50dc9a3 100644 --- a/clients/client-kms/src/protocols/Aws_json1_1.ts +++ b/clients/client-kms/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5503,11 +5504,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lakeformation/src/protocols/Aws_restJson1.ts b/clients/client-lakeformation/src/protocols/Aws_restJson1.ts index 7cf561fdeff5f..775430b7d98dd 100644 --- a/clients/client-lakeformation/src/protocols/Aws_restJson1.ts +++ b/clients/client-lakeformation/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -5049,11 +5050,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lambda/src/commands/InvokeAsyncCommand.ts b/clients/client-lambda/src/commands/InvokeAsyncCommand.ts index e59ac24de8b31..cf1d00f91a7fa 100644 --- a/clients/client-lambda/src/commands/InvokeAsyncCommand.ts +++ b/clients/client-lambda/src/commands/InvokeAsyncCommand.ts @@ -21,11 +21,6 @@ import { de_InvokeAsyncCommand, se_InvokeAsyncCommand } from "../protocols/Aws_r * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link InvokeAsyncCommand}. - */ export type InvokeAsyncCommandInputType = Omit & { /** * For *`InvokeAsyncRequest["InvokeArgs"]`*, see {@link InvokeAsyncRequest.InvokeArgs}. @@ -33,7 +28,9 @@ export type InvokeAsyncCommandInputType = Omit InvokeArgs: InvokeAsyncRequest["InvokeArgs"] | string | Uint8Array | Buffer; }; /** - * This interface extends from `InvokeAsyncRequest` interface. There are more parameters than `InvokeArgs` defined in {@link InvokeAsyncRequest} + * @public + * + * The input for {@link InvokeAsyncCommand}. */ export interface InvokeAsyncCommandInput extends InvokeAsyncCommandInputType {} /** diff --git a/clients/client-lambda/src/commands/InvokeCommand.ts b/clients/client-lambda/src/commands/InvokeCommand.ts index 895bb53ce885e..06813b3904fa0 100644 --- a/clients/client-lambda/src/commands/InvokeCommand.ts +++ b/clients/client-lambda/src/commands/InvokeCommand.ts @@ -30,21 +30,27 @@ import { de_InvokeCommand, se_InvokeCommand } from "../protocols/Aws_restJson1"; export { __MetadataBearer, $Command }; /** * @public - * - * The input for {@link InvokeCommand}. */ export type InvokeCommandInputType = Omit & { Payload?: BlobTypes; }; -export interface InvokeCommandInput extends InvokeCommandInputType {} /** * @public * - * The output of {@link InvokeCommand}. + * The input for {@link InvokeCommand}. + */ +export interface InvokeCommandInput extends InvokeCommandInputType {} +/** + * @public */ export type InvokeCommandOutputType = Omit & { Payload?: Uint8ArrayBlobAdapter; }; +/** + * @public + * + * The output of {@link InvokeCommand}. + */ export interface InvokeCommandOutput extends InvokeCommandOutputType, __MetadataBearer {} /** diff --git a/clients/client-lambda/src/commands/InvokeWithResponseStreamCommand.ts b/clients/client-lambda/src/commands/InvokeWithResponseStreamCommand.ts index d2ac2afa3c6d8..36fbc4787f4b8 100644 --- a/clients/client-lambda/src/commands/InvokeWithResponseStreamCommand.ts +++ b/clients/client-lambda/src/commands/InvokeWithResponseStreamCommand.ts @@ -30,12 +30,15 @@ import { de_InvokeWithResponseStreamCommand, se_InvokeWithResponseStreamCommand export { __MetadataBearer, $Command }; /** * @public - * - * The input for {@link InvokeWithResponseStreamCommand}. */ export type InvokeWithResponseStreamCommandInputType = Omit & { Payload?: BlobTypes; }; +/** + * @public + * + * The input for {@link InvokeWithResponseStreamCommand}. + */ export interface InvokeWithResponseStreamCommandInput extends InvokeWithResponseStreamCommandInputType {} /** * @public diff --git a/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts index cad914bdcf538..0db79f19f9998 100644 --- a/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4432,11 +4433,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts index a249d5624edb7..bec037615ba79 100644 --- a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts @@ -20,6 +20,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -10751,11 +10752,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lex-runtime-service/src/commands/PostContentCommand.ts b/clients/client-lex-runtime-service/src/commands/PostContentCommand.ts index b73bf7d2922e6..3023da8748fa9 100644 --- a/clients/client-lex-runtime-service/src/commands/PostContentCommand.ts +++ b/clients/client-lex-runtime-service/src/commands/PostContentCommand.ts @@ -33,11 +33,6 @@ import { de_PostContentCommand, se_PostContentCommand } from "../protocols/Aws_r * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link PostContentCommand}. - */ export type PostContentCommandInputType = Omit & { /** * For *`PostContentRequest["inputStream"]`*, see {@link PostContentRequest.inputStream}. @@ -45,7 +40,9 @@ export type PostContentCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lex-runtime-v2/src/commands/RecognizeUtteranceCommand.ts b/clients/client-lex-runtime-v2/src/commands/RecognizeUtteranceCommand.ts index c3479d61c762c..fc0e565bb8f68 100644 --- a/clients/client-lex-runtime-v2/src/commands/RecognizeUtteranceCommand.ts +++ b/clients/client-lex-runtime-v2/src/commands/RecognizeUtteranceCommand.ts @@ -29,11 +29,6 @@ import { de_RecognizeUtteranceCommand, se_RecognizeUtteranceCommand } from "../p * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link RecognizeUtteranceCommand}. - */ export type RecognizeUtteranceCommandInputType = Omit & { /** * For *`RecognizeUtteranceRequest["inputStream"]`*, see {@link RecognizeUtteranceRequest.inputStream}. @@ -41,7 +36,9 @@ export type RecognizeUtteranceCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts b/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts index c1114bad7274a..4fac14d307992 100644 --- a/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts +++ b/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -468,11 +469,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts b/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts index d84893464c960..ad3f3d0108b02 100644 --- a/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts +++ b/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1314,11 +1315,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-license-manager/src/protocols/Aws_json1_1.ts b/clients/client-license-manager/src/protocols/Aws_json1_1.ts index e82eb7e98bc63..cb7c78038503c 100644 --- a/clients/client-license-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-license-manager/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4973,11 +4974,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lightsail/src/protocols/Aws_json1_1.ts b/clients/client-lightsail/src/protocols/Aws_json1_1.ts index ebac665dafdd8..4acd61393ae09 100644 --- a/clients/client-lightsail/src/protocols/Aws_json1_1.ts +++ b/clients/client-lightsail/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -16427,11 +16428,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-location/src/commands/GetMapGlyphsCommand.ts b/clients/client-location/src/commands/GetMapGlyphsCommand.ts index d553c73359c7c..a41f310ad0f7f 100644 --- a/clients/client-location/src/commands/GetMapGlyphsCommand.ts +++ b/clients/client-location/src/commands/GetMapGlyphsCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetMapGlyphsCommand}. */ export interface GetMapGlyphsCommandInput extends GetMapGlyphsRequest {} +/** + * @public + */ +export type GetMapGlyphsCommandOutputType = Omit & { + Blob?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetMapGlyphsCommand}. */ -export interface GetMapGlyphsCommandOutput extends GetMapGlyphsResponse, __MetadataBearer {} +export interface GetMapGlyphsCommandOutput extends GetMapGlyphsCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-location/src/commands/GetMapSpritesCommand.ts b/clients/client-location/src/commands/GetMapSpritesCommand.ts index 18cf0651757d1..e1cb40d0502b8 100644 --- a/clients/client-location/src/commands/GetMapSpritesCommand.ts +++ b/clients/client-location/src/commands/GetMapSpritesCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -31,12 +32,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetMapSpritesCommand}. */ export interface GetMapSpritesCommandInput extends GetMapSpritesRequest {} +/** + * @public + */ +export type GetMapSpritesCommandOutputType = Omit & { + Blob?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetMapSpritesCommand}. */ -export interface GetMapSpritesCommandOutput extends GetMapSpritesResponse, __MetadataBearer {} +export interface GetMapSpritesCommandOutput extends GetMapSpritesCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-location/src/commands/GetMapStyleDescriptorCommand.ts b/clients/client-location/src/commands/GetMapStyleDescriptorCommand.ts index 2ccbc0650c9de..2789a9098511e 100644 --- a/clients/client-location/src/commands/GetMapStyleDescriptorCommand.ts +++ b/clients/client-location/src/commands/GetMapStyleDescriptorCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -31,12 +32,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetMapStyleDescriptorCommand}. */ export interface GetMapStyleDescriptorCommandInput extends GetMapStyleDescriptorRequest {} +/** + * @public + */ +export type GetMapStyleDescriptorCommandOutputType = Omit & { + Blob?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetMapStyleDescriptorCommand}. */ -export interface GetMapStyleDescriptorCommandOutput extends GetMapStyleDescriptorResponse, __MetadataBearer {} +export interface GetMapStyleDescriptorCommandOutput extends GetMapStyleDescriptorCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-location/src/commands/GetMapTileCommand.ts b/clients/client-location/src/commands/GetMapTileCommand.ts index 2e997f87ebe05..7e88e5e54610f 100644 --- a/clients/client-location/src/commands/GetMapTileCommand.ts +++ b/clients/client-location/src/commands/GetMapTileCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetMapTileCommand}. */ export interface GetMapTileCommandInput extends GetMapTileRequest {} +/** + * @public + */ +export type GetMapTileCommandOutputType = Omit & { + Blob?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetMapTileCommand}. */ -export interface GetMapTileCommandOutput extends GetMapTileResponse, __MetadataBearer {} +export interface GetMapTileCommandOutput extends GetMapTileCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-location/src/protocols/Aws_restJson1.ts b/clients/client-location/src/protocols/Aws_restJson1.ts index 944b670e1d8e3..80e12e68d8676 100644 --- a/clients/client-location/src/protocols/Aws_restJson1.ts +++ b/clients/client-location/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -7052,11 +7053,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts index 9febf6aa7a877..a06ad8f14acaa 100644 --- a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts +++ b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3375,11 +3376,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts index e0e67aa91f6bb..fa794454cca03 100644 --- a/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts +++ b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3571,11 +3572,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-lookoutvision/src/commands/DetectAnomaliesCommand.ts b/clients/client-lookoutvision/src/commands/DetectAnomaliesCommand.ts index 88cf7b8e139ee..767e51df615b9 100644 --- a/clients/client-lookoutvision/src/commands/DetectAnomaliesCommand.ts +++ b/clients/client-lookoutvision/src/commands/DetectAnomaliesCommand.ts @@ -25,11 +25,6 @@ import { de_DetectAnomaliesCommand, se_DetectAnomaliesCommand } from "../protoco * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link DetectAnomaliesCommand}. - */ export type DetectAnomaliesCommandInputType = Omit & { /** * For *`DetectAnomaliesRequest["Body"]`*, see {@link DetectAnomaliesRequest.Body}. @@ -37,7 +32,9 @@ export type DetectAnomaliesCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-m2/src/protocols/Aws_restJson1.ts b/clients/client-m2/src/protocols/Aws_restJson1.ts index 07f8814941a01..8ac3af437efad 100644 --- a/clients/client-m2/src/protocols/Aws_restJson1.ts +++ b/clients/client-m2/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3777,11 +3778,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts index c1aa52624638b..dd65045d44904 100644 --- a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts +++ b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2620,11 +2621,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-macie/src/protocols/Aws_json1_1.ts b/clients/client-macie/src/protocols/Aws_json1_1.ts index 79c4450a3d2b7..a2de3a6ffbe93 100644 --- a/clients/client-macie/src/protocols/Aws_json1_1.ts +++ b/clients/client-macie/src/protocols/Aws_json1_1.ts @@ -5,6 +5,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -627,11 +628,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-macie2/src/protocols/Aws_restJson1.ts b/clients/client-macie2/src/protocols/Aws_restJson1.ts index 1a1f245c708c3..07c77e33ad7fd 100644 --- a/clients/client-macie2/src/protocols/Aws_restJson1.ts +++ b/clients/client-macie2/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -10304,11 +10305,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts index fb106d6c806bd..4a56c71c4f477 100644 --- a/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts +++ b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3036,11 +3037,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts index 1a6da7bec9e52..f173b76b78a47 100644 --- a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts +++ b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1329,11 +1330,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts index 1bbd55e8b1323..014d643c4417a 100644 --- a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts @@ -6,6 +6,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -202,11 +203,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts index decc03b18e615..9729b5587814a 100644 --- a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -206,11 +207,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts index 5edc48b5d4c53..40ba4f1099ea7 100644 --- a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -818,11 +819,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts index b2c9833499dfb..60bd232554055 100644 --- a/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6522,11 +6523,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts index 235a1ffdded54..49223126a2a20 100644 --- a/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -8591,11 +8592,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-medialive/src/protocols/Aws_restJson1.ts b/clients/client-medialive/src/protocols/Aws_restJson1.ts index f69e6d85eeac3..21198d5cb1870 100644 --- a/clients/client-medialive/src/protocols/Aws_restJson1.ts +++ b/clients/client-medialive/src/protocols/Aws_restJson1.ts @@ -21,6 +21,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -12353,11 +12354,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts index 3fc319596045e..0d5697edc2c8d 100644 --- a/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2282,11 +2283,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mediapackage/src/protocols/Aws_restJson1.ts b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts index 885a6857ac409..3ac73b547766e 100644 --- a/clients/client-mediapackage/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2570,11 +2571,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mediapackagev2/src/MediaPackageV2Client.ts b/clients/client-mediapackagev2/src/MediaPackageV2Client.ts index ff5bf5a9c62c8..9b9eee0daa6b4 100644 --- a/clients/client-mediapackagev2/src/MediaPackageV2Client.ts +++ b/clients/client-mediapackagev2/src/MediaPackageV2Client.ts @@ -110,6 +110,8 @@ import { } from "./endpoint/EndpointParameters"; import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +export { __Client }; + /** * @public */ @@ -295,7 +297,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ /** * @public */ -type MediaPackageV2ClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & +export type MediaPackageV2ClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig & @@ -314,7 +316,7 @@ export interface MediaPackageV2ClientConfig extends MediaPackageV2ClientConfigTy /** * @public */ -type MediaPackageV2ClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & +export type MediaPackageV2ClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & RegionResolvedConfig & EndpointResolvedConfig & diff --git a/clients/client-mediapackagev2/src/commands/CreateChannelCommand.ts b/clients/client-mediapackagev2/src/commands/CreateChannelCommand.ts index c6a393452e490..3905eaa24913f 100644 --- a/clients/client-mediapackagev2/src/commands/CreateChannelCommand.ts +++ b/clients/client-mediapackagev2/src/commands/CreateChannelCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { CreateChannelRequest, CreateChannelResponse } from "../models/models_0"; import { de_CreateChannelCommand, se_CreateChannelCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/CreateChannelGroupCommand.ts b/clients/client-mediapackagev2/src/commands/CreateChannelGroupCommand.ts index b9e9f53ed0c43..b0f404fda5eed 100644 --- a/clients/client-mediapackagev2/src/commands/CreateChannelGroupCommand.ts +++ b/clients/client-mediapackagev2/src/commands/CreateChannelGroupCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { CreateChannelGroupRequest, CreateChannelGroupResponse } from "../models/models_0"; import { de_CreateChannelGroupCommand, se_CreateChannelGroupCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/CreateOriginEndpointCommand.ts b/clients/client-mediapackagev2/src/commands/CreateOriginEndpointCommand.ts index 3e1637d5633c6..5e8b3f37c9aa8 100644 --- a/clients/client-mediapackagev2/src/commands/CreateOriginEndpointCommand.ts +++ b/clients/client-mediapackagev2/src/commands/CreateOriginEndpointCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { CreateOriginEndpointRequest, CreateOriginEndpointResponse } from "../models/models_0"; import { de_CreateOriginEndpointCommand, se_CreateOriginEndpointCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/DeleteChannelCommand.ts b/clients/client-mediapackagev2/src/commands/DeleteChannelCommand.ts index 08752b0dc188b..df60f9ffab8be 100644 --- a/clients/client-mediapackagev2/src/commands/DeleteChannelCommand.ts +++ b/clients/client-mediapackagev2/src/commands/DeleteChannelCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { DeleteChannelRequest, DeleteChannelResponse } from "../models/models_0"; import { de_DeleteChannelCommand, se_DeleteChannelCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/DeleteChannelGroupCommand.ts b/clients/client-mediapackagev2/src/commands/DeleteChannelGroupCommand.ts index 2860209f183e3..d431eb94e4c78 100644 --- a/clients/client-mediapackagev2/src/commands/DeleteChannelGroupCommand.ts +++ b/clients/client-mediapackagev2/src/commands/DeleteChannelGroupCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { DeleteChannelGroupRequest, DeleteChannelGroupResponse } from "../models/models_0"; import { de_DeleteChannelGroupCommand, se_DeleteChannelGroupCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/DeleteChannelPolicyCommand.ts b/clients/client-mediapackagev2/src/commands/DeleteChannelPolicyCommand.ts index 899eb1620d534..4050a31b0f7d3 100644 --- a/clients/client-mediapackagev2/src/commands/DeleteChannelPolicyCommand.ts +++ b/clients/client-mediapackagev2/src/commands/DeleteChannelPolicyCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { DeleteChannelPolicyRequest, DeleteChannelPolicyResponse } from "../models/models_0"; import { de_DeleteChannelPolicyCommand, se_DeleteChannelPolicyCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/DeleteOriginEndpointCommand.ts b/clients/client-mediapackagev2/src/commands/DeleteOriginEndpointCommand.ts index 989ced4a144ff..99ef9b32e4565 100644 --- a/clients/client-mediapackagev2/src/commands/DeleteOriginEndpointCommand.ts +++ b/clients/client-mediapackagev2/src/commands/DeleteOriginEndpointCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { DeleteOriginEndpointRequest, DeleteOriginEndpointResponse } from "../models/models_0"; import { de_DeleteOriginEndpointCommand, se_DeleteOriginEndpointCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/DeleteOriginEndpointPolicyCommand.ts b/clients/client-mediapackagev2/src/commands/DeleteOriginEndpointPolicyCommand.ts index 2d454d0c02b1f..dea3292ac3831 100644 --- a/clients/client-mediapackagev2/src/commands/DeleteOriginEndpointPolicyCommand.ts +++ b/clients/client-mediapackagev2/src/commands/DeleteOriginEndpointPolicyCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { DeleteOriginEndpointPolicyRequest, DeleteOriginEndpointPolicyResponse } from "../models/models_0"; import { de_DeleteOriginEndpointPolicyCommand, se_DeleteOriginEndpointPolicyCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/GetChannelCommand.ts b/clients/client-mediapackagev2/src/commands/GetChannelCommand.ts index 79996f0df5b7b..3a896817f7e59 100644 --- a/clients/client-mediapackagev2/src/commands/GetChannelCommand.ts +++ b/clients/client-mediapackagev2/src/commands/GetChannelCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { GetChannelRequest, GetChannelResponse } from "../models/models_0"; import { de_GetChannelCommand, se_GetChannelCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/GetChannelGroupCommand.ts b/clients/client-mediapackagev2/src/commands/GetChannelGroupCommand.ts index b1d57fcce1248..5b8d068fefb8a 100644 --- a/clients/client-mediapackagev2/src/commands/GetChannelGroupCommand.ts +++ b/clients/client-mediapackagev2/src/commands/GetChannelGroupCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { GetChannelGroupRequest, GetChannelGroupResponse } from "../models/models_0"; import { de_GetChannelGroupCommand, se_GetChannelGroupCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/GetChannelPolicyCommand.ts b/clients/client-mediapackagev2/src/commands/GetChannelPolicyCommand.ts index 257f3af914148..33bfe8f2f58c9 100644 --- a/clients/client-mediapackagev2/src/commands/GetChannelPolicyCommand.ts +++ b/clients/client-mediapackagev2/src/commands/GetChannelPolicyCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { GetChannelPolicyRequest, GetChannelPolicyResponse } from "../models/models_0"; import { de_GetChannelPolicyCommand, se_GetChannelPolicyCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/GetOriginEndpointCommand.ts b/clients/client-mediapackagev2/src/commands/GetOriginEndpointCommand.ts index 5bcb90078c58e..accae76843f7b 100644 --- a/clients/client-mediapackagev2/src/commands/GetOriginEndpointCommand.ts +++ b/clients/client-mediapackagev2/src/commands/GetOriginEndpointCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { GetOriginEndpointRequest, GetOriginEndpointResponse } from "../models/models_0"; import { de_GetOriginEndpointCommand, se_GetOriginEndpointCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/GetOriginEndpointPolicyCommand.ts b/clients/client-mediapackagev2/src/commands/GetOriginEndpointPolicyCommand.ts index eef8fd48ef3d3..0c1a5679019da 100644 --- a/clients/client-mediapackagev2/src/commands/GetOriginEndpointPolicyCommand.ts +++ b/clients/client-mediapackagev2/src/commands/GetOriginEndpointPolicyCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { GetOriginEndpointPolicyRequest, GetOriginEndpointPolicyResponse } from "../models/models_0"; import { de_GetOriginEndpointPolicyCommand, se_GetOriginEndpointPolicyCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/ListChannelGroupsCommand.ts b/clients/client-mediapackagev2/src/commands/ListChannelGroupsCommand.ts index c6b788f075d5a..b26e85f512697 100644 --- a/clients/client-mediapackagev2/src/commands/ListChannelGroupsCommand.ts +++ b/clients/client-mediapackagev2/src/commands/ListChannelGroupsCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { ListChannelGroupsRequest, ListChannelGroupsResponse } from "../models/models_0"; import { de_ListChannelGroupsCommand, se_ListChannelGroupsCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/ListChannelsCommand.ts b/clients/client-mediapackagev2/src/commands/ListChannelsCommand.ts index 1a10be112b5c1..bc29e142838cc 100644 --- a/clients/client-mediapackagev2/src/commands/ListChannelsCommand.ts +++ b/clients/client-mediapackagev2/src/commands/ListChannelsCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { ListChannelsRequest, ListChannelsResponse } from "../models/models_0"; import { de_ListChannelsCommand, se_ListChannelsCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/ListOriginEndpointsCommand.ts b/clients/client-mediapackagev2/src/commands/ListOriginEndpointsCommand.ts index 193f72f75ea0b..19a468273fc56 100644 --- a/clients/client-mediapackagev2/src/commands/ListOriginEndpointsCommand.ts +++ b/clients/client-mediapackagev2/src/commands/ListOriginEndpointsCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { ListOriginEndpointsRequest, ListOriginEndpointsResponse } from "../models/models_0"; import { de_ListOriginEndpointsCommand, se_ListOriginEndpointsCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/ListTagsForResourceCommand.ts b/clients/client-mediapackagev2/src/commands/ListTagsForResourceCommand.ts index be7dfc3ea5f81..224c12a86247d 100644 --- a/clients/client-mediapackagev2/src/commands/ListTagsForResourceCommand.ts +++ b/clients/client-mediapackagev2/src/commands/ListTagsForResourceCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { ListTagsForResourceRequest, ListTagsForResourceResponse } from "../models/models_0"; import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/PutChannelPolicyCommand.ts b/clients/client-mediapackagev2/src/commands/PutChannelPolicyCommand.ts index 78f89086c529b..6c6bf7cd61a1b 100644 --- a/clients/client-mediapackagev2/src/commands/PutChannelPolicyCommand.ts +++ b/clients/client-mediapackagev2/src/commands/PutChannelPolicyCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { PutChannelPolicyRequest, PutChannelPolicyResponse } from "../models/models_0"; import { de_PutChannelPolicyCommand, se_PutChannelPolicyCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/PutOriginEndpointPolicyCommand.ts b/clients/client-mediapackagev2/src/commands/PutOriginEndpointPolicyCommand.ts index 5c29ba4f03ad1..ba38d6f863d57 100644 --- a/clients/client-mediapackagev2/src/commands/PutOriginEndpointPolicyCommand.ts +++ b/clients/client-mediapackagev2/src/commands/PutOriginEndpointPolicyCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { PutOriginEndpointPolicyRequest, PutOriginEndpointPolicyResponse } from "../models/models_0"; import { de_PutOriginEndpointPolicyCommand, se_PutOriginEndpointPolicyCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/TagResourceCommand.ts b/clients/client-mediapackagev2/src/commands/TagResourceCommand.ts index 6af0a7f1da41c..b2cd520590b00 100644 --- a/clients/client-mediapackagev2/src/commands/TagResourceCommand.ts +++ b/clients/client-mediapackagev2/src/commands/TagResourceCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { TagResourceRequest } from "../models/models_0"; import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/UntagResourceCommand.ts b/clients/client-mediapackagev2/src/commands/UntagResourceCommand.ts index 373f7be77f457..caf724bc8ba89 100644 --- a/clients/client-mediapackagev2/src/commands/UntagResourceCommand.ts +++ b/clients/client-mediapackagev2/src/commands/UntagResourceCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { UntagResourceRequest } from "../models/models_0"; import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/UpdateChannelCommand.ts b/clients/client-mediapackagev2/src/commands/UpdateChannelCommand.ts index 8b362959dcb5c..526ddbd264549 100644 --- a/clients/client-mediapackagev2/src/commands/UpdateChannelCommand.ts +++ b/clients/client-mediapackagev2/src/commands/UpdateChannelCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { UpdateChannelRequest, UpdateChannelResponse } from "../models/models_0"; import { de_UpdateChannelCommand, se_UpdateChannelCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/UpdateChannelGroupCommand.ts b/clients/client-mediapackagev2/src/commands/UpdateChannelGroupCommand.ts index d619f0e2a6657..272345835a87b 100644 --- a/clients/client-mediapackagev2/src/commands/UpdateChannelGroupCommand.ts +++ b/clients/client-mediapackagev2/src/commands/UpdateChannelGroupCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { UpdateChannelGroupRequest, UpdateChannelGroupResponse } from "../models/models_0"; import { de_UpdateChannelGroupCommand, se_UpdateChannelGroupCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/commands/UpdateOriginEndpointCommand.ts b/clients/client-mediapackagev2/src/commands/UpdateOriginEndpointCommand.ts index 5dd900b848d37..0dfc83eb5ead6 100644 --- a/clients/client-mediapackagev2/src/commands/UpdateOriginEndpointCommand.ts +++ b/clients/client-mediapackagev2/src/commands/UpdateOriginEndpointCommand.ts @@ -17,6 +17,10 @@ import { MediaPackageV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTyp import { UpdateOriginEndpointRequest, UpdateOriginEndpointResponse } from "../models/models_0"; import { de_UpdateOriginEndpointCommand, se_UpdateOriginEndpointCommand } from "../protocols/Aws_restJson1"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-mediapackagev2/src/index.ts b/clients/client-mediapackagev2/src/index.ts index f154f5e4578c1..5862532634463 100644 --- a/clients/client-mediapackagev2/src/index.ts +++ b/clients/client-mediapackagev2/src/index.ts @@ -1,8 +1,25 @@ -export * from "./MediaPackageV2"; // smithy-typescript generated code +/* eslint-disable */ +/** + * + *

This guide is intended for creating AWS Elemental MediaPackage resources in MediaPackage Version 2 (v2) starting from May 2023. + * To get started with MediaPackage v2, create your MediaPackage resources. There isn't an automated process to + * migrate your resources from MediaPackage v1 to MediaPackage v2.

+ *

The names of the entities that you use to access this API, like URLs and ARNs, all have the versioning information + * added, like "v2", to distinguish from the prior version. If you used MediaPackage prior to this release, you can't use + * the MediaPackage v2 CLI or the MediaPackage v2 API to access any MediaPackage v1 resources.

+ *

If you created resources in MediaPackage v1, use video on demand (VOD) workflows, and aren't looking to migrate to MediaPackage v2 yet, + * see the MediaPackage v1 Live API Reference.

+ *
+ *

This is the AWS Elemental MediaPackage v2 Live REST API Reference. It describes all the MediaPackage API operations for live content in detail, and provides sample requests, responses, and errors for the supported web services protocols.

+ *

We assume that you have the IAM permissions that you need to use MediaPackage via the REST API. We also assume that you are familiar with the features and operations of MediaPackage, as described in the AWS Elemental MediaPackage User Guide.

+ * + * @packageDocumentation + */ export * from "./MediaPackageV2Client"; +export * from "./MediaPackageV2"; export * from "./commands"; -export * from "./models"; export * from "./pagination"; +export * from "./models"; export { MediaPackageV2ServiceException } from "./models/MediaPackageV2ServiceException"; diff --git a/clients/client-mediapackagev2/src/models/MediaPackageV2ServiceException.ts b/clients/client-mediapackagev2/src/models/MediaPackageV2ServiceException.ts index c42b6cd59a190..14e4c3f486dcb 100644 --- a/clients/client-mediapackagev2/src/models/MediaPackageV2ServiceException.ts +++ b/clients/client-mediapackagev2/src/models/MediaPackageV2ServiceException.ts @@ -4,6 +4,8 @@ import { ServiceExceptionOptions as __ServiceExceptionOptions, } from "@aws-sdk/smithy-client"; +export { __ServiceException, __ServiceExceptionOptions }; + /** * @public * diff --git a/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts b/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts index ac9fd1b7564a6..facdcdbb5bc56 100644 --- a/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2724,11 +2725,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mediastore-data/src/commands/PutObjectCommand.ts b/clients/client-mediastore-data/src/commands/PutObjectCommand.ts index ec09233b21286..c258d8f46d19f 100644 --- a/clients/client-mediastore-data/src/commands/PutObjectCommand.ts +++ b/clients/client-mediastore-data/src/commands/PutObjectCommand.ts @@ -21,11 +21,6 @@ import { de_PutObjectCommand, se_PutObjectCommand } from "../protocols/Aws_restJ * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link PutObjectCommand}. - */ export type PutObjectCommandInputType = Omit & { /** * For *`PutObjectRequest["Body"]`*, see {@link PutObjectRequest.Body}. @@ -33,7 +28,9 @@ export type PutObjectCommandInputType = Omit & { Body: PutObjectRequest["Body"] | string | Uint8Array | Buffer; }; /** - * This interface extends from `PutObjectRequest` interface. There are more parameters than `Body` defined in {@link PutObjectRequest} + * @public + * + * The input for {@link PutObjectCommand}. */ export interface PutObjectCommandInput extends PutObjectCommandInputType {} /** diff --git a/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts index 8b2d7dd42adcc..0c28999641451 100644 --- a/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts @@ -20,6 +20,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -562,11 +563,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mediastore/src/protocols/Aws_json1_1.ts b/clients/client-mediastore/src/protocols/Aws_json1_1.ts index 240af3b4370b0..2f6e765e7e01f 100644 --- a/clients/client-mediastore/src/protocols/Aws_json1_1.ts +++ b/clients/client-mediastore/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1756,11 +1757,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mediatailor/src/protocols/Aws_restJson1.ts b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts index 500e559f44397..ae0bdd99d62f8 100644 --- a/clients/client-mediatailor/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4028,11 +4029,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-memorydb/src/protocols/Aws_json1_1.ts b/clients/client-memorydb/src/protocols/Aws_json1_1.ts index b9f11b94df9b4..1f6219cf350dd 100644 --- a/clients/client-memorydb/src/protocols/Aws_json1_1.ts +++ b/clients/client-memorydb/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4644,11 +4645,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mgn/src/protocols/Aws_restJson1.ts b/clients/client-mgn/src/protocols/Aws_restJson1.ts index f50561a1b1fd2..9c5877baf2447 100644 --- a/clients/client-mgn/src/protocols/Aws_restJson1.ts +++ b/clients/client-mgn/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -6140,11 +6141,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts b/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts index cc93ad3b1a426..36eb98f13ae31 100644 --- a/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts +++ b/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2963,11 +2964,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts index a96e4dfb661d3..e3b4901882550 100644 --- a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts +++ b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1886,11 +1887,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts index 2b20ce2b66aeb..a000606a32466 100644 --- a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts +++ b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -421,11 +422,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts b/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts index 42aa51d0ecf61..ca72487772938 100644 --- a/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts +++ b/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2820,11 +2821,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts b/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts index bd84a5b4bf94f..720f7ec2ccb52 100644 --- a/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts +++ b/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2456,11 +2457,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mobile/src/commands/CreateProjectCommand.ts b/clients/client-mobile/src/commands/CreateProjectCommand.ts index ed78acee79085..e652a17b01b6b 100644 --- a/clients/client-mobile/src/commands/CreateProjectCommand.ts +++ b/clients/client-mobile/src/commands/CreateProjectCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_CreateProjectCommand, se_CreateProjectCommand } from "../protocols/A * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type CreateProjectCommandInputType = Omit & { + contents?: BlobTypes; +}; /** * @public * * The input for {@link CreateProjectCommand}. */ -export interface CreateProjectCommandInput extends CreateProjectRequest {} +export interface CreateProjectCommandInput extends CreateProjectCommandInputType {} /** * @public * diff --git a/clients/client-mobile/src/commands/UpdateProjectCommand.ts b/clients/client-mobile/src/commands/UpdateProjectCommand.ts index e878d3a11c79c..8b3049d15e355 100644 --- a/clients/client-mobile/src/commands/UpdateProjectCommand.ts +++ b/clients/client-mobile/src/commands/UpdateProjectCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -21,12 +22,18 @@ import { de_UpdateProjectCommand, se_UpdateProjectCommand } from "../protocols/A * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type UpdateProjectCommandInputType = Omit & { + contents?: BlobTypes; +}; /** * @public * * The input for {@link UpdateProjectCommand}. */ -export interface UpdateProjectCommandInput extends UpdateProjectRequest {} +export interface UpdateProjectCommandInput extends UpdateProjectCommandInputType {} /** * @public * diff --git a/clients/client-mobile/src/protocols/Aws_restJson1.ts b/clients/client-mobile/src/protocols/Aws_restJson1.ts index 139bc4292aa18..3f8e4d3e5943c 100644 --- a/clients/client-mobile/src/protocols/Aws_restJson1.ts +++ b/clients/client-mobile/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1046,11 +1047,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mq/src/protocols/Aws_restJson1.ts b/clients/client-mq/src/protocols/Aws_restJson1.ts index 6afb90d8a0002..e0a9974dd398b 100644 --- a/clients/client-mq/src/protocols/Aws_restJson1.ts +++ b/clients/client-mq/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2655,11 +2656,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mturk/src/protocols/Aws_json1_1.ts b/clients/client-mturk/src/protocols/Aws_json1_1.ts index edbb64a823c3f..6e5ad392d7598 100644 --- a/clients/client-mturk/src/protocols/Aws_json1_1.ts +++ b/clients/client-mturk/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3257,11 +3258,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-mwaa/src/protocols/Aws_restJson1.ts b/clients/client-mwaa/src/protocols/Aws_restJson1.ts index dfd691f083f2d..36b167c8fe0af 100644 --- a/clients/client-mwaa/src/protocols/Aws_restJson1.ts +++ b/clients/client-mwaa/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -1240,11 +1241,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-neptune/src/protocols/Aws_query.ts b/clients/client-neptune/src/protocols/Aws_query.ts index 308e667d6cc71..ab0657a7437ea 100644 --- a/clients/client-neptune/src/protocols/Aws_query.ts +++ b/clients/client-neptune/src/protocols/Aws_query.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -12758,11 +12759,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts index e967fe4632e3a..2de08c32f8951 100644 --- a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts +++ b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3660,11 +3661,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-networkmanager/src/protocols/Aws_restJson1.ts b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts index 5aa476070cdc4..7fbb63c035841 100644 --- a/clients/client-networkmanager/src/protocols/Aws_restJson1.ts +++ b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -9377,11 +9378,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-nimble/src/protocols/Aws_restJson1.ts b/clients/client-nimble/src/protocols/Aws_restJson1.ts index 0ec47251167e4..345c876159a0d 100644 --- a/clients/client-nimble/src/protocols/Aws_restJson1.ts +++ b/clients/client-nimble/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5565,11 +5566,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-oam/src/protocols/Aws_restJson1.ts b/clients/client-oam/src/protocols/Aws_restJson1.ts index bd692ffd60c4f..8f8f49974b024 100644 --- a/clients/client-oam/src/protocols/Aws_restJson1.ts +++ b/clients/client-oam/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1526,11 +1527,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-omics/src/commands/UploadReadSetPartCommand.ts b/clients/client-omics/src/commands/UploadReadSetPartCommand.ts index 8d044b3b63451..7ce1a2af25cc1 100644 --- a/clients/client-omics/src/commands/UploadReadSetPartCommand.ts +++ b/clients/client-omics/src/commands/UploadReadSetPartCommand.ts @@ -25,11 +25,6 @@ import { de_UploadReadSetPartCommand, se_UploadReadSetPartCommand } from "../pro * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link UploadReadSetPartCommand}. - */ export type UploadReadSetPartCommandInputType = Omit & { /** * For *`UploadReadSetPartRequest["payload"]`*, see {@link UploadReadSetPartRequest.payload}. @@ -37,7 +32,9 @@ export type UploadReadSetPartCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-opensearch/src/protocols/Aws_restJson1.ts b/clients/client-opensearch/src/protocols/Aws_restJson1.ts index 36abf86e2eddc..3f6e05e7b5ddf 100644 --- a/clients/client-opensearch/src/protocols/Aws_restJson1.ts +++ b/clients/client-opensearch/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6222,11 +6223,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts index 32cd1a9cbb769..76cd102ccce56 100644 --- a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts +++ b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts @@ -12,6 +12,7 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2733,11 +2734,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-opsworks/src/protocols/Aws_json1_1.ts b/clients/client-opsworks/src/protocols/Aws_json1_1.ts index c4a472afd9543..ff060dcd46ae0 100644 --- a/clients/client-opsworks/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworks/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5248,11 +5249,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts index be7fcfa6e248a..4b1b305e86c85 100644 --- a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1712,11 +1713,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-organizations/src/protocols/Aws_json1_1.ts b/clients/client-organizations/src/protocols/Aws_json1_1.ts index c7f32ead83e58..f2ddeb910f95d 100644 --- a/clients/client-organizations/src/protocols/Aws_json1_1.ts +++ b/clients/client-organizations/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6072,11 +6073,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-osis/src/protocols/Aws_restJson1.ts b/clients/client-osis/src/protocols/Aws_restJson1.ts index 2e80c2ee62768..2da898ee2611b 100644 --- a/clients/client-osis/src/protocols/Aws_restJson1.ts +++ b/clients/client-osis/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1608,11 +1609,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-outposts/src/protocols/Aws_restJson1.ts b/clients/client-outposts/src/protocols/Aws_restJson1.ts index 79df4252fc472..fe2f58ddbfc02 100644 --- a/clients/client-outposts/src/protocols/Aws_restJson1.ts +++ b/clients/client-outposts/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2613,11 +2614,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-panorama/src/protocols/Aws_restJson1.ts b/clients/client-panorama/src/protocols/Aws_restJson1.ts index 9a2246d97b558..8a75fa4687b87 100644 --- a/clients/client-panorama/src/protocols/Aws_restJson1.ts +++ b/clients/client-panorama/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3711,11 +3712,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts b/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts index 60eb7979e0b45..1da57228fa753 100644 --- a/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1380,11 +1381,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts b/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts index 7acf508eb56fd..536a0bb042134 100644 --- a/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts +++ b/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2002,11 +2003,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-personalize-events/src/protocols/Aws_restJson1.ts b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts index 3cafcaabe06b7..7b2f0087cb2bb 100644 --- a/clients/client-personalize-events/src/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -404,11 +405,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts index 345f8059a3c80..38316f3096286 100644 --- a/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -278,11 +279,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-personalize/src/protocols/Aws_json1_1.ts b/clients/client-personalize/src/protocols/Aws_json1_1.ts index 56cdbb67a783a..5fb6f181589d3 100644 --- a/clients/client-personalize/src/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6324,11 +6325,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-pi/src/protocols/Aws_json1_1.ts b/clients/client-pi/src/protocols/Aws_json1_1.ts index 2141d6acb951d..41e14aa259748 100644 --- a/clients/client-pi/src/protocols/Aws_json1_1.ts +++ b/clients/client-pi/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -730,11 +731,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts index c374d83f057a2..8929813232f1f 100644 --- a/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4408,11 +4409,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts index 94034482fd4f1..bc440ecda26c3 100644 --- a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts +++ b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -4188,11 +4189,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts index fbfd37cb3fc0d..2ccee79c21f84 100644 --- a/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -934,11 +935,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-pinpoint/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts index c37a3953175de..c25c45972a416 100644 --- a/clients/client-pinpoint/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -14494,11 +14495,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-pipes/src/protocols/Aws_restJson1.ts b/clients/client-pipes/src/protocols/Aws_restJson1.ts index cf9cd95205dc8..aec34e91f6f52 100644 --- a/clients/client-pipes/src/protocols/Aws_restJson1.ts +++ b/clients/client-pipes/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1534,11 +1535,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-polly/src/protocols/Aws_restJson1.ts b/clients/client-polly/src/protocols/Aws_restJson1.ts index e87f104e48ce5..3baf534f093b0 100644 --- a/clients/client-polly/src/protocols/Aws_restJson1.ts +++ b/clients/client-polly/src/protocols/Aws_restJson1.ts @@ -19,6 +19,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1369,11 +1370,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-pricing/src/protocols/Aws_json1_1.ts b/clients/client-pricing/src/protocols/Aws_json1_1.ts index d60294da0d6e7..0332c98f6f042 100644 --- a/clients/client-pricing/src/protocols/Aws_json1_1.ts +++ b/clients/client-pricing/src/protocols/Aws_json1_1.ts @@ -8,6 +8,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -578,11 +579,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts b/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts index ee1ced3665c6a..8806eba7689d6 100644 --- a/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts +++ b/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2654,11 +2655,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-proton/src/protocols/Aws_json1_0.ts b/clients/client-proton/src/protocols/Aws_json1_0.ts index 6a83ebddccc64..e57d2c8eada74 100644 --- a/clients/client-proton/src/protocols/Aws_json1_0.ts +++ b/clients/client-proton/src/protocols/Aws_json1_0.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -8354,11 +8355,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts index f9f59c50abcb6..5de7f5b514f13 100644 --- a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts +++ b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts @@ -7,6 +7,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -384,11 +385,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-qldb/src/protocols/Aws_restJson1.ts b/clients/client-qldb/src/protocols/Aws_restJson1.ts index d72b24c173205..0e04cd98525d2 100644 --- a/clients/client-qldb/src/protocols/Aws_restJson1.ts +++ b/clients/client-qldb/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1954,11 +1955,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-quicksight/src/protocols/Aws_restJson1.ts b/clients/client-quicksight/src/protocols/Aws_restJson1.ts index 6be56ef732a7c..699d79e0dcffc 100644 --- a/clients/client-quicksight/src/protocols/Aws_restJson1.ts +++ b/clients/client-quicksight/src/protocols/Aws_restJson1.ts @@ -20,6 +20,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -28310,11 +28311,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ram/src/protocols/Aws_restJson1.ts b/clients/client-ram/src/protocols/Aws_restJson1.ts index 26b7c47405277..4adbe78a54054 100644 --- a/clients/client-ram/src/protocols/Aws_restJson1.ts +++ b/clients/client-ram/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -4402,11 +4403,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-rbin/src/protocols/Aws_restJson1.ts b/clients/client-rbin/src/protocols/Aws_restJson1.ts index 738cca4928b0a..c8cd09d3683e4 100644 --- a/clients/client-rbin/src/protocols/Aws_restJson1.ts +++ b/clients/client-rbin/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1036,11 +1037,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-rds-data/src/protocols/Aws_restJson1.ts b/clients/client-rds-data/src/protocols/Aws_restJson1.ts index 3a25d969b262c..816a7c0b82fd7 100644 --- a/clients/client-rds-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-rds-data/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1138,11 +1139,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-rds/src/protocols/Aws_query.ts b/clients/client-rds/src/protocols/Aws_query.ts index 7136854b3e7d6..987c647cec9ec 100644 --- a/clients/client-rds/src/protocols/Aws_query.ts +++ b/clients/client-rds/src/protocols/Aws_query.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -26477,11 +26478,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts index fd0303f205f85..d625f96b6b499 100644 --- a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1121,11 +1122,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts index d07de07a2147e..d840ffeb4ae09 100644 --- a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3743,11 +3744,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-redshift/src/protocols/Aws_query.ts b/clients/client-redshift/src/protocols/Aws_query.ts index 2095d818edac5..9976c2669fadc 100644 --- a/clients/client-redshift/src/protocols/Aws_query.ts +++ b/clients/client-redshift/src/protocols/Aws_query.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -20621,11 +20622,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-rekognition/src/commands/ListFacesCommand.ts b/clients/client-rekognition/src/commands/ListFacesCommand.ts index 08efd7962b9a2..a05f1a9a46503 100644 --- a/clients/client-rekognition/src/commands/ListFacesCommand.ts +++ b/clients/client-rekognition/src/commands/ListFacesCommand.ts @@ -125,127 +125,44 @@ export interface ListFacesCommandOutput extends ListFacesResponse, __MetadataBea * const response = await client.send(command); * /* response == * { + * "FaceModelVersion": "6.0", * "Faces": [ * { * "BoundingBox": { - * "Height": 0.18000000715255737, - * "Left": 0.5555559992790222, - * "Top": 0.336667001247406, - * "Width": 0.23999999463558197 + * "Height": 0.056759100407361984, + * "Left": 0.3453829884529114, + * "Top": 0.36568498611450195, + * "Width": 0.03177810087800026 * }, - * "Confidence": 100, - * "FaceId": "1c62e8b5-69a7-5b7d-b3cd-db4338a8a7e7", - * "ImageId": "147fdf82-7a71-52cf-819b-e786c7b9746e" + * "Confidence": 99.76940155029297, + * "FaceId": "c92265d4-5f9c-43af-a58e-12be0ce02bc3", + * "ImageId": "56a0ca74-1c83-39dd-b363-051a64168a65", + * "IndexFacesModelVersion": "6.0", + * "UserId": "demoUser2" * }, * { * "BoundingBox": { - * "Height": 0.16555599868297577, - * "Left": 0.30963000655174255, - * "Top": 0.7066670060157776, - * "Width": 0.22074100375175476 + * "Height": 0.06347999721765518, + * "Left": 0.5160620212554932, + * "Top": 0.6080359816551208, + * "Width": 0.03254450112581253 * }, - * "Confidence": 100, - * "FaceId": "29a75abe-397b-5101-ba4f-706783b2246c", - * "ImageId": "147fdf82-7a71-52cf-819b-e786c7b9746e" + * "Confidence": 99.94369506835938, + * "FaceId": "851cb847-dccc-4fea-9309-9f4805967855", + * "ImageId": "a8aed589-ceec-35f7-9c04-82e0b546b024", + * "IndexFacesModelVersion": "6.0" * }, * { * "BoundingBox": { - * "Height": 0.3234420120716095, - * "Left": 0.3233329951763153, - * "Top": 0.5, - * "Width": 0.24222199618816376 + * "Height": 0.05266290158033371, + * "Left": 0.6513839960098267, + * "Top": 0.4218429923057556, + * "Width": 0.03094629943370819 * }, - * "Confidence": 99.99829864501953, - * "FaceId": "38271d79-7bc2-5efb-b752-398a8d575b85", - * "ImageId": "d5631190-d039-54e4-b267-abd22c8647c5" - * }, - * { - * "BoundingBox": { - * "Height": 0.03555560111999512, - * "Left": 0.37388700246810913, - * "Top": 0.2477779984474182, - * "Width": 0.04747769981622696 - * }, - * "Confidence": 99.99210357666016, - * "FaceId": "3b01bef0-c883-5654-ba42-d5ad28b720b3", - * "ImageId": "812d9f04-86f9-54fc-9275-8d0dcbcb6784" - * }, - * { - * "BoundingBox": { - * "Height": 0.05333330109715462, - * "Left": 0.2937690019607544, - * "Top": 0.35666701197624207, - * "Width": 0.07121659815311432 - * }, - * "Confidence": 99.99919891357422, - * "FaceId": "4839a608-49d0-566c-8301-509d71b534d1", - * "ImageId": "812d9f04-86f9-54fc-9275-8d0dcbcb6784" - * }, - * { - * "BoundingBox": { - * "Height": 0.3249259889125824, - * "Left": 0.5155559778213501, - * "Top": 0.1513350009918213, - * "Width": 0.24333299696445465 - * }, - * "Confidence": 99.99949645996094, - * "FaceId": "70008e50-75e4-55d0-8e80-363fb73b3a14", - * "ImageId": "d5631190-d039-54e4-b267-abd22c8647c5" - * }, - * { - * "BoundingBox": { - * "Height": 0.03777780011296272, - * "Left": 0.7002969980239868, - * "Top": 0.18777799606323242, - * "Width": 0.05044509842991829 - * }, - * "Confidence": 99.92639923095703, - * "FaceId": "7f5f88ed-d684-5a88-b0df-01e4a521552b", - * "ImageId": "812d9f04-86f9-54fc-9275-8d0dcbcb6784" - * }, - * { - * "BoundingBox": { - * "Height": 0.05555560067296028, - * "Left": 0.13946600258350372, - * "Top": 0.46333301067352295, - * "Width": 0.07270029932260513 - * }, - * "Confidence": 99.99469757080078, - * "FaceId": "895b4e2c-81de-5902-a4bd-d1792bda00b2", - * "ImageId": "812d9f04-86f9-54fc-9275-8d0dcbcb6784" - * }, - * { - * "BoundingBox": { - * "Height": 0.3259260058403015, - * "Left": 0.5144439935684204, - * "Top": 0.15111100673675537, - * "Width": 0.24444399774074554 - * }, - * "Confidence": 99.99949645996094, - * "FaceId": "8be04dba-4e58-520d-850e-9eae4af70eb2", - * "ImageId": "465f4e93-763e-51d0-b030-b9667a2d94b1" - * }, - * { - * "BoundingBox": { - * "Height": 0.18888899683952332, - * "Left": 0.3783380091190338, - * "Top": 0.2355560064315796, - * "Width": 0.25222599506378174 - * }, - * "Confidence": 99.9999008178711, - * "FaceId": "908544ad-edc3-59df-8faf-6a87cc256cf5", - * "ImageId": "3c731605-d772-541a-a5e7-0375dbc68a07" - * }, - * { - * "BoundingBox": { - * "Height": 0.33481499552726746, - * "Left": 0.31888899207115173, - * "Top": 0.49333301186561584, - * "Width": 0.25 - * }, - * "Confidence": 99.99909973144531, - * "FaceId": "ff43d742-0c13-5d16-a3e8-03d3f58e980b", - * "ImageId": "465f4e93-763e-51d0-b030-b9667a2d94b1" + * "Confidence": 99.82969665527344, + * "FaceId": "c0eb3b65-24a0-41e1-b23a-1908b1aaeac1", + * "ImageId": "56a0ca74-1c83-39dd-b363-051a64168a65", + * "IndexFacesModelVersion": "6.0" * } * ] * } diff --git a/clients/client-rekognition/src/protocols/Aws_json1_1.ts b/clients/client-rekognition/src/protocols/Aws_json1_1.ts index a5304cb1d0e33..e28af65aa3eec 100644 --- a/clients/client-rekognition/src/protocols/Aws_json1_1.ts +++ b/clients/client-rekognition/src/protocols/Aws_json1_1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -9088,11 +9089,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts index 8d51cad87f5e5..e21bdfa1d813c 100644 --- a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { MessageHeaders as __MessageHeaders, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -643,11 +644,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts b/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts index 9402a11251677..fda608c4db2cf 100644 --- a/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts +++ b/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5684,11 +5685,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts b/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts index b66c3ef324f6f..48f08a4637bbc 100644 --- a/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts +++ b/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2053,11 +2054,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts index f7a6be03cd3e0..61e0bc2f9641b 100644 --- a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts +++ b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts @@ -5,6 +5,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -778,11 +779,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-resource-groups/src/protocols/Aws_restJson1.ts b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts index ac976b7146618..00bb9a0cd3d34 100644 --- a/clients/client-resource-groups/src/protocols/Aws_restJson1.ts +++ b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1927,11 +1928,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-robomaker/src/protocols/Aws_restJson1.ts b/clients/client-robomaker/src/protocols/Aws_restJson1.ts index d00a47dbd5d07..fdbddcf3ed361 100644 --- a/clients/client-robomaker/src/protocols/Aws_restJson1.ts +++ b/clients/client-robomaker/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -6225,11 +6226,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts b/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts index f9733af0f694c..4eb7c45d44483 100644 --- a/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts +++ b/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2595,11 +2596,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts index 703191193c061..413973fa54fe2 100644 --- a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts +++ b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2953,11 +2954,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-route-53/src/protocols/Aws_restXml.ts b/clients/client-route-53/src/protocols/Aws_restXml.ts index b2465fd3d7db7..0636546ea546e 100644 --- a/clients/client-route-53/src/protocols/Aws_restXml.ts +++ b/clients/client-route-53/src/protocols/Aws_restXml.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -9613,11 +9614,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts index e4514b48c988c..4844339474fd8 100644 --- a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts +++ b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts @@ -5,6 +5,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -520,11 +521,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts index 3190329ed1cdd..c669fe043bdbd 100644 --- a/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts +++ b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2293,11 +2294,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts index 75642e7970471..38cffcfd0ce71 100644 --- a/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts +++ b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3492,11 +3493,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts index c7d6cb2312dd4..117cdf0759196 100644 --- a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts +++ b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts @@ -6,6 +6,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5597,11 +5598,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-rum/src/protocols/Aws_restJson1.ts b/clients/client-rum/src/protocols/Aws_restJson1.ts index d8812a41c321e..b615a41bf2e88 100644 --- a/clients/client-rum/src/protocols/Aws_restJson1.ts +++ b/clients/client-rum/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -1943,11 +1944,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-s3-control/src/protocols/Aws_restXml.ts b/clients/client-s3-control/src/protocols/Aws_restXml.ts index c564a8998d785..e900e91ff61aa 100644 --- a/clients/client-s3-control/src/protocols/Aws_restXml.ts +++ b/clients/client-s3-control/src/protocols/Aws_restXml.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, @@ -10349,11 +10350,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-s3/src/commands/CreateBucketCommand.ts b/clients/client-s3/src/commands/CreateBucketCommand.ts index 393a99928003b..b5d83c598d52d 100644 --- a/clients/client-s3/src/commands/CreateBucketCommand.ts +++ b/clients/client-s3/src/commands/CreateBucketCommand.ts @@ -240,39 +240,39 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @example To create a bucket + * @example To create a bucket in a specific region * ```javascript - * // The following example creates a bucket. + * // The following example creates a bucket. The request specifies an AWS region where to create the bucket. * const input = { - * "Bucket": "examplebucket" + * "Bucket": "examplebucket", + * "CreateBucketConfiguration": { + * "LocationConstraint": "eu-west-1" + * } * }; * const command = new CreateBucketCommand(input); * const response = await client.send(command); * /* response == * { - * "Location": "/examplebucket" + * "Location": "http://examplebucket..s3.amazonaws.com/" * } * *\/ - * // example id: to-create-a-bucket--1472851826060 + * // example id: to-create-a-bucket-in-a-specific-region-1483399072992 * ``` * - * @example To create a bucket in a specific region + * @example To create a bucket * ```javascript - * // The following example creates a bucket. The request specifies an AWS region where to create the bucket. + * // The following example creates a bucket. * const input = { - * "Bucket": "examplebucket", - * "CreateBucketConfiguration": { - * "LocationConstraint": "eu-west-1" - * } + * "Bucket": "examplebucket" * }; * const command = new CreateBucketCommand(input); * const response = await client.send(command); * /* response == * { - * "Location": "http://examplebucket..s3.amazonaws.com/" + * "Location": "/examplebucket" * } * *\/ - * // example id: to-create-a-bucket-in-a-specific-region-1483399072992 + * // example id: to-create-a-bucket--1472851826060 * ``` * */ diff --git a/clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts b/clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts index 8c09e526c31ba..b0d6a2f3226e0 100644 --- a/clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts +++ b/clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts @@ -85,39 +85,39 @@ export interface DeleteObjectTaggingCommandOutput extends DeleteObjectTaggingOut * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @example To remove tag set from an object version + * @example To remove tag set from an object * ```javascript - * // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version. + * // The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version. * const input = { * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg", - * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + * "Key": "HappyFace.jpg" * }; * const command = new DeleteObjectTaggingCommand(input); * const response = await client.send(command); * /* response == * { - * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + * "VersionId": "null" * } * *\/ - * // example id: to-remove-tag-set-from-an-object-version-1483145285913 + * // example id: to-remove-tag-set-from-an-object-1483145342862 * ``` * - * @example To remove tag set from an object + * @example To remove tag set from an object version * ```javascript - * // The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version. + * // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version. * const input = { * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg" + * "Key": "HappyFace.jpg", + * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" * }; * const command = new DeleteObjectTaggingCommand(input); * const response = await client.send(command); * /* response == * { - * "VersionId": "null" + * "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" * } * *\/ - * // example id: to-remove-tag-set-from-an-object-1483145342862 + * // example id: to-remove-tag-set-from-an-object-version-1483145285913 * ``` * */ diff --git a/clients/client-s3/src/commands/DeleteObjectsCommand.ts b/clients/client-s3/src/commands/DeleteObjectsCommand.ts index 346bac2443910..d281299f0ed12 100644 --- a/clients/client-s3/src/commands/DeleteObjectsCommand.ts +++ b/clients/client-s3/src/commands/DeleteObjectsCommand.ts @@ -144,20 +144,18 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @example To delete multiple object versions from a versioned bucket + * @example To delete multiple objects from a versioned bucket * ```javascript - * // The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object versions and returns the key and versions of deleted objects in the response. + * // The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker. * const input = { * "Bucket": "examplebucket", * "Delete": { * "Objects": [ * { - * "Key": "HappyFace.jpg", - * "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b" + * "Key": "objectkey1" * }, * { - * "Key": "HappyFace.jpg", - * "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd" + * "Key": "objectkey2" * } * ], * "Quiet": false @@ -169,31 +167,35 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad * { * "Deleted": [ * { - * "Key": "HappyFace.jpg", - * "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd" + * "DeleteMarker": "true", + * "DeleteMarkerVersionId": "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F", + * "Key": "objectkey1" * }, * { - * "Key": "HappyFace.jpg", - * "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b" + * "DeleteMarker": "true", + * "DeleteMarkerVersionId": "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt", + * "Key": "objectkey2" * } * ] * } * *\/ - * // example id: to-delete-multiple-object-versions-from-a-versioned-bucket-1483147087737 + * // example id: to-delete-multiple-objects-from-a-versioned-bucket-1483146248805 * ``` * - * @example To delete multiple objects from a versioned bucket + * @example To delete multiple object versions from a versioned bucket * ```javascript - * // The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker. + * // The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object versions and returns the key and versions of deleted objects in the response. * const input = { * "Bucket": "examplebucket", * "Delete": { * "Objects": [ * { - * "Key": "objectkey1" + * "Key": "HappyFace.jpg", + * "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b" * }, * { - * "Key": "objectkey2" + * "Key": "HappyFace.jpg", + * "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd" * } * ], * "Quiet": false @@ -205,19 +207,17 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad * { * "Deleted": [ * { - * "DeleteMarker": "true", - * "DeleteMarkerVersionId": "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F", - * "Key": "objectkey1" + * "Key": "HappyFace.jpg", + * "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd" * }, * { - * "DeleteMarker": "true", - * "DeleteMarkerVersionId": "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt", - * "Key": "objectkey2" + * "Key": "HappyFace.jpg", + * "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b" * } * ] * } * *\/ - * // example id: to-delete-multiple-objects-from-a-versioned-bucket-1483146248805 + * // example id: to-delete-multiple-object-versions-from-a-versioned-bucket-1483147087737 * ``` * */ diff --git a/clients/client-s3/src/commands/GetObjectCommand.ts b/clients/client-s3/src/commands/GetObjectCommand.ts index f5deaf94a3bcf..c3794a4df4b4e 100644 --- a/clients/client-s3/src/commands/GetObjectCommand.ts +++ b/clients/client-s3/src/commands/GetObjectCommand.ts @@ -301,53 +301,53 @@ export interface GetObjectCommandOutput extends __WithSdkStreamMixinBase exception class for all service exceptions from S3 service.

* - * @example To retrieve an object + * @example To retrieve a byte range of an object * ```javascript - * // The following example retrieves an object for an S3 bucket. + * // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range. * const input = { * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg" + * "Key": "SampleFile.txt", + * "Range": "bytes=0-9" * }; * const command = new GetObjectCommand(input); * const response = await client.send(command); * /* response == * { * "AcceptRanges": "bytes", - * "ContentLength": "3191", - * "ContentType": "image/jpeg", - * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT", + * "ContentLength": "10", + * "ContentRange": "bytes 0-9/43", + * "ContentType": "text/plain", + * "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"", + * "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT", * "Metadata": {}, - * "TagCount": 2, * "VersionId": "null" * } * *\/ - * // example id: to-retrieve-an-object-1481827837012 + * // example id: to-retrieve-a-byte-range-of-an-object--1481832674603 * ``` * - * @example To retrieve a byte range of an object + * @example To retrieve an object * ```javascript - * // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range. + * // The following example retrieves an object for an S3 bucket. * const input = { * "Bucket": "examplebucket", - * "Key": "SampleFile.txt", - * "Range": "bytes=0-9" + * "Key": "HappyFace.jpg" * }; * const command = new GetObjectCommand(input); * const response = await client.send(command); * /* response == * { * "AcceptRanges": "bytes", - * "ContentLength": "10", - * "ContentRange": "bytes 0-9/43", - * "ContentType": "text/plain", - * "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"", - * "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT", + * "ContentLength": "3191", + * "ContentType": "image/jpeg", + * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", + * "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT", * "Metadata": {}, + * "TagCount": 2, * "VersionId": "null" * } * *\/ - * // example id: to-retrieve-a-byte-range-of-an-object--1481832674603 + * // example id: to-retrieve-an-object-1481827837012 * ``` * */ diff --git a/clients/client-s3/src/commands/PutObjectCommand.ts b/clients/client-s3/src/commands/PutObjectCommand.ts index 5b6deff4bc2dd..89b13c3ebedc9 100644 --- a/clients/client-s3/src/commands/PutObjectCommand.ts +++ b/clients/client-s3/src/commands/PutObjectCommand.ts @@ -29,11 +29,6 @@ import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from ". * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link PutObjectCommand}. - */ export type PutObjectCommandInputType = Omit & { /** * For *`PutObjectRequest["Body"]`*, see {@link PutObjectRequest.Body}. @@ -41,7 +36,9 @@ export type PutObjectCommandInputType = Omit & { Body?: PutObjectRequest["Body"] | string | Uint8Array | Buffer; }; /** - * This interface extends from `PutObjectRequest` interface. There are more parameters than `Body` defined in {@link PutObjectRequest} + * @public + * + * The input for {@link PutObjectCommand}. */ export interface PutObjectCommandInput extends PutObjectCommandInputType {} /** @@ -220,55 +217,57 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @example To upload an object and specify optional tags + * @example To upload an object * ```javascript - * // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object. + * // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object. * const input = { - * "Body": "c:\\HappyFace.jpg", + * "Body": "HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg", - * "Tagging": "key1=value1&key2=value2" + * "Key": "HappyFace.jpg" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a" + * "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk" * } * *\/ - * // example id: to-upload-an-object-and-specify-optional-tags-1481762310955 + * // example id: to-upload-an-object-1481760101010 * ``` * - * @example To upload an object and specify canned ACL. + * @example To upload object and specify user-defined metadata * ```javascript - * // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { - * "ACL": "authenticated-read", * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "exampleobject" + * "Key": "exampleobject", + * "Metadata": { + * "metadata1": "value1", + * "metadata2": "value2" + * } * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr" + * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" * } * *\/ - * // example id: to-upload-an-object-and-specify-canned-acl-1483397779571 + * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 * ``` * - * @example To upload an object and specify server-side encryption and object tags + * @example To upload an object (specify optional headers) * ```javascript - * // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. * const input = { - * "Body": "filetoupload", + * "Body": "HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "exampleobject", + * "Key": "HappyFace.jpg", * "ServerSideEncryption": "AES256", - * "Tagging": "key1=value1&key2=value2" + * "StorageClass": "STANDARD_IA" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); @@ -276,10 +275,10 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", * "ServerSideEncryption": "AES256", - * "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt" + * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" * } * *\/ - * // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831 + * // example id: to-upload-an-object-(specify-optional-headers) * ``` * * @example To create an object. @@ -301,68 +300,66 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * // example id: to-create-an-object-1483147613675 * ``` * - * @example To upload an object + * @example To upload an object and specify server-side encryption and object tags * ```javascript - * // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object. + * // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { - * "Body": "HappyFace.jpg", + * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "HappyFace.jpg" + * "Key": "exampleobject", + * "ServerSideEncryption": "AES256", + * "Tagging": "key1=value1&key2=value2" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk" + * "ServerSideEncryption": "AES256", + * "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt" * } * *\/ - * // example id: to-upload-an-object-1481760101010 + * // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831 * ``` * - * @example To upload an object (specify optional headers) + * @example To upload an object and specify optional tags * ```javascript - * // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. + * // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object. * const input = { - * "Body": "HappyFace.jpg", + * "Body": "c:\\HappyFace.jpg", * "Bucket": "examplebucket", * "Key": "HappyFace.jpg", - * "ServerSideEncryption": "AES256", - * "StorageClass": "STANDARD_IA" + * "Tagging": "key1=value1&key2=value2" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "ServerSideEncryption": "AES256", - * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" + * "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a" * } * *\/ - * // example id: to-upload-an-object-(specify-optional-headers) + * // example id: to-upload-an-object-and-specify-optional-tags-1481762310955 * ``` * - * @example To upload object and specify user-defined metadata + * @example To upload an object and specify canned ACL. * ```javascript - * // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. + * // The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response. * const input = { + * "ACL": "authenticated-read", * "Body": "filetoupload", * "Bucket": "examplebucket", - * "Key": "exampleobject", - * "Metadata": { - * "metadata1": "value1", - * "metadata2": "value2" - * } + * "Key": "exampleobject" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" + * "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr" * } * *\/ - * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 + * // example id: to-upload-an-object-and-specify-canned-acl-1483397779571 * ``` * */ diff --git a/clients/client-s3/src/commands/UploadPartCommand.ts b/clients/client-s3/src/commands/UploadPartCommand.ts index cb1fcf3d3bf5a..27d6db84382e5 100644 --- a/clients/client-s3/src/commands/UploadPartCommand.ts +++ b/clients/client-s3/src/commands/UploadPartCommand.ts @@ -28,11 +28,6 @@ import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from ". * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link UploadPartCommand}. - */ export type UploadPartCommandInputType = Omit & { /** * For *`UploadPartRequest["Body"]`*, see {@link UploadPartRequest.Body}. @@ -40,7 +35,9 @@ export type UploadPartCommandInputType = Omit & { Body?: UploadPartRequest["Body"] | string | Uint8Array | Buffer; }; /** - * This interface extends from `UploadPartRequest` interface. There are more parameters than `Body` defined in {@link UploadPartRequest} + * @public + * + * The input for {@link UploadPartCommand}. */ export interface UploadPartCommandInput extends UploadPartCommandInputType {} /** diff --git a/clients/client-s3/src/commands/UploadPartCopyCommand.ts b/clients/client-s3/src/commands/UploadPartCopyCommand.ts index a7a82257ac703..bba1ad596bca9 100644 --- a/clients/client-s3/src/commands/UploadPartCopyCommand.ts +++ b/clients/client-s3/src/commands/UploadPartCopyCommand.ts @@ -270,14 +270,15 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met * @throws {@link S3ServiceException} *

Base exception class for all service exceptions from S3 service.

* - * @example To upload a part by copying data from an existing object as data source + * @example To upload a part by copying byte range from an existing object as data source * ```javascript - * // The following example uploads a part of a multipart upload by copying data from an existing object as data source. + * // The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as data source. * const input = { * "Bucket": "examplebucket", * "CopySource": "/bucketname/sourceobjectkey", + * "CopySourceRange": "bytes=1-100000", * "Key": "examplelargeobject", - * "PartNumber": "1", + * "PartNumber": "2", * "UploadId": "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--" * }; * const command = new UploadPartCopyCommand(input); @@ -285,23 +286,22 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met * /* response == * { * "CopyPartResult": { - * "ETag": "\"b0c6f0e7e054ab8fa2536a2677f8734d\"", - * "LastModified": "2016-12-29T21:24:43.000Z" + * "ETag": "\"65d16d19e65a7508a51f043180edcc36\"", + * "LastModified": "2016-12-29T21:44:28.000Z" * } * } * *\/ - * // example id: to-upload-a-part-by-copying-data-from-an-existing-object-as-data-source-1483046746348 + * // example id: to-upload-a-part-by-copying-byte-range-from-an-existing-object-as-data-source-1483048068594 * ``` * - * @example To upload a part by copying byte range from an existing object as data source + * @example To upload a part by copying data from an existing object as data source * ```javascript - * // The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as data source. + * // The following example uploads a part of a multipart upload by copying data from an existing object as data source. * const input = { * "Bucket": "examplebucket", * "CopySource": "/bucketname/sourceobjectkey", - * "CopySourceRange": "bytes=1-100000", * "Key": "examplelargeobject", - * "PartNumber": "2", + * "PartNumber": "1", * "UploadId": "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--" * }; * const command = new UploadPartCopyCommand(input); @@ -309,12 +309,12 @@ export interface UploadPartCopyCommandOutput extends UploadPartCopyOutput, __Met * /* response == * { * "CopyPartResult": { - * "ETag": "\"65d16d19e65a7508a51f043180edcc36\"", - * "LastModified": "2016-12-29T21:44:28.000Z" + * "ETag": "\"b0c6f0e7e054ab8fa2536a2677f8734d\"", + * "LastModified": "2016-12-29T21:24:43.000Z" * } * } * *\/ - * // example id: to-upload-a-part-by-copying-byte-range-from-an-existing-object-as-data-source-1483048068594 + * // example id: to-upload-a-part-by-copying-data-from-an-existing-object-as-data-source-1483046746348 * ``` * */ diff --git a/clients/client-s3/src/commands/WriteGetObjectResponseCommand.ts b/clients/client-s3/src/commands/WriteGetObjectResponseCommand.ts index 36abb8ca7e82d..c8578a4a91dbc 100644 --- a/clients/client-s3/src/commands/WriteGetObjectResponseCommand.ts +++ b/clients/client-s3/src/commands/WriteGetObjectResponseCommand.ts @@ -21,11 +21,6 @@ import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from ". * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link WriteGetObjectResponseCommand}. - */ export type WriteGetObjectResponseCommandInputType = Omit & { /** * For *`WriteGetObjectResponseRequest["Body"]`*, see {@link WriteGetObjectResponseRequest.Body}. @@ -33,7 +28,9 @@ export type WriteGetObjectResponseCommandInputType = Omit ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-s3outposts/src/protocols/Aws_restJson1.ts b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts index 78e699cfbfdee..5d24a7b01d1d0 100644 --- a/clients/client-s3outposts/src/protocols/Aws_restJson1.ts +++ b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -666,11 +667,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts index 842de94f9da08..a903e626b4ea5 100644 --- a/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -632,11 +633,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts index 0a4898fd8cfb9..c2aa7148294d8 100644 --- a/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -360,11 +361,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts index a2f6257bd5b99..656a11c2865db 100644 --- a/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -535,11 +536,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts index c0c8a86e18db6..b9302f074f305 100644 --- a/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts @@ -24,6 +24,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2990,11 +2991,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts index 19c69094d73ca..3cc5bd17fccab 100644 --- a/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts @@ -9,6 +9,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -124,11 +125,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts b/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts index ede69b8518e8f..761370e649968 100644 --- a/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts +++ b/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -10,6 +11,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -26,18 +28,30 @@ import { SageMakerRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputT * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type InvokeEndpointCommandInputType = Omit & { + Body: BlobTypes; +}; /** * @public * * The input for {@link InvokeEndpointCommand}. */ -export interface InvokeEndpointCommandInput extends InvokeEndpointInput {} +export interface InvokeEndpointCommandInput extends InvokeEndpointCommandInputType {} +/** + * @public + */ +export type InvokeEndpointCommandOutputType = Omit & { + Body: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link InvokeEndpointCommand}. */ -export interface InvokeEndpointCommandOutput extends InvokeEndpointOutput, __MetadataBearer {} +export interface InvokeEndpointCommandOutput extends InvokeEndpointCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts index 57130d76f8fd9..4b9757aadde71 100644 --- a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -357,11 +358,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts index dc9a371fbeb9d..d6af45e8812a4 100644 --- a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts +++ b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -28239,11 +28240,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-savingsplans/src/protocols/Aws_restJson1.ts b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts index 703c68e1aca20..35565668ebbce 100644 --- a/clients/client-savingsplans/src/protocols/Aws_restJson1.ts +++ b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1004,11 +1005,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-scheduler/src/protocols/Aws_restJson1.ts b/clients/client-scheduler/src/protocols/Aws_restJson1.ts index 0ede6fdf40e8a..5975d42e1bab2 100644 --- a/clients/client-scheduler/src/protocols/Aws_restJson1.ts +++ b/clients/client-scheduler/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1395,11 +1396,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-schemas/src/commands/GetCodeBindingSourceCommand.ts b/clients/client-schemas/src/commands/GetCodeBindingSourceCommand.ts index 37ed566a4c880..2ed9dea22c7cc 100644 --- a/clients/client-schemas/src/commands/GetCodeBindingSourceCommand.ts +++ b/clients/client-schemas/src/commands/GetCodeBindingSourceCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -27,12 +28,18 @@ export { __MetadataBearer, $Command }; * The input for {@link GetCodeBindingSourceCommand}. */ export interface GetCodeBindingSourceCommandInput extends GetCodeBindingSourceRequest {} +/** + * @public + */ +export type GetCodeBindingSourceCommandOutputType = Omit & { + Body?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetCodeBindingSourceCommand}. */ -export interface GetCodeBindingSourceCommandOutput extends GetCodeBindingSourceResponse, __MetadataBearer {} +export interface GetCodeBindingSourceCommandOutput extends GetCodeBindingSourceCommandOutputType, __MetadataBearer {} /** * @public diff --git a/clients/client-schemas/src/protocols/Aws_restJson1.ts b/clients/client-schemas/src/protocols/Aws_restJson1.ts index 6662a10b77612..e3b1b7dfffb76 100644 --- a/clients/client-schemas/src/protocols/Aws_restJson1.ts +++ b/clients/client-schemas/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3404,11 +3405,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts index d5ab288d9d209..bd17986b8e0c5 100644 --- a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2228,11 +2229,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-securityhub/src/commands/BatchDeleteAutomationRulesCommand.ts b/clients/client-securityhub/src/commands/BatchDeleteAutomationRulesCommand.ts index ff5c9833e5739..af92ad9acc9f5 100644 --- a/clients/client-securityhub/src/commands/BatchDeleteAutomationRulesCommand.ts +++ b/clients/client-securityhub/src/commands/BatchDeleteAutomationRulesCommand.ts @@ -93,6 +93,34 @@ export interface BatchDeleteAutomationRulesCommandOutput extends BatchDeleteAuto * @throws {@link SecurityHubServiceException} *

Base exception class for all service exceptions from SecurityHub service.

* + * @example To delete one or more automation rules + * ```javascript + * // The following example deletes the specified automation rules. + * const input = { + * "AutomationRulesArns": [ + * "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", + * "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222" + * ] + * }; + * const command = new BatchDeleteAutomationRulesCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "ProcessedAutomationRules": [ + * "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" + * ], + * "UnprocessedAutomationRules": [ + * { + * "ErrorCode": 500, + * "ErrorMessage": "InternalException", + * "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222" + * } + * ] + * } + * *\/ + * // example id: to-delete-one-or-more-automation-rules-1684769550318 + * ``` + * */ export class BatchDeleteAutomationRulesCommand extends $Command< BatchDeleteAutomationRulesCommandInput, diff --git a/clients/client-securityhub/src/commands/BatchGetAutomationRulesCommand.ts b/clients/client-securityhub/src/commands/BatchGetAutomationRulesCommand.ts index 2b312bc1f63b6..01c751f425be5 100644 --- a/clients/client-securityhub/src/commands/BatchGetAutomationRulesCommand.ts +++ b/clients/client-securityhub/src/commands/BatchGetAutomationRulesCommand.ts @@ -278,6 +278,102 @@ export interface BatchGetAutomationRulesCommandOutput extends BatchGetAutomation * @throws {@link SecurityHubServiceException} *

Base exception class for all service exceptions from SecurityHub service.

* + * @example To update one ore more automation rules + * ```javascript + * // The following example updates the specified automation rules. + * const input = { + * "AutomationRulesArns": [ + * "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", + * "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222" + * ] + * }; + * const command = new BatchGetAutomationRulesCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Rules": [ + * { + * "Actions": [ + * { + * "FindingFieldsUpdate": { + * "Workflow": { + * "Status": "RESOLVED" + * } + * }, + * "Type": "FINDING_FIELDS_UPDATE" + * } + * ], + * "CreatedAt": "2022-08-31T01:52:33.250Z", + * "CreatedBy": "AROAJURBUYQQNL5OL2TIM:TEST-16MJ75L9VBK14", + * "Criteria": { + * "AwsAccountId": [ + * { + * "Comparison": "EQUALS", + * "Value": "111122223333" + * } + * ], + * "FirstObservedAt": [ + * { + * "DateRange": { + * "Unit": "DAYS", + * "Value": 5 + * } + * } + * ], + * "Type": [ + * { + * "Comparison": "EQUALS", + * "Value": "Software and Configuration Checks/Industry and Regulatory Standards" + * } + * ] + * }, + * "Description": "sample rule description 1", + * "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", + * "RuleName": "sample-rule-name-1", + * "RuleOrder": 1, + * "RuleStatus": "ENABLED", + * "UpdatedAt": "2022-08-31T01:52:33.250Z" + * }, + * { + * "Actions": [ + * { + * "FindingFieldsUpdate": { + * "Workflow": { + * "Status": "RESOLVED" + * } + * }, + * "Type": "FINDING_FIELDS_UPDATE" + * } + * ], + * "CreatedAt": "2022-08-31T01:52:33.250Z", + * "CreatedBy": "AROAJURBUYQQNL5OL2TIM:TEST-16MJ75L9VBK14", + * "Criteria": { + * "ResourceType": [ + * { + * "Comparison": "EQUALS", + * "Value": "Ec2Instance" + * } + * ], + * "SeverityLabel": [ + * { + * "Comparison": "EQUALS", + * "Value": "INFORMATIONAL" + * } + * ] + * }, + * "Description": "Sample rule description 2", + * "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", + * "RuleName": "sample-rule-name-2", + * "RuleOrder": 2, + * "RuleStatus": "ENABLED", + * "UpdatedAt": "2022-08-31T01:52:33.250Z" + * } + * ] + * } + * *\/ + * // example id: to-update-one-ore-more-automation-rules-1684771025347 + * ``` + * */ export class BatchGetAutomationRulesCommand extends $Command< BatchGetAutomationRulesCommandInput, diff --git a/clients/client-securityhub/src/commands/BatchUpdateAutomationRulesCommand.ts b/clients/client-securityhub/src/commands/BatchUpdateAutomationRulesCommand.ts index badd0ca8f90ac..b67b4e4e0cc33 100644 --- a/clients/client-securityhub/src/commands/BatchUpdateAutomationRulesCommand.ts +++ b/clients/client-securityhub/src/commands/BatchUpdateAutomationRulesCommand.ts @@ -272,6 +272,35 @@ export interface BatchUpdateAutomationRulesCommandOutput extends BatchUpdateAuto * @throws {@link SecurityHubServiceException} *

Base exception class for all service exceptions from SecurityHub service.

* + * @example To update one ore more automation rules + * ```javascript + * // The following example updates the specified automation rules. + * const input = { + * "UpdateAutomationRulesRequestItems": [ + * { + * "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", + * "RuleOrder": 15, + * "RuleStatus": "ENABLED" + * }, + * { + * "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", + * "RuleStatus": "DISABLED" + * } + * ] + * }; + * const command = new BatchUpdateAutomationRulesCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "ProcessedAutomationRules": [ + * "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", + * "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222" + * ] + * } + * *\/ + * // example id: to-update-one-ore-more-automation-rules-1684771025347 + * ``` + * */ export class BatchUpdateAutomationRulesCommand extends $Command< BatchUpdateAutomationRulesCommandInput, diff --git a/clients/client-securityhub/src/commands/CreateAutomationRuleCommand.ts b/clients/client-securityhub/src/commands/CreateAutomationRuleCommand.ts index 77dd75f461e3f..de00f869e6cc3 100644 --- a/clients/client-securityhub/src/commands/CreateAutomationRuleCommand.ts +++ b/clients/client-securityhub/src/commands/CreateAutomationRuleCommand.ts @@ -260,6 +260,75 @@ export interface CreateAutomationRuleCommandOutput extends CreateAutomationRuleR * @throws {@link SecurityHubServiceException} *

Base exception class for all service exceptions from SecurityHub service.

* + * @example To create an automation rule + * ```javascript + * // The following example creates an automation rule. + * const input = { + * "Actions": [ + * { + * "FindingFieldsUpdate": { + * "Note": { + * "Text": "This is a critical S3 bucket, please look into this ASAP", + * "UpdatedBy": "test-user" + * }, + * "Severity": { + * "Label": "CRITICAL" + * } + * }, + * "Type": "FINDING_FIELDS_UPDATE" + * } + * ], + * "Criteria": { + * "ComplianceStatus": [ + * { + * "Comparison": "EQUALS", + * "Value": "FAILED" + * } + * ], + * "ProductName": [ + * { + * "Comparison": "EQUALS", + * "Value": "Security Hub" + * } + * ], + * "RecordState": [ + * { + * "Comparison": "EQUALS", + * "Value": "ACTIVE" + * } + * ], + * "ResourceId": [ + * { + * "Comparison": "EQUALS", + * "Value": "arn:aws:s3:::examplebucket/developers/design_info.doc" + * } + * ], + * "WorkflowStatus": [ + * { + * "Comparison": "EQUALS", + * "Value": "NEW" + * } + * ] + * }, + * "Description": "Elevate finding severity to Critical for important resources", + * "IsTerminal": false, + * "RuleName": "Elevate severity for important resources", + * "RuleOrder": 1, + * "RuleStatus": "ENABLED", + * "Tags": { + * "important-resources-rule": "s3-bucket" + * } + * }; + * const command = new CreateAutomationRuleCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" + * } + * *\/ + * // example id: to-create-an-automation-rule-1684768393507 + * ``` + * */ export class CreateAutomationRuleCommand extends $Command< CreateAutomationRuleCommandInput, diff --git a/clients/client-securityhub/src/commands/ListAutomationRulesCommand.ts b/clients/client-securityhub/src/commands/ListAutomationRulesCommand.ts index b007ed26c5c94..89edc2c8e41b3 100644 --- a/clients/client-securityhub/src/commands/ListAutomationRulesCommand.ts +++ b/clients/client-securityhub/src/commands/ListAutomationRulesCommand.ts @@ -96,6 +96,45 @@ export interface ListAutomationRulesCommandOutput extends ListAutomationRulesRes * @throws {@link SecurityHubServiceException} *

Base exception class for all service exceptions from SecurityHub service.

* + * @example To list automation rules + * ```javascript + * // The following example lists automation rules and rule metadata in the calling account. + * const input = { + * "MaxResults": 2, + * "NextToken": "example-token" + * }; + * const command = new ListAutomationRulesCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "AutomationRulesMetadata": [ + * { + * "CreatedAt": "2022-08-31T01:52:33.250Z", + * "CreatedBy": "AROAJURBUYQQNL5OL2TIM:TEST-16MJ75L9VBK14", + * "Description": "IAM.8 is a known issue and can be resolved", + * "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", + * "RuleName": "sample-rule-name-1", + * "RuleOrder": 1, + * "RuleStatus": "ENABLED", + * "UpdatedAt": "2022-08-31T01:52:33.250Z" + * }, + * { + * "CreatedAt": "2022-08-31T01:52:33.250Z", + * "CreatedBy": "AROAJURBUYQQNL5OL2TIM:TEST-16MJ75L9VBK14", + * "Description": "Lambda.2 is a known issue and can be resolved", + * "RuleArn": "arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", + * "RuleName": "sample-rule-name-2", + * "RuleOrder": 2, + * "RuleStatus": "ENABLED", + * "UpdatedAt": "2022-08-31T01:52:33.250Z" + * } + * ], + * "NextToken": "example-token" + * } + * *\/ + * // example id: to-list-automation-rules-1684770582059 + * ``` + * */ export class ListAutomationRulesCommand extends $Command< ListAutomationRulesCommandInput, diff --git a/clients/client-securityhub/src/protocols/Aws_restJson1.ts b/clients/client-securityhub/src/protocols/Aws_restJson1.ts index 0c62eea489df4..6f4d7a01fa899 100644 --- a/clients/client-securityhub/src/protocols/Aws_restJson1.ts +++ b/clients/client-securityhub/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -11889,11 +11890,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-securitylake/src/protocols/Aws_restJson1.ts b/clients/client-securitylake/src/protocols/Aws_restJson1.ts index e45209c503513..a9174142676fd 100644 --- a/clients/client-securitylake/src/protocols/Aws_restJson1.ts +++ b/clients/client-securitylake/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2995,11 +2996,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts index f3baa9abb1d05..0e688ab7e8625 100644 --- a/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts +++ b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1862,11 +1863,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts index bdb70901d8089..133ea3218da68 100644 --- a/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts +++ b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2392,11 +2393,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts index 0d8ae49e99cb3..4b62cf601bb2e 100644 --- a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7745,11 +7746,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts index f8d0bbeda8117..ff74bd8eb507e 100644 --- a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2233,11 +2234,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts index 25843a102de03..cdc85ee18d49e 100644 --- a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts +++ b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -2550,11 +2551,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ses/src/protocols/Aws_query.ts b/clients/client-ses/src/protocols/Aws_query.ts index 05c99b875ce2a..cf5d3f6414701 100644 --- a/clients/client-ses/src/protocols/Aws_query.ts +++ b/clients/client-ses/src/protocols/Aws_query.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -9716,11 +9717,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sesv2/src/commands/PutDedicatedIpPoolScalingAttributesCommand.ts b/clients/client-sesv2/src/commands/PutDedicatedIpPoolScalingAttributesCommand.ts index 98019b7eb3662..5470b9c69cd0e 100644 --- a/clients/client-sesv2/src/commands/PutDedicatedIpPoolScalingAttributesCommand.ts +++ b/clients/client-sesv2/src/commands/PutDedicatedIpPoolScalingAttributesCommand.ts @@ -23,6 +23,10 @@ import { } from "../protocols/Aws_restJson1"; import { ServiceInputTypes, ServiceOutputTypes, SESv2ClientResolvedConfig } from "../SESv2Client"; +/** + * @public + */ +export { __MetadataBearer, $Command }; /** * @public * diff --git a/clients/client-sesv2/src/protocols/Aws_restJson1.ts b/clients/client-sesv2/src/protocols/Aws_restJson1.ts index ecd63e350af34..571f340b99f7e 100644 --- a/clients/client-sesv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-sesv2/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -8911,11 +8912,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sfn/src/protocols/Aws_json1_0.ts b/clients/client-sfn/src/protocols/Aws_json1_0.ts index 8bcc27ae67f24..fefd7369c7127 100644 --- a/clients/client-sfn/src/protocols/Aws_json1_0.ts +++ b/clients/client-sfn/src/protocols/Aws_json1_0.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -2849,11 +2850,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-shield/src/protocols/Aws_json1_1.ts b/clients/client-shield/src/protocols/Aws_json1_1.ts index 8499d2bb45d0b..40d6b6737316d 100644 --- a/clients/client-shield/src/protocols/Aws_json1_1.ts +++ b/clients/client-shield/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3364,11 +3365,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-signer/src/protocols/Aws_restJson1.ts b/clients/client-signer/src/protocols/Aws_restJson1.ts index c73e3da571c78..c029bc6d753ba 100644 --- a/clients/client-signer/src/protocols/Aws_restJson1.ts +++ b/clients/client-signer/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -2141,11 +2142,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts b/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts index 17a6239e22ab3..980b4c58ae542 100644 --- a/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts +++ b/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1628,11 +1629,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sms/src/protocols/Aws_json1_1.ts b/clients/client-sms/src/protocols/Aws_json1_1.ts index 12a7bd303e288..e98285004ad57 100644 --- a/clients/client-sms/src/protocols/Aws_json1_1.ts +++ b/clients/client-sms/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3569,11 +3570,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts index 8f24ef53a1c2e..7cb8c266ae648 100644 --- a/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts +++ b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1465,11 +1466,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-snowball/src/protocols/Aws_json1_1.ts b/clients/client-snowball/src/protocols/Aws_json1_1.ts index 6885f712bac1e..8a10feede3c83 100644 --- a/clients/client-snowball/src/protocols/Aws_json1_1.ts +++ b/clients/client-snowball/src/protocols/Aws_json1_1.ts @@ -14,6 +14,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2549,11 +2550,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sns/src/protocols/Aws_query.ts b/clients/client-sns/src/protocols/Aws_query.ts index c0df6b3d5b4b7..42b71bb5e25db 100644 --- a/clients/client-sns/src/protocols/Aws_query.ts +++ b/clients/client-sns/src/protocols/Aws_query.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -5936,11 +5937,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sqs/src/protocols/Aws_query.ts b/clients/client-sqs/src/protocols/Aws_query.ts index 78f732f09ea9d..b9ed495699afa 100644 --- a/clients/client-sqs/src/protocols/Aws_query.ts +++ b/clients/client-sqs/src/protocols/Aws_query.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -3363,11 +3364,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts index 3a7f7e3c7e5bc..e7f191bc52e5c 100644 --- a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3853,11 +3854,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts index dd59f4faff7c4..c4b259dfd40b0 100644 --- a/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts +++ b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts @@ -17,6 +17,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3182,11 +3183,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts b/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts index 78cbefb2ea2aa..698903652270a 100644 --- a/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts +++ b/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1691,11 +1692,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-ssm/src/protocols/Aws_json1_1.ts b/clients/client-ssm/src/protocols/Aws_json1_1.ts index 6f5023f611b91..391e30f055576 100644 --- a/clients/client-ssm/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -15903,11 +15904,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts index 780a63f285634..b656fb8c27ea0 100644 --- a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts +++ b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3452,11 +3453,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts index 357c30fba27c2..a47098d65f8e0 100644 --- a/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts +++ b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -602,11 +603,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sso/src/protocols/Aws_restJson1.ts b/clients/client-sso/src/protocols/Aws_restJson1.ts index a3eb6df9b8a65..6c457736d0ddb 100644 --- a/clients/client-sso/src/protocols/Aws_restJson1.ts +++ b/clients/client-sso/src/protocols/Aws_restJson1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -452,11 +453,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts index a37e97ae21176..4705a533560be 100644 --- a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts +++ b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6804,11 +6805,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-sts/src/protocols/Aws_query.ts b/clients/client-sts/src/protocols/Aws_query.ts index bbf7a5524f825..f2f0e310d01f0 100644 --- a/clients/client-sts/src/protocols/Aws_query.ts +++ b/clients/client-sts/src/protocols/Aws_query.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { XMLParser } from "fast-xml-parser"; @@ -1334,11 +1335,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-support-app/src/protocols/Aws_restJson1.ts b/clients/client-support-app/src/protocols/Aws_restJson1.ts index a95eb2a4f74dd..3b7a87d786b20 100644 --- a/clients/client-support-app/src/protocols/Aws_restJson1.ts +++ b/clients/client-support-app/src/protocols/Aws_restJson1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1040,11 +1041,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-support/src/protocols/Aws_json1_1.ts b/clients/client-support/src/protocols/Aws_json1_1.ts index b04451433eb63..ffeac83965193 100644 --- a/clients/client-support/src/protocols/Aws_json1_1.ts +++ b/clients/client-support/src/protocols/Aws_json1_1.ts @@ -9,6 +9,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1640,11 +1641,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-swf/src/protocols/Aws_json1_0.ts b/clients/client-swf/src/protocols/Aws_json1_0.ts index a0861b5998355..7a18beb02f8ea 100644 --- a/clients/client-swf/src/protocols/Aws_json1_0.ts +++ b/clients/client-swf/src/protocols/Aws_json1_0.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3300,11 +3301,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-synthetics/src/protocols/Aws_restJson1.ts b/clients/client-synthetics/src/protocols/Aws_restJson1.ts index 47ccb77ba8f31..7df22c5b30293 100644 --- a/clients/client-synthetics/src/protocols/Aws_restJson1.ts +++ b/clients/client-synthetics/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2276,11 +2277,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-textract/src/protocols/Aws_json1_1.ts b/clients/client-textract/src/protocols/Aws_json1_1.ts index cf5c6c492a708..c5115711599d7 100644 --- a/clients/client-textract/src/protocols/Aws_json1_1.ts +++ b/clients/client-textract/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -2176,11 +2177,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts index 19f7e30b8e9a5..cf7d2fc747ec7 100644 --- a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -1617,11 +1618,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts index e37eac4551427..27c27480f1ce5 100644 --- a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2050,11 +2051,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-tnb/src/commands/GetSolFunctionPackageContentCommand.ts b/clients/client-tnb/src/commands/GetSolFunctionPackageContentCommand.ts index 00e0be4eb1efe..1ec1ddd017d05 100644 --- a/clients/client-tnb/src/commands/GetSolFunctionPackageContentCommand.ts +++ b/clients/client-tnb/src/commands/GetSolFunctionPackageContentCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -30,13 +31,22 @@ export { __MetadataBearer, $Command }; * The input for {@link GetSolFunctionPackageContentCommand}. */ export interface GetSolFunctionPackageContentCommandInput extends GetSolFunctionPackageContentInput {} +/** + * @public + */ +export type GetSolFunctionPackageContentCommandOutputType = Omit< + GetSolFunctionPackageContentOutput, + "packageContent" +> & { + packageContent?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetSolFunctionPackageContentCommand}. */ export interface GetSolFunctionPackageContentCommandOutput - extends GetSolFunctionPackageContentOutput, + extends GetSolFunctionPackageContentCommandOutputType, __MetadataBearer {} /** diff --git a/clients/client-tnb/src/commands/GetSolFunctionPackageDescriptorCommand.ts b/clients/client-tnb/src/commands/GetSolFunctionPackageDescriptorCommand.ts index b7c3ac7d086dc..c21497b235ba9 100644 --- a/clients/client-tnb/src/commands/GetSolFunctionPackageDescriptorCommand.ts +++ b/clients/client-tnb/src/commands/GetSolFunctionPackageDescriptorCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -30,13 +31,19 @@ export { __MetadataBearer, $Command }; * The input for {@link GetSolFunctionPackageDescriptorCommand}. */ export interface GetSolFunctionPackageDescriptorCommandInput extends GetSolFunctionPackageDescriptorInput {} +/** + * @public + */ +export type GetSolFunctionPackageDescriptorCommandOutputType = Omit & { + vnfd?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetSolFunctionPackageDescriptorCommand}. */ export interface GetSolFunctionPackageDescriptorCommandOutput - extends GetSolFunctionPackageDescriptorOutput, + extends GetSolFunctionPackageDescriptorCommandOutputType, __MetadataBearer {} /** diff --git a/clients/client-tnb/src/commands/GetSolNetworkPackageContentCommand.ts b/clients/client-tnb/src/commands/GetSolNetworkPackageContentCommand.ts index 3bde7de9bf37b..17ba9e38038ce 100644 --- a/clients/client-tnb/src/commands/GetSolNetworkPackageContentCommand.ts +++ b/clients/client-tnb/src/commands/GetSolNetworkPackageContentCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -30,12 +31,20 @@ export { __MetadataBearer, $Command }; * The input for {@link GetSolNetworkPackageContentCommand}. */ export interface GetSolNetworkPackageContentCommandInput extends GetSolNetworkPackageContentInput {} +/** + * @public + */ +export type GetSolNetworkPackageContentCommandOutputType = Omit & { + nsdContent?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetSolNetworkPackageContentCommand}. */ -export interface GetSolNetworkPackageContentCommandOutput extends GetSolNetworkPackageContentOutput, __MetadataBearer {} +export interface GetSolNetworkPackageContentCommandOutput + extends GetSolNetworkPackageContentCommandOutputType, + __MetadataBearer {} /** * @public diff --git a/clients/client-tnb/src/commands/GetSolNetworkPackageDescriptorCommand.ts b/clients/client-tnb/src/commands/GetSolNetworkPackageDescriptorCommand.ts index 34d36fc58e0fc..6f61f6cd76cfd 100644 --- a/clients/client-tnb/src/commands/GetSolNetworkPackageDescriptorCommand.ts +++ b/clients/client-tnb/src/commands/GetSolNetworkPackageDescriptorCommand.ts @@ -10,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -30,13 +31,19 @@ export { __MetadataBearer, $Command }; * The input for {@link GetSolNetworkPackageDescriptorCommand}. */ export interface GetSolNetworkPackageDescriptorCommandInput extends GetSolNetworkPackageDescriptorInput {} +/** + * @public + */ +export type GetSolNetworkPackageDescriptorCommandOutputType = Omit & { + nsd?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link GetSolNetworkPackageDescriptorCommand}. */ export interface GetSolNetworkPackageDescriptorCommandOutput - extends GetSolNetworkPackageDescriptorOutput, + extends GetSolNetworkPackageDescriptorCommandOutputType, __MetadataBearer {} /** diff --git a/clients/client-tnb/src/commands/PutSolFunctionPackageContentCommand.ts b/clients/client-tnb/src/commands/PutSolFunctionPackageContentCommand.ts index db0f088f944ce..a5dd2e357b63b 100644 --- a/clients/client-tnb/src/commands/PutSolFunctionPackageContentCommand.ts +++ b/clients/client-tnb/src/commands/PutSolFunctionPackageContentCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -24,12 +25,18 @@ import { ServiceInputTypes, ServiceOutputTypes, TnbClientResolvedConfig } from " * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type PutSolFunctionPackageContentCommandInputType = Omit & { + file: BlobTypes; +}; /** * @public * * The input for {@link PutSolFunctionPackageContentCommand}. */ -export interface PutSolFunctionPackageContentCommandInput extends PutSolFunctionPackageContentInput {} +export interface PutSolFunctionPackageContentCommandInput extends PutSolFunctionPackageContentCommandInputType {} /** * @public * diff --git a/clients/client-tnb/src/commands/PutSolNetworkPackageContentCommand.ts b/clients/client-tnb/src/commands/PutSolNetworkPackageContentCommand.ts index 24734a024e97d..7df28f2736695 100644 --- a/clients/client-tnb/src/commands/PutSolNetworkPackageContentCommand.ts +++ b/clients/client-tnb/src/commands/PutSolNetworkPackageContentCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -24,12 +25,18 @@ import { ServiceInputTypes, ServiceOutputTypes, TnbClientResolvedConfig } from " * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type PutSolNetworkPackageContentCommandInputType = Omit & { + file: BlobTypes; +}; /** * @public * * The input for {@link PutSolNetworkPackageContentCommand}. */ -export interface PutSolNetworkPackageContentCommandInput extends PutSolNetworkPackageContentInput {} +export interface PutSolNetworkPackageContentCommandInput extends PutSolNetworkPackageContentCommandInputType {} /** * @public * diff --git a/clients/client-tnb/src/commands/ValidateSolFunctionPackageContentCommand.ts b/clients/client-tnb/src/commands/ValidateSolFunctionPackageContentCommand.ts index 442c9d63418ff..6ca3823f888e5 100644 --- a/clients/client-tnb/src/commands/ValidateSolFunctionPackageContentCommand.ts +++ b/clients/client-tnb/src/commands/ValidateSolFunctionPackageContentCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -24,12 +25,19 @@ import { ServiceInputTypes, ServiceOutputTypes, TnbClientResolvedConfig } from " * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type ValidateSolFunctionPackageContentCommandInputType = Omit & { + file: BlobTypes; +}; /** * @public * * The input for {@link ValidateSolFunctionPackageContentCommand}. */ -export interface ValidateSolFunctionPackageContentCommandInput extends ValidateSolFunctionPackageContentInput {} +export interface ValidateSolFunctionPackageContentCommandInput + extends ValidateSolFunctionPackageContentCommandInputType {} /** * @public * diff --git a/clients/client-tnb/src/commands/ValidateSolNetworkPackageContentCommand.ts b/clients/client-tnb/src/commands/ValidateSolNetworkPackageContentCommand.ts index a693ec32a3451..73143bbc82a62 100644 --- a/clients/client-tnb/src/commands/ValidateSolNetworkPackageContentCommand.ts +++ b/clients/client-tnb/src/commands/ValidateSolNetworkPackageContentCommand.ts @@ -3,6 +3,7 @@ import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middl import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -24,12 +25,19 @@ import { ServiceInputTypes, ServiceOutputTypes, TnbClientResolvedConfig } from " * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type ValidateSolNetworkPackageContentCommandInputType = Omit & { + file: BlobTypes; +}; /** * @public * * The input for {@link ValidateSolNetworkPackageContentCommand}. */ -export interface ValidateSolNetworkPackageContentCommandInput extends ValidateSolNetworkPackageContentInput {} +export interface ValidateSolNetworkPackageContentCommandInput + extends ValidateSolNetworkPackageContentCommandInputType {} /** * @public * diff --git a/clients/client-tnb/src/protocols/Aws_restJson1.ts b/clients/client-tnb/src/protocols/Aws_restJson1.ts index 84ed1ec0f7bc9..512072844e2b8 100644 --- a/clients/client-tnb/src/protocols/Aws_restJson1.ts +++ b/clients/client-tnb/src/protocols/Aws_restJson1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3618,11 +3619,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts index 00066ee0c4daf..0eadf11f5ca5e 100644 --- a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { MessageHeaders as __MessageHeaders, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -1187,11 +1188,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-transcribe/src/protocols/Aws_json1_1.ts b/clients/client-transcribe/src/protocols/Aws_json1_1.ts index 4ff5ed434ce98..458281e70aa1a 100644 --- a/clients/client-transcribe/src/protocols/Aws_json1_1.ts +++ b/clients/client-transcribe/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3780,11 +3781,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-transfer/src/protocols/Aws_json1_1.ts b/clients/client-transfer/src/protocols/Aws_json1_1.ts index 23060cbefdf89..7da11cc59a517 100644 --- a/clients/client-transfer/src/protocols/Aws_json1_1.ts +++ b/clients/client-transfer/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5001,11 +5002,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-translate/src/protocols/Aws_json1_1.ts b/clients/client-translate/src/protocols/Aws_json1_1.ts index 8c204fb9409ac..46bca2f405c88 100644 --- a/clients/client-translate/src/protocols/Aws_json1_1.ts +++ b/clients/client-translate/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2152,11 +2153,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts b/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts index d7f791ac30eb9..606252ac0f8a5 100644 --- a/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts +++ b/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -2637,11 +2638,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-voice-id/src/protocols/Aws_json1_0.ts b/clients/client-voice-id/src/protocols/Aws_json1_0.ts index 220d716d4ced8..9ea649665a3ec 100644 --- a/clients/client-voice-id/src/protocols/Aws_json1_0.ts +++ b/clients/client-voice-id/src/protocols/Aws_json1_0.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3091,11 +3092,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts b/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts index 40e5b4cb633a2..1351cbccd0355 100644 --- a/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts +++ b/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5772,11 +5773,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts index aec6b2454cfb4..df07eb852af16 100644 --- a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -7117,11 +7118,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-waf/src/protocols/Aws_json1_1.ts b/clients/client-waf/src/protocols/Aws_json1_1.ts index 1fa3e39a6e3d2..14e802d119f07 100644 --- a/clients/client-waf/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf/src/protocols/Aws_json1_1.ts @@ -11,6 +11,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -6788,11 +6789,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-wafv2/src/protocols/Aws_json1_1.ts b/clients/client-wafv2/src/protocols/Aws_json1_1.ts index 0d4978b45b433..0a448a99198eb 100644 --- a/clients/client-wafv2/src/protocols/Aws_json1_1.ts +++ b/clients/client-wafv2/src/protocols/Aws_json1_1.ts @@ -13,6 +13,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5955,11 +5956,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts index 94f7cfa8b5803..b0cd80d477d9a 100644 --- a/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts +++ b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5925,11 +5926,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-wisdom/src/protocols/Aws_restJson1.ts b/clients/client-wisdom/src/protocols/Aws_restJson1.ts index 4dfa848f2ca2b..a5a12ef051545 100644 --- a/clients/client-wisdom/src/protocols/Aws_restJson1.ts +++ b/clients/client-wisdom/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -3079,11 +3080,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-workdocs/src/protocols/Aws_restJson1.ts b/clients/client-workdocs/src/protocols/Aws_restJson1.ts index 57c875cb77b3e..016c6f38663ef 100644 --- a/clients/client-workdocs/src/protocols/Aws_restJson1.ts +++ b/clients/client-workdocs/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5186,11 +5187,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-worklink/src/protocols/Aws_restJson1.ts b/clients/client-worklink/src/protocols/Aws_restJson1.ts index 662e18547404c..50067c6306d7d 100644 --- a/clients/client-worklink/src/protocols/Aws_restJson1.ts +++ b/clients/client-worklink/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3269,11 +3270,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-workmail/src/protocols/Aws_json1_1.ts b/clients/client-workmail/src/protocols/Aws_json1_1.ts index b8a6ee518166b..f3661a8ea5076 100644 --- a/clients/client-workmail/src/protocols/Aws_json1_1.ts +++ b/clients/client-workmail/src/protocols/Aws_json1_1.ts @@ -12,6 +12,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -7388,11 +7389,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts index 72a7568767fb3..9516b3ff59f51 100644 --- a/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts +++ b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts @@ -12,6 +12,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -271,11 +272,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts b/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts index 6e8b1f608d17f..ebffad6741d40 100644 --- a/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts +++ b/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts @@ -15,6 +15,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -5810,11 +5811,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-workspaces/src/protocols/Aws_json1_1.ts b/clients/client-workspaces/src/protocols/Aws_json1_1.ts index e6db6889c3e2e..d3da069373e65 100644 --- a/clients/client-workspaces/src/protocols/Aws_json1_1.ts +++ b/clients/client-workspaces/src/protocols/Aws_json1_1.ts @@ -10,6 +10,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -5665,11 +5666,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/clients/client-xray/src/protocols/Aws_restJson1.ts b/clients/client-xray/src/protocols/Aws_restJson1.ts index bc96d04236be6..702fae899709d 100644 --- a/clients/client-xray/src/protocols/Aws_restJson1.ts +++ b/clients/client-xray/src/protocols/Aws_restJson1.ts @@ -18,6 +18,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; @@ -3534,11 +3535,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-echo-service/src/protocols/Aws_restJson1.ts b/private/aws-echo-service/src/protocols/Aws_restJson1.ts index 89db54ab3187e..2d02ae4df8a42 100644 --- a/private/aws-echo-service/src/protocols/Aws_restJson1.ts +++ b/private/aws-echo-service/src/protocols/Aws_restJson1.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; @@ -178,11 +179,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts index 22f92e01e0d49..5f861b15bd997 100644 --- a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts +++ b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts @@ -19,6 +19,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -2343,11 +2344,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts index 3849c348143c6..bfec49f2b33e2 100644 --- a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts +++ b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts @@ -16,6 +16,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -752,11 +753,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts index cd4f1006243db..a5926b68ff86b 100644 --- a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts +++ b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts @@ -25,6 +25,7 @@ import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -1412,11 +1413,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-protocoltests-query/src/protocols/Aws_query.ts b/private/aws-protocoltests-query/src/protocols/Aws_query.ts index df98a344363a0..fa5f1351eb97b 100644 --- a/private/aws-protocoltests-query/src/protocols/Aws_query.ts +++ b/private/aws-protocoltests-query/src/protocols/Aws_query.ts @@ -19,6 +19,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -3126,11 +3127,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-protocoltests-restjson/src/commands/HttpPayloadTraitsCommand.ts b/private/aws-protocoltests-restjson/src/commands/HttpPayloadTraitsCommand.ts index 2bd9221577a57..7b6979a7fdcd7 100644 --- a/private/aws-protocoltests-restjson/src/commands/HttpPayloadTraitsCommand.ts +++ b/private/aws-protocoltests-restjson/src/commands/HttpPayloadTraitsCommand.ts @@ -2,6 +2,7 @@ import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -9,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -20,18 +22,30 @@ import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputT * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type HttpPayloadTraitsCommandInputType = Omit & { + blob?: BlobTypes; +}; /** * @public * * The input for {@link HttpPayloadTraitsCommand}. */ -export interface HttpPayloadTraitsCommandInput extends HttpPayloadTraitsInputOutput {} +export interface HttpPayloadTraitsCommandInput extends HttpPayloadTraitsCommandInputType {} +/** + * @public + */ +export type HttpPayloadTraitsCommandOutputType = Omit & { + blob?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link HttpPayloadTraitsCommand}. */ -export interface HttpPayloadTraitsCommandOutput extends HttpPayloadTraitsInputOutput, __MetadataBearer {} +export interface HttpPayloadTraitsCommandOutput extends HttpPayloadTraitsCommandOutputType, __MetadataBearer {} /** * @public diff --git a/private/aws-protocoltests-restjson/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts b/private/aws-protocoltests-restjson/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts index 980246b47d521..1b61056341217 100644 --- a/private/aws-protocoltests-restjson/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts +++ b/private/aws-protocoltests-restjson/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts @@ -2,6 +2,7 @@ import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -9,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -23,19 +25,34 @@ import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputT * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type HttpPayloadTraitsWithMediaTypeCommandInputType = Omit & { + blob?: BlobTypes; +}; /** * @public * * The input for {@link HttpPayloadTraitsWithMediaTypeCommand}. */ -export interface HttpPayloadTraitsWithMediaTypeCommandInput extends HttpPayloadTraitsWithMediaTypeInputOutput {} +export interface HttpPayloadTraitsWithMediaTypeCommandInput extends HttpPayloadTraitsWithMediaTypeCommandInputType {} +/** + * @public + */ +export type HttpPayloadTraitsWithMediaTypeCommandOutputType = Omit< + HttpPayloadTraitsWithMediaTypeInputOutput, + "blob" +> & { + blob?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link HttpPayloadTraitsWithMediaTypeCommand}. */ export interface HttpPayloadTraitsWithMediaTypeCommandOutput - extends HttpPayloadTraitsWithMediaTypeInputOutput, + extends HttpPayloadTraitsWithMediaTypeCommandOutputType, __MetadataBearer {} /** diff --git a/private/aws-protocoltests-restjson/src/commands/MalformedAcceptWithPayloadCommand.ts b/private/aws-protocoltests-restjson/src/commands/MalformedAcceptWithPayloadCommand.ts index 508a6898cf7b9..2e3d06de4613f 100644 --- a/private/aws-protocoltests-restjson/src/commands/MalformedAcceptWithPayloadCommand.ts +++ b/private/aws-protocoltests-restjson/src/commands/MalformedAcceptWithPayloadCommand.ts @@ -9,6 +9,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -26,12 +27,20 @@ export { __MetadataBearer, $Command }; * The input for {@link MalformedAcceptWithPayloadCommand}. */ export interface MalformedAcceptWithPayloadCommandInput {} +/** + * @public + */ +export type MalformedAcceptWithPayloadCommandOutputType = Omit & { + payload?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link MalformedAcceptWithPayloadCommand}. */ -export interface MalformedAcceptWithPayloadCommandOutput extends MalformedAcceptWithPayloadOutput, __MetadataBearer {} +export interface MalformedAcceptWithPayloadCommandOutput + extends MalformedAcceptWithPayloadCommandOutputType, + __MetadataBearer {} export class MalformedAcceptWithPayloadCommand extends $Command< MalformedAcceptWithPayloadCommandInput, diff --git a/private/aws-protocoltests-restjson/src/commands/MalformedContentTypeWithPayloadCommand.ts b/private/aws-protocoltests-restjson/src/commands/MalformedContentTypeWithPayloadCommand.ts index 07491aa2d7f25..97f510f3bfe40 100644 --- a/private/aws-protocoltests-restjson/src/commands/MalformedContentTypeWithPayloadCommand.ts +++ b/private/aws-protocoltests-restjson/src/commands/MalformedContentTypeWithPayloadCommand.ts @@ -2,6 +2,7 @@ import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -23,12 +24,18 @@ import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputT * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type MalformedContentTypeWithPayloadCommandInputType = Omit & { + payload?: BlobTypes; +}; /** * @public * * The input for {@link MalformedContentTypeWithPayloadCommand}. */ -export interface MalformedContentTypeWithPayloadCommandInput extends MalformedContentTypeWithPayloadInput {} +export interface MalformedContentTypeWithPayloadCommandInput extends MalformedContentTypeWithPayloadCommandInputType {} /** * @public * diff --git a/private/aws-protocoltests-restjson/src/commands/StreamingTraitsCommand.ts b/private/aws-protocoltests-restjson/src/commands/StreamingTraitsCommand.ts index f1d61dfcef76c..ffe43fb0dba3d 100644 --- a/private/aws-protocoltests-restjson/src/commands/StreamingTraitsCommand.ts +++ b/private/aws-protocoltests-restjson/src/commands/StreamingTraitsCommand.ts @@ -23,11 +23,6 @@ import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputT * @public */ export { __MetadataBearer, $Command }; -/** - * @public - * - * The input for {@link StreamingTraitsCommand}. - */ export type StreamingTraitsCommandInputType = Omit & { /** * For *`StreamingTraitsInputOutput["blob"]`*, see {@link StreamingTraitsInputOutput.blob}. @@ -35,7 +30,9 @@ export type StreamingTraitsCommandInputType = Omit & { /** * For *`StreamingTraitsRequireLengthInput["blob"]`*, see {@link StreamingTraitsRequireLengthInput.blob}. @@ -38,7 +33,9 @@ export type StreamingTraitsRequireLengthCommandInputType = Omit & { /** * For *`StreamingTraitsWithMediaTypeInputOutput["blob"]`*, see {@link StreamingTraitsWithMediaTypeInputOutput.blob}. @@ -41,7 +36,9 @@ export type StreamingTraitsWithMediaTypeCommandInputType = Omit & { + data?: BlobTypes; +}; /** * @public * * The input for {@link TestPayloadBlobCommand}. */ -export interface TestPayloadBlobCommandInput extends TestPayloadBlobInputOutput {} +export interface TestPayloadBlobCommandInput extends TestPayloadBlobCommandInputType {} +/** + * @public + */ +export type TestPayloadBlobCommandOutputType = Omit & { + data?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link TestPayloadBlobCommand}. */ -export interface TestPayloadBlobCommandOutput extends TestPayloadBlobInputOutput, __MetadataBearer {} +export interface TestPayloadBlobCommandOutput extends TestPayloadBlobCommandOutputType, __MetadataBearer {} /** * @public diff --git a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts index 0288ba94f8bc3..8098fcf2435cd 100644 --- a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts +++ b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts @@ -40,6 +40,7 @@ import { ResponseMetadata as __ResponseMetadata, SdkStreamSerdeContext as __SdkStreamSerdeContext, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse, @@ -7414,11 +7415,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-protocoltests-restxml/src/commands/HttpPayloadTraitsCommand.ts b/private/aws-protocoltests-restxml/src/commands/HttpPayloadTraitsCommand.ts index 2375329b2786d..f42e5aba2d46e 100644 --- a/private/aws-protocoltests-restxml/src/commands/HttpPayloadTraitsCommand.ts +++ b/private/aws-protocoltests-restxml/src/commands/HttpPayloadTraitsCommand.ts @@ -2,6 +2,7 @@ import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -9,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -20,18 +22,30 @@ import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTy * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type HttpPayloadTraitsCommandInputType = Omit & { + blob?: BlobTypes; +}; /** * @public * * The input for {@link HttpPayloadTraitsCommand}. */ -export interface HttpPayloadTraitsCommandInput extends HttpPayloadTraitsInputOutput {} +export interface HttpPayloadTraitsCommandInput extends HttpPayloadTraitsCommandInputType {} +/** + * @public + */ +export type HttpPayloadTraitsCommandOutputType = Omit & { + blob?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link HttpPayloadTraitsCommand}. */ -export interface HttpPayloadTraitsCommandOutput extends HttpPayloadTraitsInputOutput, __MetadataBearer {} +export interface HttpPayloadTraitsCommandOutput extends HttpPayloadTraitsCommandOutputType, __MetadataBearer {} /** * @public diff --git a/private/aws-protocoltests-restxml/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts b/private/aws-protocoltests-restxml/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts index 86f03ab4701e3..7f7dd0b72791c 100644 --- a/private/aws-protocoltests-restxml/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts +++ b/private/aws-protocoltests-restxml/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts @@ -2,6 +2,7 @@ import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { + BlobTypes, FinalizeHandlerArguments, Handler, HandlerExecutionContext, @@ -9,6 +10,7 @@ import { MetadataBearer as __MetadataBearer, MiddlewareStack, } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { SerdeContext as __SerdeContext } from "@smithy/types"; @@ -23,19 +25,34 @@ import { RestXmlProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTy * @public */ export { __MetadataBearer, $Command }; +/** + * @public + */ +export type HttpPayloadTraitsWithMediaTypeCommandInputType = Omit & { + blob?: BlobTypes; +}; /** * @public * * The input for {@link HttpPayloadTraitsWithMediaTypeCommand}. */ -export interface HttpPayloadTraitsWithMediaTypeCommandInput extends HttpPayloadTraitsWithMediaTypeInputOutput {} +export interface HttpPayloadTraitsWithMediaTypeCommandInput extends HttpPayloadTraitsWithMediaTypeCommandInputType {} +/** + * @public + */ +export type HttpPayloadTraitsWithMediaTypeCommandOutputType = Omit< + HttpPayloadTraitsWithMediaTypeInputOutput, + "blob" +> & { + blob?: Uint8ArrayBlobAdapter; +}; /** * @public * * The output of {@link HttpPayloadTraitsWithMediaTypeCommand}. */ export interface HttpPayloadTraitsWithMediaTypeCommandOutput - extends HttpPayloadTraitsWithMediaTypeInputOutput, + extends HttpPayloadTraitsWithMediaTypeCommandOutputType, __MetadataBearer {} /** diff --git a/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts b/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts index 98d9eb6a31566..88834ed041722 100644 --- a/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts +++ b/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts @@ -26,6 +26,7 @@ import { withBaseException, } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { XmlNode as __XmlNode, XmlText as __XmlText } from "@aws-sdk/xml-builder"; import { HttpRequest as __HttpRequest, @@ -6085,11 +6086,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-restjson-server/src/protocols/Aws_restJson1.ts b/private/aws-restjson-server/src/protocols/Aws_restJson1.ts index 3c5167df75e0b..675c7a3769881 100644 --- a/private/aws-restjson-server/src/protocols/Aws_restJson1.ts +++ b/private/aws-restjson-server/src/protocols/Aws_restJson1.ts @@ -32,6 +32,7 @@ import { } from "@aws-sdk/smithy-client"; import { DocumentType as __DocumentType, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { acceptMatches as __acceptMatches, NotAcceptableException as __NotAcceptableException, @@ -8144,11 +8145,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8. diff --git a/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts b/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts index 69753bb64f953..1af579b8f7be1 100644 --- a/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts +++ b/private/aws-restjson-validation-server/src/protocols/Aws_restJson1.ts @@ -20,6 +20,7 @@ import { } from "@aws-sdk/smithy-client"; import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream"; import { acceptMatches as __acceptMatches, NotAcceptableException as __NotAcceptableException, @@ -1510,11 +1511,14 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ }); // Collect low-level response body stream to Uint8Array. -const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => { +const collectBody = async ( + streamBody: any = new Uint8Array(), + context: __SerdeContext +): Promise<__Uint8ArrayBlobAdapter> => { if (streamBody instanceof Uint8Array) { - return Promise.resolve(streamBody); + return __Uint8ArrayBlobAdapter.mutate(streamBody); } - return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter(); }; // Encode Uint8Array data into string with utf-8.