Skip to content

Commit 6ebe932

Browse files
committed
feat(smithy-client): use collectBody from smithy-client
1 parent f2bb3fd commit 6ebe932

File tree

391 files changed

+695
-4455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+695
-4455
lines changed

clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectBoolean as __expectBoolean,
67
expectNonNull as __expectNonNull,
@@ -15,7 +16,6 @@ import {
1516
withBaseException,
1617
} from "@aws-sdk/smithy-client";
1718
import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
18-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
1919
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
2020
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
2121
import { v4 as generateIdempotencyToken } from "uuid";
@@ -3323,17 +3323,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
33233323
cfId: output.headers["x-amz-cf-id"],
33243324
});
33253325

3326-
// Collect low-level response body stream to Uint8Array.
3327-
const collectBody = async (
3328-
streamBody: any = new Uint8Array(),
3329-
context: __SerdeContext
3330-
): Promise<__Uint8ArrayBlobAdapter> => {
3331-
if (streamBody instanceof Uint8Array) {
3332-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
3333-
}
3334-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
3335-
};
3336-
33373326
// Encode Uint8Array data into string with utf-8.
33383327
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
33393328
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-account/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectNonNull as __expectNonNull,
67
expectObject as __expectObject,
@@ -10,7 +11,6 @@ import {
1011
withBaseException,
1112
} from "@aws-sdk/smithy-client";
1213
import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
13-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
1414
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
1515
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
1616

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

971-
// Collect low-level response body stream to Uint8Array.
972-
const collectBody = async (
973-
streamBody: any = new Uint8Array(),
974-
context: __SerdeContext
975-
): Promise<__Uint8ArrayBlobAdapter> => {
976-
if (streamBody instanceof Uint8Array) {
977-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
978-
}
979-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
980-
};
981-
982971
// Encode Uint8Array data into string with utf-8.
983972
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
984973
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-acm-pca/src/protocols/Aws_json1_1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectNonNull as __expectNonNull,
67
expectNumber as __expectNumber,
@@ -10,7 +11,6 @@ import {
1011
withBaseException,
1112
} from "@aws-sdk/smithy-client";
1213
import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
13-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
1414
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
1515
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
1616

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

2380-
// Collect low-level response body stream to Uint8Array.
2381-
const collectBody = async (
2382-
streamBody: any = new Uint8Array(),
2383-
context: __SerdeContext
2384-
): Promise<__Uint8ArrayBlobAdapter> => {
2385-
if (streamBody instanceof Uint8Array) {
2386-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
2387-
}
2388-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
2389-
};
2390-
23912380
// Encode Uint8Array data into string with utf-8.
23922381
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
23932382
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-acm/src/protocols/Aws_json1_1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectBoolean as __expectBoolean,
67
expectNonNull as __expectNonNull,
@@ -11,7 +12,6 @@ import {
1112
withBaseException,
1213
} from "@aws-sdk/smithy-client";
1314
import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
14-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
1515
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
1616
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
1717

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

1602-
// Collect low-level response body stream to Uint8Array.
1603-
const collectBody = async (
1604-
streamBody: any = new Uint8Array(),
1605-
context: __SerdeContext
1606-
): Promise<__Uint8ArrayBlobAdapter> => {
1607-
if (streamBody instanceof Uint8Array) {
1608-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
1609-
}
1610-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
1611-
};
1612-
16131602
// Encode Uint8Array data into string with utf-8.
16141603
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
16151604
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectInt32 as __expectInt32,
67
expectNonNull as __expectNonNull,
@@ -11,7 +12,6 @@ import {
1112
withBaseException,
1213
} from "@aws-sdk/smithy-client";
1314
import { HeaderBag as __HeaderBag, ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
14-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
1515
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
1616
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
1717
import { v4 as generateIdempotencyToken } from "uuid";
@@ -7152,17 +7152,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
71527152
cfId: output.headers["x-amz-cf-id"],
71537153
});
71547154

7155-
// Collect low-level response body stream to Uint8Array.
7156-
const collectBody = async (
7157-
streamBody: any = new Uint8Array(),
7158-
context: __SerdeContext
7159-
): Promise<__Uint8ArrayBlobAdapter> => {
7160-
if (streamBody instanceof Uint8Array) {
7161-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
7162-
}
7163-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
7164-
};
7165-
71667155
// Encode Uint8Array data into string with utf-8.
71677156
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
71687157
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-amp/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectNonNull as __expectNonNull,
67
expectNumber as __expectNumber,
@@ -15,7 +16,6 @@ import {
1516
withBaseException,
1617
} from "@aws-sdk/smithy-client";
1718
import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
18-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
1919
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
2020
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
2121
import { v4 as generateIdempotencyToken } from "uuid";
@@ -2264,17 +2264,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
22642264
cfId: output.headers["x-amz-cf-id"],
22652265
});
22662266

2267-
// Collect low-level response body stream to Uint8Array.
2268-
const collectBody = async (
2269-
streamBody: any = new Uint8Array(),
2270-
context: __SerdeContext
2271-
): Promise<__Uint8ArrayBlobAdapter> => {
2272-
if (streamBody instanceof Uint8Array) {
2273-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
2274-
}
2275-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
2276-
};
2277-
22782267
// Encode Uint8Array data into string with utf-8.
22792268
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
22802269
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-amplify/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectBoolean as __expectBoolean,
67
expectNonNull as __expectNonNull,
@@ -15,7 +16,6 @@ import {
1516
withBaseException,
1617
} from "@aws-sdk/smithy-client";
1718
import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
18-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
1919
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
2020
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
2121

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

3781-
// Collect low-level response body stream to Uint8Array.
3782-
const collectBody = async (
3783-
streamBody: any = new Uint8Array(),
3784-
context: __SerdeContext
3785-
): Promise<__Uint8ArrayBlobAdapter> => {
3786-
if (streamBody instanceof Uint8Array) {
3787-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
3788-
}
3789-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
3790-
};
3791-
37923781
// Encode Uint8Array data into string with utf-8.
37933782
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
37943783
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-amplifybackend/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectBoolean as __expectBoolean,
67
expectNonNull as __expectNonNull,
@@ -14,7 +15,6 @@ import {
1415
withBaseException,
1516
} from "@aws-sdk/smithy-client";
1617
import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
17-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
1818
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
1919
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
2020

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

3895-
// Collect low-level response body stream to Uint8Array.
3896-
const collectBody = async (
3897-
streamBody: any = new Uint8Array(),
3898-
context: __SerdeContext
3899-
): Promise<__Uint8ArrayBlobAdapter> => {
3900-
if (streamBody instanceof Uint8Array) {
3901-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
3902-
}
3903-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
3904-
};
3905-
39063895
// Encode Uint8Array data into string with utf-8.
39073896
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
39083897
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
22
import {
33
_json,
4+
collectBody,
45
decorateServiceException as __decorateServiceException,
56
expectBoolean as __expectBoolean,
67
expectInt32 as __expectInt32,
@@ -18,7 +19,6 @@ import {
1819
withBaseException,
1920
} from "@aws-sdk/smithy-client";
2021
import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types";
21-
import { Uint8ArrayBlobAdapter as __Uint8ArrayBlobAdapter } from "@aws-sdk/util-stream";
2222
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
2323
import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types";
2424
import { v4 as generateIdempotencyToken } from "uuid";
@@ -3706,17 +3706,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
37063706
cfId: output.headers["x-amz-cf-id"],
37073707
});
37083708

3709-
// Collect low-level response body stream to Uint8Array.
3710-
const collectBody = async (
3711-
streamBody: any = new Uint8Array(),
3712-
context: __SerdeContext
3713-
): Promise<__Uint8ArrayBlobAdapter> => {
3714-
if (streamBody instanceof Uint8Array) {
3715-
return __Uint8ArrayBlobAdapter.mutate(streamBody);
3716-
}
3717-
return __Uint8ArrayBlobAdapter.mutate(await context.streamCollector(streamBody)) || new __Uint8ArrayBlobAdapter();
3718-
};
3719-
37203709
// Encode Uint8Array data into string with utf-8.
37213710
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
37223711
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-api-gateway/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"@aws-sdk/util-defaults-mode-node": "*",
5151
"@aws-sdk/util-endpoints": "*",
5252
"@aws-sdk/util-retry": "*",
53+
"@aws-sdk/util-stream": "*",
5354
"@aws-sdk/util-user-agent-browser": "*",
5455
"@aws-sdk/util-user-agent-node": "*",
5556
"@aws-sdk/util-utf8": "*",

0 commit comments

Comments
 (0)