Skip to content

Commit 89854b2

Browse files
committed
chore: bucket contextParam customization for schema-serde
1 parent 75c09dd commit 89854b2

File tree

118 files changed

+10230
-12842
lines changed

Some content is hidden

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

118 files changed

+10230
-12842
lines changed

clients/client-s3/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"@aws-sdk/util-endpoints": "*",
4848
"@aws-sdk/util-user-agent-browser": "*",
4949
"@aws-sdk/util-user-agent-node": "*",
50-
"@aws-sdk/xml-builder": "*",
5150
"@smithy/config-resolver": "^4.1.5",
5251
"@smithy/core": "^3.8.0",
5352
"@smithy/eventstream-serde-browser": "^4.0.5",
@@ -81,9 +80,7 @@
8180
"@smithy/util-stream": "^4.2.4",
8281
"@smithy/util-utf8": "^4.0.0",
8382
"@smithy/util-waiter": "^4.0.7",
84-
"@types/uuid": "^9.0.1",
85-
"tslib": "^2.6.2",
86-
"uuid": "^9.0.1"
83+
"tslib": "^2.6.2"
8784
},
8885
"devDependencies": {
8986
"@aws-sdk/signature-v4-crt": "*",

clients/client-s3/src/S3Client.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
getHttpAuthSchemeEndpointRuleSetPlugin,
3636
getHttpSigningPlugin,
3737
} from "@smithy/core";
38+
import { getSchemaSerdePlugin } from "@smithy/core/schema";
3839
import {
3940
EventStreamSerdeInputConfig,
4041
EventStreamSerdeResolvedConfig,
@@ -56,13 +57,16 @@ import {
5657
CheckOptionalClientConfig as __CheckOptionalClientConfig,
5758
Checksum as __Checksum,
5859
ChecksumConstructor as __ChecksumConstructor,
60+
ClientProtocol,
5961
Decoder as __Decoder,
6062
Encoder as __Encoder,
6163
EndpointV2 as __EndpointV2,
6264
EventStreamSerdeProvider as __EventStreamSerdeProvider,
6365
Hash as __Hash,
6466
HashConstructor as __HashConstructor,
6567
HttpHandlerOptions as __HttpHandlerOptions,
68+
HttpRequest,
69+
HttpResponse,
6670
Logger as __Logger,
6771
Provider as __Provider,
6872
Provider,
@@ -772,6 +776,16 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
772776
*/
773777
extensions?: RuntimeExtension[];
774778

779+
/**
780+
* The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON)
781+
* may be overridden. A default will always be set by the client.
782+
* Available options depend on the service's supported protocols and will not be validated by
783+
* the client.
784+
* @alpha
785+
*
786+
*/
787+
protocol?: ClientProtocol<HttpRequest, HttpResponse>;
788+
775789
/**
776790
* The function that provides necessary utilities for generating and parsing event stream
777791
*/
@@ -874,6 +888,7 @@ export class S3Client extends __Client<
874888
const _config_10 = resolveS3Config(_config_9, { session: [() => this, CreateSessionCommand] });
875889
const _config_11 = resolveRuntimeExtensions(_config_10, configuration?.extensions || []);
876890
this.config = _config_11;
891+
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
877892
this.middlewareStack.use(getUserAgentPlugin(this.config));
878893
this.middlewareStack.use(getRetryPlugin(this.config));
879894
this.middlewareStack.use(getContentLengthPlugin(this.config));

clients/client-s3/src/commands/AbortMultipartUploadCommand.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
// smithy-typescript generated code
22
import { getThrow200ExceptionsPlugin } from "@aws-sdk/middleware-sdk-s3";
33
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
4-
import { getSerdePlugin } from "@smithy/middleware-serde";
54
import { Command as $Command } from "@smithy/smithy-client";
65
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
76

87
import { commonParams } from "../endpoint/EndpointParameters";
98
import { AbortMultipartUploadOutput, AbortMultipartUploadRequest } from "../models/models_0";
10-
import { de_AbortMultipartUploadCommand, se_AbortMultipartUploadCommand } from "../protocols/Aws_restXml";
119
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
10+
import { AbortMultipartUpload } from "../schemas/schemas";
1211

1312
/**
1413
* @public
@@ -178,17 +177,12 @@ export class AbortMultipartUploadCommand extends $Command
178177
Key: { type: "contextParams", name: "Key" },
179178
})
180179
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {
181-
return [
182-
getSerdePlugin(config, this.serialize, this.deserialize),
183-
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
184-
getThrow200ExceptionsPlugin(config),
185-
];
180+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config)];
186181
})
187182
.s("AmazonS3", "AbortMultipartUpload", {})
188183
.n("S3Client", "AbortMultipartUploadCommand")
189-
.f(void 0, void 0)
190-
.ser(se_AbortMultipartUploadCommand)
191-
.de(de_AbortMultipartUploadCommand)
184+
185+
.sc(AbortMultipartUpload)
192186
.build() {
193187
/** @internal type navigation helper, not in runtime. */
194188
protected declare static __types: {

clients/client-s3/src/commands/CompleteMultipartUploadCommand.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22
import { getThrow200ExceptionsPlugin } from "@aws-sdk/middleware-sdk-s3";
33
import { getSsecPlugin } from "@aws-sdk/middleware-ssec";
44
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
5-
import { getSerdePlugin } from "@smithy/middleware-serde";
65
import { Command as $Command } from "@smithy/smithy-client";
76
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
87

98
import { commonParams } from "../endpoint/EndpointParameters";
10-
import {
11-
CompleteMultipartUploadOutput,
12-
CompleteMultipartUploadOutputFilterSensitiveLog,
13-
CompleteMultipartUploadRequest,
14-
CompleteMultipartUploadRequestFilterSensitiveLog,
15-
} from "../models/models_0";
16-
import { de_CompleteMultipartUploadCommand, se_CompleteMultipartUploadCommand } from "../protocols/Aws_restXml";
9+
import { CompleteMultipartUploadOutput, CompleteMultipartUploadRequest } from "../models/models_0";
1710
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
11+
import { CompleteMultipartUpload } from "../schemas/schemas";
1812

1913
/**
2014
* @public
@@ -314,17 +308,15 @@ export class CompleteMultipartUploadCommand extends $Command
314308
})
315309
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {
316310
return [
317-
getSerdePlugin(config, this.serialize, this.deserialize),
318311
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
319312
getThrow200ExceptionsPlugin(config),
320313
getSsecPlugin(config),
321314
];
322315
})
323316
.s("AmazonS3", "CompleteMultipartUpload", {})
324317
.n("S3Client", "CompleteMultipartUploadCommand")
325-
.f(CompleteMultipartUploadRequestFilterSensitiveLog, CompleteMultipartUploadOutputFilterSensitiveLog)
326-
.ser(se_CompleteMultipartUploadCommand)
327-
.de(de_CompleteMultipartUploadCommand)
318+
319+
.sc(CompleteMultipartUpload)
328320
.build() {
329321
/** @internal type navigation helper, not in runtime. */
330322
protected declare static __types: {

clients/client-s3/src/commands/CopyObjectCommand.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22
import { getThrow200ExceptionsPlugin } from "@aws-sdk/middleware-sdk-s3";
33
import { getSsecPlugin } from "@aws-sdk/middleware-ssec";
44
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
5-
import { getSerdePlugin } from "@smithy/middleware-serde";
65
import { Command as $Command } from "@smithy/smithy-client";
76
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
87

98
import { commonParams } from "../endpoint/EndpointParameters";
10-
import {
11-
CopyObjectOutput,
12-
CopyObjectOutputFilterSensitiveLog,
13-
CopyObjectRequest,
14-
CopyObjectRequestFilterSensitiveLog,
15-
} from "../models/models_0";
16-
import { de_CopyObjectCommand, se_CopyObjectCommand } from "../protocols/Aws_restXml";
9+
import { CopyObjectOutput, CopyObjectRequest } from "../models/models_0";
1710
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
11+
import { CopyObject } from "../schemas/schemas";
1812

1913
/**
2014
* @public
@@ -367,17 +361,15 @@ export class CopyObjectCommand extends $Command
367361
})
368362
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {
369363
return [
370-
getSerdePlugin(config, this.serialize, this.deserialize),
371364
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
372365
getThrow200ExceptionsPlugin(config),
373366
getSsecPlugin(config),
374367
];
375368
})
376369
.s("AmazonS3", "CopyObject", {})
377370
.n("S3Client", "CopyObjectCommand")
378-
.f(CopyObjectRequestFilterSensitiveLog, CopyObjectOutputFilterSensitiveLog)
379-
.ser(se_CopyObjectCommand)
380-
.de(de_CopyObjectCommand)
371+
372+
.sc(CopyObject)
381373
.build() {
382374
/** @internal type navigation helper, not in runtime. */
383375
protected declare static __types: {

clients/client-s3/src/commands/CreateBucketCommand.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
import { getLocationConstraintPlugin } from "@aws-sdk/middleware-location-constraint";
33
import { getThrow200ExceptionsPlugin } from "@aws-sdk/middleware-sdk-s3";
44
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
5-
import { getSerdePlugin } from "@smithy/middleware-serde";
65
import { Command as $Command } from "@smithy/smithy-client";
76
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
87

98
import { commonParams } from "../endpoint/EndpointParameters";
109
import { CreateBucketOutput, CreateBucketRequest } from "../models/models_0";
11-
import { de_CreateBucketCommand, se_CreateBucketCommand } from "../protocols/Aws_restXml";
1210
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
11+
import { CreateBucket } from "../schemas/schemas";
1312

1413
/**
1514
* @public
@@ -296,17 +295,15 @@ export class CreateBucketCommand extends $Command
296295
})
297296
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {
298297
return [
299-
getSerdePlugin(config, this.serialize, this.deserialize),
300298
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
301299
getThrow200ExceptionsPlugin(config),
302300
getLocationConstraintPlugin(config),
303301
];
304302
})
305303
.s("AmazonS3", "CreateBucket", {})
306304
.n("S3Client", "CreateBucketCommand")
307-
.f(void 0, void 0)
308-
.ser(se_CreateBucketCommand)
309-
.de(de_CreateBucketCommand)
305+
306+
.sc(CreateBucket)
310307
.build() {
311308
/** @internal type navigation helper, not in runtime. */
312309
protected declare static __types: {

clients/client-s3/src/commands/CreateBucketMetadataConfigurationCommand.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
// smithy-typescript generated code
22
import { getFlexibleChecksumsPlugin } from "@aws-sdk/middleware-flexible-checksums";
33
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
4-
import { getSerdePlugin } from "@smithy/middleware-serde";
54
import { Command as $Command } from "@smithy/smithy-client";
65
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
76

87
import { commonParams } from "../endpoint/EndpointParameters";
98
import { CreateBucketMetadataConfigurationRequest } from "../models/models_0";
10-
import {
11-
de_CreateBucketMetadataConfigurationCommand,
12-
se_CreateBucketMetadataConfigurationCommand,
13-
} from "../protocols/Aws_restXml";
149
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
10+
import { CreateBucketMetadataConfiguration } from "../schemas/schemas";
1511

1612
/**
1713
* @public
@@ -187,7 +183,6 @@ export class CreateBucketMetadataConfigurationCommand extends $Command
187183
})
188184
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {
189185
return [
190-
getSerdePlugin(config, this.serialize, this.deserialize),
191186
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
192187
getFlexibleChecksumsPlugin(config, {
193188
requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
@@ -197,9 +192,8 @@ export class CreateBucketMetadataConfigurationCommand extends $Command
197192
})
198193
.s("AmazonS3", "CreateBucketMetadataConfiguration", {})
199194
.n("S3Client", "CreateBucketMetadataConfigurationCommand")
200-
.f(void 0, void 0)
201-
.ser(se_CreateBucketMetadataConfigurationCommand)
202-
.de(de_CreateBucketMetadataConfigurationCommand)
195+
196+
.sc(CreateBucketMetadataConfiguration)
203197
.build() {
204198
/** @internal type navigation helper, not in runtime. */
205199
protected declare static __types: {

clients/client-s3/src/commands/CreateBucketMetadataTableConfigurationCommand.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
// smithy-typescript generated code
22
import { getFlexibleChecksumsPlugin } from "@aws-sdk/middleware-flexible-checksums";
33
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
4-
import { getSerdePlugin } from "@smithy/middleware-serde";
54
import { Command as $Command } from "@smithy/smithy-client";
65
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
76

87
import { commonParams } from "../endpoint/EndpointParameters";
98
import { CreateBucketMetadataTableConfigurationRequest } from "../models/models_0";
10-
import {
11-
de_CreateBucketMetadataTableConfigurationCommand,
12-
se_CreateBucketMetadataTableConfigurationCommand,
13-
} from "../protocols/Aws_restXml";
149
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
10+
import { CreateBucketMetadataTableConfiguration } from "../schemas/schemas";
1511

1612
/**
1713
* @public
@@ -154,7 +150,6 @@ export class CreateBucketMetadataTableConfigurationCommand extends $Command
154150
})
155151
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {
156152
return [
157-
getSerdePlugin(config, this.serialize, this.deserialize),
158153
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
159154
getFlexibleChecksumsPlugin(config, {
160155
requestAlgorithmMember: { httpHeader: "x-amz-sdk-checksum-algorithm", name: "ChecksumAlgorithm" },
@@ -164,9 +159,8 @@ export class CreateBucketMetadataTableConfigurationCommand extends $Command
164159
})
165160
.s("AmazonS3", "CreateBucketMetadataTableConfiguration", {})
166161
.n("S3Client", "CreateBucketMetadataTableConfigurationCommand")
167-
.f(void 0, void 0)
168-
.ser(se_CreateBucketMetadataTableConfigurationCommand)
169-
.de(de_CreateBucketMetadataTableConfigurationCommand)
162+
163+
.sc(CreateBucketMetadataTableConfiguration)
170164
.build() {
171165
/** @internal type navigation helper, not in runtime. */
172166
protected declare static __types: {

clients/client-s3/src/commands/CreateMultipartUploadCommand.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22
import { getThrow200ExceptionsPlugin } from "@aws-sdk/middleware-sdk-s3";
33
import { getSsecPlugin } from "@aws-sdk/middleware-ssec";
44
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
5-
import { getSerdePlugin } from "@smithy/middleware-serde";
65
import { Command as $Command } from "@smithy/smithy-client";
76
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
87

98
import { commonParams } from "../endpoint/EndpointParameters";
10-
import {
11-
CreateMultipartUploadOutput,
12-
CreateMultipartUploadOutputFilterSensitiveLog,
13-
CreateMultipartUploadRequest,
14-
CreateMultipartUploadRequestFilterSensitiveLog,
15-
} from "../models/models_0";
16-
import { de_CreateMultipartUploadCommand, se_CreateMultipartUploadCommand } from "../protocols/Aws_restXml";
9+
import { CreateMultipartUploadOutput, CreateMultipartUploadRequest } from "../models/models_0";
1710
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
11+
import { CreateMultipartUpload } from "../schemas/schemas";
1812

1913
/**
2014
* @public
@@ -392,17 +386,15 @@ export class CreateMultipartUploadCommand extends $Command
392386
})
393387
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {
394388
return [
395-
getSerdePlugin(config, this.serialize, this.deserialize),
396389
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
397390
getThrow200ExceptionsPlugin(config),
398391
getSsecPlugin(config),
399392
];
400393
})
401394
.s("AmazonS3", "CreateMultipartUpload", {})
402395
.n("S3Client", "CreateMultipartUploadCommand")
403-
.f(CreateMultipartUploadRequestFilterSensitiveLog, CreateMultipartUploadOutputFilterSensitiveLog)
404-
.ser(se_CreateMultipartUploadCommand)
405-
.de(de_CreateMultipartUploadCommand)
396+
397+
.sc(CreateMultipartUpload)
406398
.build() {
407399
/** @internal type navigation helper, not in runtime. */
408400
protected declare static __types: {

clients/client-s3/src/commands/CreateSessionCommand.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
// smithy-typescript generated code
22
import { getThrow200ExceptionsPlugin } from "@aws-sdk/middleware-sdk-s3";
33
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
4-
import { getSerdePlugin } from "@smithy/middleware-serde";
54
import { Command as $Command } from "@smithy/smithy-client";
65
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
76

87
import { commonParams } from "../endpoint/EndpointParameters";
9-
import {
10-
CreateSessionOutput,
11-
CreateSessionOutputFilterSensitiveLog,
12-
CreateSessionRequest,
13-
CreateSessionRequestFilterSensitiveLog,
14-
} from "../models/models_0";
15-
import { de_CreateSessionCommand, se_CreateSessionCommand } from "../protocols/Aws_restXml";
8+
import { CreateSessionOutput, CreateSessionRequest } from "../models/models_0";
169
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
10+
import { CreateSession } from "../schemas/schemas";
1711

1812
/**
1913
* @public
@@ -198,17 +192,12 @@ export class CreateSessionCommand extends $Command
198192
Bucket: { type: "contextParams", name: "Bucket" },
199193
})
200194
.m(function (this: any, Command: any, cs: any, config: S3ClientResolvedConfig, o: any) {
201-
return [
202-
getSerdePlugin(config, this.serialize, this.deserialize),
203-
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
204-
getThrow200ExceptionsPlugin(config),
205-
];
195+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getThrow200ExceptionsPlugin(config)];
206196
})
207197
.s("AmazonS3", "CreateSession", {})
208198
.n("S3Client", "CreateSessionCommand")
209-
.f(CreateSessionRequestFilterSensitiveLog, CreateSessionOutputFilterSensitiveLog)
210-
.ser(se_CreateSessionCommand)
211-
.de(de_CreateSessionCommand)
199+
200+
.sc(CreateSession)
212201
.build() {
213202
/** @internal type navigation helper, not in runtime. */
214203
protected declare static __types: {

0 commit comments

Comments
 (0)