Skip to content

Commit 60ec921

Browse files
authored
feat(clients): automatic blob type conversions (#4836)
* feat(clients): automatic blob type conversions * feat(clients): full codegen for blobs * feat(clients): blob helper tests * feat(smithy-client): use collectBody from smithy-client * feat(clients): codegen cleanup
1 parent 549f35d commit 60ec921

File tree

861 files changed

+2179
-3761
lines changed

Some content is hidden

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

861 files changed

+2179
-3761
lines changed

clients/client-accessanalyzer/src/AccessAnalyzerClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
244244
runtime?: string;
245245

246246
/**
247-
* Disable dyanamically changing the endpoint of the client based on the hostPrefix
247+
* Disable dynamically changing the endpoint of the client based on the hostPrefix
248248
* trait of an operation.
249249
*/
250250
disableHostPrefix?: boolean;

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

Lines changed: 1 addition & 8 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,
@@ -3322,14 +3323,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
33223323
cfId: output.headers["x-amz-cf-id"],
33233324
});
33243325

3325-
// Collect low-level response body stream to Uint8Array.
3326-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
3327-
if (streamBody instanceof Uint8Array) {
3328-
return Promise.resolve(streamBody);
3329-
}
3330-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
3331-
};
3332-
33333326
// Encode Uint8Array data into string with utf-8.
33343327
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
33353328
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-account/src/AccountClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
178178
runtime?: string;
179179

180180
/**
181-
* Disable dyanamically changing the endpoint of the client based on the hostPrefix
181+
* Disable dynamically changing the endpoint of the client based on the hostPrefix
182182
* trait of an operation.
183183
*/
184184
disableHostPrefix?: boolean;

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

Lines changed: 1 addition & 8 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,
@@ -967,14 +968,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
967968
cfId: output.headers["x-amz-cf-id"],
968969
});
969970

970-
// Collect low-level response body stream to Uint8Array.
971-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
972-
if (streamBody instanceof Uint8Array) {
973-
return Promise.resolve(streamBody);
974-
}
975-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
976-
};
977-
978971
// Encode Uint8Array data into string with utf-8.
979972
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
980973
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-acm-pca/src/ACMPCAClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
244244
runtime?: string;
245245

246246
/**
247-
* Disable dyanamically changing the endpoint of the client based on the hostPrefix
247+
* Disable dynamically changing the endpoint of the client based on the hostPrefix
248248
* trait of an operation.
249249
*/
250250
disableHostPrefix?: boolean;

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

Lines changed: 1 addition & 8 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,
@@ -2376,14 +2377,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
23762377
cfId: output.headers["x-amz-cf-id"],
23772378
});
23782379

2379-
// Collect low-level response body stream to Uint8Array.
2380-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
2381-
if (streamBody instanceof Uint8Array) {
2382-
return Promise.resolve(streamBody);
2383-
}
2384-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2385-
};
2386-
23872380
// Encode Uint8Array data into string with utf-8.
23882381
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
23892382
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-acm/src/ACMClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
205205
runtime?: string;
206206

207207
/**
208-
* Disable dyanamically changing the endpoint of the client based on the hostPrefix
208+
* Disable dynamically changing the endpoint of the client based on the hostPrefix
209209
* trait of an operation.
210210
*/
211211
disableHostPrefix?: boolean;

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

Lines changed: 1 addition & 8 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,
@@ -1598,14 +1599,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
15981599
cfId: output.headers["x-amz-cf-id"],
15991600
});
16001601

1601-
// Collect low-level response body stream to Uint8Array.
1602-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
1603-
if (streamBody instanceof Uint8Array) {
1604-
return Promise.resolve(streamBody);
1605-
}
1606-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1607-
};
1608-
16091602
// Encode Uint8Array data into string with utf-8.
16101603
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
16111604
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

clients/client-alexa-for-business/src/AlexaForBusinessClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
532532
runtime?: string;
533533

534534
/**
535-
* Disable dyanamically changing the endpoint of the client based on the hostPrefix
535+
* Disable dynamically changing the endpoint of the client based on the hostPrefix
536536
* trait of an operation.
537537
*/
538538
disableHostPrefix?: boolean;

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

Lines changed: 1 addition & 8 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,
@@ -7151,14 +7152,6 @@ const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
71517152
cfId: output.headers["x-amz-cf-id"],
71527153
});
71537154

7154-
// Collect low-level response body stream to Uint8Array.
7155-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
7156-
if (streamBody instanceof Uint8Array) {
7157-
return Promise.resolve(streamBody);
7158-
}
7159-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
7160-
};
7161-
71627155
// Encode Uint8Array data into string with utf-8.
71637156
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
71647157
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

0 commit comments

Comments
 (0)