Skip to content

Commit

Permalink
feat(smithy-client): use collectBody from smithy-client
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Jun 20, 2023
1 parent 9af69e9 commit df939bc
Show file tree
Hide file tree
Showing 390 changed files with 691 additions and 4,452 deletions.
13 changes: 1 addition & 12 deletions clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectBoolean as __expectBoolean,
expectNonNull as __expectNonNull,
Expand All @@ -15,7 +16,6 @@ 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";
Expand Down Expand Up @@ -3323,17 +3323,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
13 changes: 1 addition & 12 deletions clients/client-account/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectNonNull as __expectNonNull,
expectObject as __expectObject,
Expand All @@ -10,7 +11,6 @@ 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";

Expand Down Expand Up @@ -968,17 +968,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
13 changes: 1 addition & 12 deletions clients/client-acm-pca/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectNonNull as __expectNonNull,
expectNumber as __expectNumber,
Expand All @@ -10,7 +11,6 @@ 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";

Expand Down Expand Up @@ -2377,17 +2377,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
13 changes: 1 addition & 12 deletions clients/client-acm/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectBoolean as __expectBoolean,
expectNonNull as __expectNonNull,
Expand All @@ -11,7 +12,6 @@ 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";

Expand Down Expand Up @@ -1599,17 +1599,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
13 changes: 1 addition & 12 deletions clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectInt32 as __expectInt32,
expectNonNull as __expectNonNull,
Expand All @@ -11,7 +12,6 @@ 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";
Expand Down Expand Up @@ -7152,17 +7152,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
13 changes: 1 addition & 12 deletions clients/client-amp/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectNonNull as __expectNonNull,
expectNumber as __expectNumber,
Expand All @@ -15,7 +16,6 @@ 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";
Expand Down Expand Up @@ -2264,17 +2264,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
13 changes: 1 addition & 12 deletions clients/client-amplify/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectBoolean as __expectBoolean,
expectNonNull as __expectNonNull,
Expand All @@ -15,7 +16,6 @@ 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";

Expand Down Expand Up @@ -3778,17 +3778,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
13 changes: 1 addition & 12 deletions clients/client-amplifybackend/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectBoolean as __expectBoolean,
expectNonNull as __expectNonNull,
Expand All @@ -14,7 +15,6 @@ 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";

Expand Down Expand Up @@ -3892,17 +3892,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
13 changes: 1 addition & 12 deletions clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectBoolean as __expectBoolean,
expectInt32 as __expectInt32,
Expand All @@ -18,7 +19,6 @@ 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";
Expand Down Expand Up @@ -3706,17 +3706,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
1 change: 1 addition & 0 deletions clients/client-api-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@aws-sdk/util-defaults-mode-node": "*",
"@aws-sdk/util-endpoints": "*",
"@aws-sdk/util-retry": "*",
"@aws-sdk/util-stream": "*",
"@aws-sdk/util-user-agent-browser": "*",
"@aws-sdk/util-user-agent-node": "*",
"@aws-sdk/util-utf8": "*",
Expand Down
13 changes: 1 addition & 12 deletions clients/client-api-gateway/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
convertMap,
decorateServiceException as __decorateServiceException,
expectBoolean as __expectBoolean,
Expand All @@ -20,7 +21,6 @@ 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";

Expand Down Expand Up @@ -12172,17 +12172,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// smithy-typescript generated code
import {
_json,
collectBody,
decorateServiceException as __decorateServiceException,
expectNonNull as __expectNonNull,
expectObject as __expectObject,
Expand All @@ -12,7 +13,6 @@ 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";

Expand Down Expand Up @@ -369,17 +369,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
cfId: output.headers["x-amz-cf-id"],
});

// Collect low-level response body stream to Uint8Array.
const collectBody = async (
streamBody: any = new Uint8Array(),
context: __SerdeContext
): Promise<__Uint8ArrayBlobAdapter> => {
if (streamBody instanceof Uint8Array) {
return __Uint8ArrayBlobAdapter.mutate(streamBody);
}
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
};

// Encode Uint8Array data into string with utf-8.
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
Expand Down
1 change: 1 addition & 0 deletions clients/client-apigatewayv2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@aws-sdk/util-defaults-mode-node": "*",
"@aws-sdk/util-endpoints": "*",
"@aws-sdk/util-retry": "*",
"@aws-sdk/util-stream": "*",
"@aws-sdk/util-user-agent-browser": "*",
"@aws-sdk/util-user-agent-node": "*",
"@aws-sdk/util-utf8": "*",
Expand Down
Loading

0 comments on commit df939bc

Please sign in to comment.