Skip to content

Commit ba36517

Browse files
author
awstools
committed
feat(client-s3): Adding new params - Key and Prefix, to S3 API operations for supporting S3 Access Grants. Note - These updates will not change any of the existing S3 API functionality.
1 parent 648c9e7 commit ba36517

23 files changed

+342
-199
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export class AbortMultipartUploadCommand extends $Command<
131131
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
132132
return {
133133
Bucket: { type: "contextParams", name: "Bucket" },
134+
Key: { type: "contextParams", name: "Key" },
134135
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
135136
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
136137
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export class CompleteMultipartUploadCommand extends $Command<
267267
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
268268
return {
269269
Bucket: { type: "contextParams", name: "Bucket" },
270+
Key: { type: "contextParams", name: "Key" },
270271
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
271272
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
272273
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -196,39 +196,39 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
196196
* @throws {@link S3ServiceException}
197197
* <p>Base exception class for all service exceptions from S3 service.</p>
198198
*
199-
* @example To create a bucket in a specific region
199+
* @example To create a bucket
200200
* ```javascript
201-
* // The following example creates a bucket. The request specifies an AWS region where to create the bucket.
201+
* // The following example creates a bucket.
202202
* const input = {
203-
* "Bucket": "examplebucket",
204-
* "CreateBucketConfiguration": {
205-
* "LocationConstraint": "eu-west-1"
206-
* }
203+
* "Bucket": "examplebucket"
207204
* };
208205
* const command = new CreateBucketCommand(input);
209206
* const response = await client.send(command);
210207
* /* response ==
211208
* {
212-
* "Location": "http://examplebucket.<Region>.s3.amazonaws.com/"
209+
* "Location": "/examplebucket"
213210
* }
214211
* *\/
215-
* // example id: to-create-a-bucket-in-a-specific-region-1483399072992
212+
* // example id: to-create-a-bucket--1472851826060
216213
* ```
217214
*
218-
* @example To create a bucket
215+
* @example To create a bucket in a specific region
219216
* ```javascript
220-
* // The following example creates a bucket.
217+
* // The following example creates a bucket. The request specifies an AWS region where to create the bucket.
221218
* const input = {
222-
* "Bucket": "examplebucket"
219+
* "Bucket": "examplebucket",
220+
* "CreateBucketConfiguration": {
221+
* "LocationConstraint": "eu-west-1"
222+
* }
223223
* };
224224
* const command = new CreateBucketCommand(input);
225225
* const response = await client.send(command);
226226
* /* response ==
227227
* {
228-
* "Location": "/examplebucket"
228+
* "Location": "http://examplebucket.<Region>.s3.amazonaws.com/"
229229
* }
230230
* *\/
231-
* // example id: to-create-a-bucket--1472851826060
231+
* // example id: to-create-a-bucket-in-a-specific-region-1483399072992
232232
* ```
233233
*
234234
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ export class CreateMultipartUploadCommand extends $Command<
435435
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
436436
return {
437437
Bucket: { type: "contextParams", name: "Bucket" },
438+
Key: { type: "contextParams", name: "Key" },
438439
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
439440
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
440441
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export class DeleteObjectCommand extends $Command<
130130
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
131131
return {
132132
Bucket: { type: "contextParams", name: "Bucket" },
133+
Key: { type: "contextParams", name: "Key" },
133134
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
134135
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
135136
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,39 +86,39 @@ export interface DeleteObjectTaggingCommandOutput extends DeleteObjectTaggingOut
8686
* @throws {@link S3ServiceException}
8787
* <p>Base exception class for all service exceptions from S3 service.</p>
8888
*
89-
* @example To remove tag set from an object
89+
* @example To remove tag set from an object version
9090
* ```javascript
91-
* // 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.
91+
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
9292
* const input = {
9393
* "Bucket": "examplebucket",
94-
* "Key": "HappyFace.jpg"
94+
* "Key": "HappyFace.jpg",
95+
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
9596
* };
9697
* const command = new DeleteObjectTaggingCommand(input);
9798
* const response = await client.send(command);
9899
* /* response ==
99100
* {
100-
* "VersionId": "null"
101+
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
101102
* }
102103
* *\/
103-
* // example id: to-remove-tag-set-from-an-object-1483145342862
104+
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
104105
* ```
105106
*
106-
* @example To remove tag set from an object version
107+
* @example To remove tag set from an object
107108
* ```javascript
108-
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
109+
* // 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.
109110
* const input = {
110111
* "Bucket": "examplebucket",
111-
* "Key": "HappyFace.jpg",
112-
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
112+
* "Key": "HappyFace.jpg"
113113
* };
114114
* const command = new DeleteObjectTaggingCommand(input);
115115
* const response = await client.send(command);
116116
* /* response ==
117117
* {
118-
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
118+
* "VersionId": "null"
119119
* }
120120
* *\/
121-
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
121+
* // example id: to-remove-tag-set-from-an-object-1483145342862
122122
* ```
123123
*
124124
*/

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,18 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad
146146
* @throws {@link S3ServiceException}
147147
* <p>Base exception class for all service exceptions from S3 service.</p>
148148
*
149-
* @example To delete multiple object versions from a versioned bucket
149+
* @example To delete multiple objects from a versioned bucket
150150
* ```javascript
151-
* // 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.
151+
* // 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.
152152
* const input = {
153153
* "Bucket": "examplebucket",
154154
* "Delete": {
155155
* "Objects": [
156156
* {
157-
* "Key": "HappyFace.jpg",
158-
* "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
157+
* "Key": "objectkey1"
159158
* },
160159
* {
161-
* "Key": "HappyFace.jpg",
162-
* "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
160+
* "Key": "objectkey2"
163161
* }
164162
* ],
165163
* "Quiet": false
@@ -171,31 +169,35 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad
171169
* {
172170
* "Deleted": [
173171
* {
174-
* "Key": "HappyFace.jpg",
175-
* "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
172+
* "DeleteMarker": "true",
173+
* "DeleteMarkerVersionId": "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F",
174+
* "Key": "objectkey1"
176175
* },
177176
* {
178-
* "Key": "HappyFace.jpg",
179-
* "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
177+
* "DeleteMarker": "true",
178+
* "DeleteMarkerVersionId": "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt",
179+
* "Key": "objectkey2"
180180
* }
181181
* ]
182182
* }
183183
* *\/
184-
* // example id: to-delete-multiple-object-versions-from-a-versioned-bucket-1483147087737
184+
* // example id: to-delete-multiple-objects-from-a-versioned-bucket-1483146248805
185185
* ```
186186
*
187-
* @example To delete multiple objects from a versioned bucket
187+
* @example To delete multiple object versions from a versioned bucket
188188
* ```javascript
189-
* // 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.
189+
* // 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.
190190
* const input = {
191191
* "Bucket": "examplebucket",
192192
* "Delete": {
193193
* "Objects": [
194194
* {
195-
* "Key": "objectkey1"
195+
* "Key": "HappyFace.jpg",
196+
* "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
196197
* },
197198
* {
198-
* "Key": "objectkey2"
199+
* "Key": "HappyFace.jpg",
200+
* "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
199201
* }
200202
* ],
201203
* "Quiet": false
@@ -207,19 +209,17 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad
207209
* {
208210
* "Deleted": [
209211
* {
210-
* "DeleteMarker": "true",
211-
* "DeleteMarkerVersionId": "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F",
212-
* "Key": "objectkey1"
212+
* "Key": "HappyFace.jpg",
213+
* "VersionId": "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
213214
* },
214215
* {
215-
* "DeleteMarker": "true",
216-
* "DeleteMarkerVersionId": "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt",
217-
* "Key": "objectkey2"
216+
* "Key": "HappyFace.jpg",
217+
* "VersionId": "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
218218
* }
219219
* ]
220220
* }
221221
* *\/
222-
* // example id: to-delete-multiple-objects-from-a-versioned-bucket-1483146248805
222+
* // example id: to-delete-multiple-object-versions-from-a-versioned-bucket-1483147087737
223223
* ```
224224
*
225225
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export class GetObjectAclCommand extends $Command<
188188
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
189189
return {
190190
Bucket: { type: "contextParams", name: "Bucket" },
191+
Key: { type: "contextParams", name: "Key" },
191192
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
192193
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
193194
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },

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

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -312,60 +312,61 @@ export interface GetObjectCommandOutput extends Omit<GetObjectOutput, "Body">, _
312312
* @throws {@link S3ServiceException}
313313
* <p>Base exception class for all service exceptions from S3 service.</p>
314314
*
315-
* @example To retrieve an object
315+
* @example To retrieve a byte range of an object
316316
* ```javascript
317-
* // The following example retrieves an object for an S3 bucket.
317+
* // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.
318318
* const input = {
319319
* "Bucket": "examplebucket",
320-
* "Key": "HappyFace.jpg"
320+
* "Key": "SampleFile.txt",
321+
* "Range": "bytes=0-9"
321322
* };
322323
* const command = new GetObjectCommand(input);
323324
* const response = await client.send(command);
324325
* /* response ==
325326
* {
326327
* "AcceptRanges": "bytes",
327-
* "ContentLength": "3191",
328-
* "ContentType": "image/jpeg",
329-
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
330-
* "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT",
328+
* "ContentLength": "10",
329+
* "ContentRange": "bytes 0-9/43",
330+
* "ContentType": "text/plain",
331+
* "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
332+
* "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT",
331333
* "Metadata": {},
332-
* "TagCount": 2,
333334
* "VersionId": "null"
334335
* }
335336
* *\/
336-
* // example id: to-retrieve-an-object-1481827837012
337+
* // example id: to-retrieve-a-byte-range-of-an-object--1481832674603
337338
* ```
338339
*
339-
* @example To retrieve a byte range of an object
340+
* @example To retrieve an object
340341
* ```javascript
341-
* // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.
342+
* // The following example retrieves an object for an S3 bucket.
342343
* const input = {
343344
* "Bucket": "examplebucket",
344-
* "Key": "SampleFile.txt",
345-
* "Range": "bytes=0-9"
345+
* "Key": "HappyFace.jpg"
346346
* };
347347
* const command = new GetObjectCommand(input);
348348
* const response = await client.send(command);
349349
* /* response ==
350350
* {
351351
* "AcceptRanges": "bytes",
352-
* "ContentLength": "10",
353-
* "ContentRange": "bytes 0-9/43",
354-
* "ContentType": "text/plain",
355-
* "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
356-
* "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT",
352+
* "ContentLength": "3191",
353+
* "ContentType": "image/jpeg",
354+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
355+
* "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT",
357356
* "Metadata": {},
357+
* "TagCount": 2,
358358
* "VersionId": "null"
359359
* }
360360
* *\/
361-
* // example id: to-retrieve-a-byte-range-of-an-object--1481832674603
361+
* // example id: to-retrieve-an-object-1481827837012
362362
* ```
363363
*
364364
*/
365365
export class GetObjectCommand extends $Command<GetObjectCommandInput, GetObjectCommandOutput, S3ClientResolvedConfig> {
366366
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
367367
return {
368368
Bucket: { type: "contextParams", name: "Bucket" },
369+
Key: { type: "contextParams", name: "Key" },
369370
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
370371
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
371372
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ export class HeadObjectCommand extends $Command<
284284
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
285285
return {
286286
Bucket: { type: "contextParams", name: "Bucket" },
287+
Key: { type: "contextParams", name: "Key" },
287288
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
288289
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
289290
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },

0 commit comments

Comments
 (0)