Skip to content

Commit ac9f3d2

Browse files
author
awstools
committedJul 2, 2024
feat(client-s3): Added response overrides to Head Object requests.
1 parent bc48cce commit ac9f3d2

13 files changed

+340
-245
lines changed
 

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ export interface CopyObjectCommandOutput extends CopyObjectOutput, __MetadataBea
129129
* </dd>
130130
* <dt>Response and special errors</dt>
131131
* <dd>
132-
* <p>When the request is an HTTP 1.1 request, the response is chunk encoded.
133-
* When the request is not an HTTP 1.1 request, the response would not contain the <code>Content-Length</code>.
134-
* You always need to read the entire response body to check if the copy succeeds.
135-
* to keep the connection alive while we copy the data. </p>
132+
* <p>When the request is an HTTP 1.1 request, the response is chunk encoded. When
133+
* the request is not an HTTP 1.1 request, the response would not contain the
134+
* <code>Content-Length</code>. You always need to read the entire response body
135+
* to check if the copy succeeds. </p>
136136
* <ul>
137137
* <li>
138138
* <p>If the copy is successful, you receive a response with information about the copied

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

+13-13
Original file line numberDiff line numberDiff line change
@@ -218,39 +218,39 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
218218
* <p>Base exception class for all service exceptions from S3 service.</p>
219219
*
220220
* @public
221-
* @example To create a bucket
221+
* @example To create a bucket in a specific region
222222
* ```javascript
223-
* // The following example creates a bucket.
223+
* // The following example creates a bucket. The request specifies an AWS region where to create the bucket.
224224
* const input = {
225-
* "Bucket": "examplebucket"
225+
* "Bucket": "examplebucket",
226+
* "CreateBucketConfiguration": {
227+
* "LocationConstraint": "eu-west-1"
228+
* }
226229
* };
227230
* const command = new CreateBucketCommand(input);
228231
* const response = await client.send(command);
229232
* /* response ==
230233
* {
231-
* "Location": "/examplebucket"
234+
* "Location": "http://examplebucket.<Region>.s3.amazonaws.com/"
232235
* }
233236
* *\/
234-
* // example id: to-create-a-bucket--1472851826060
237+
* // example id: to-create-a-bucket-in-a-specific-region-1483399072992
235238
* ```
236239
*
237-
* @example To create a bucket in a specific region
240+
* @example To create a bucket
238241
* ```javascript
239-
* // The following example creates a bucket. The request specifies an AWS region where to create the bucket.
242+
* // The following example creates a bucket.
240243
* const input = {
241-
* "Bucket": "examplebucket",
242-
* "CreateBucketConfiguration": {
243-
* "LocationConstraint": "eu-west-1"
244-
* }
244+
* "Bucket": "examplebucket"
245245
* };
246246
* const command = new CreateBucketCommand(input);
247247
* const response = await client.send(command);
248248
* /* response ==
249249
* {
250-
* "Location": "http://examplebucket.<Region>.s3.amazonaws.com/"
250+
* "Location": "/examplebucket"
251251
* }
252252
* *\/
253-
* // example id: to-create-a-bucket-in-a-specific-region-1483399072992
253+
* // example id: to-create-a-bucket--1472851826060
254254
* ```
255255
*
256256
*/

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -162,28 +162,28 @@ export interface DeleteObjectCommandOutput extends DeleteObjectOutput, __Metadat
162162
* <p>Base exception class for all service exceptions from S3 service.</p>
163163
*
164164
* @public
165-
* @example To delete an object (from a non-versioned bucket)
165+
* @example To delete an object
166166
* ```javascript
167-
* // The following example deletes an object from a non-versioned bucket.
167+
* // The following example deletes an object from an S3 bucket.
168168
* const input = {
169-
* "Bucket": "ExampleBucket",
170-
* "Key": "HappyFace.jpg"
169+
* "Bucket": "examplebucket",
170+
* "Key": "objectkey.jpg"
171171
* };
172172
* const command = new DeleteObjectCommand(input);
173173
* await client.send(command);
174-
* // example id: to-delete-an-object-from-a-non-versioned-bucket-1481588533089
174+
* // example id: to-delete-an-object-1472850136595
175175
* ```
176176
*
177-
* @example To delete an object
177+
* @example To delete an object (from a non-versioned bucket)
178178
* ```javascript
179-
* // The following example deletes an object from an S3 bucket.
179+
* // The following example deletes an object from a non-versioned bucket.
180180
* const input = {
181-
* "Bucket": "examplebucket",
182-
* "Key": "objectkey.jpg"
181+
* "Bucket": "ExampleBucket",
182+
* "Key": "HappyFace.jpg"
183183
* };
184184
* const command = new DeleteObjectCommand(input);
185185
* await client.send(command);
186-
* // example id: to-delete-an-object-1472850136595
186+
* // example id: to-delete-an-object-from-a-non-versioned-bucket-1481588533089
187187
* ```
188188
*
189189
*/

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

+11-11
Original file line numberDiff line numberDiff line change
@@ -81,39 +81,39 @@ export interface DeleteObjectTaggingCommandOutput extends DeleteObjectTaggingOut
8181
* <p>Base exception class for all service exceptions from S3 service.</p>
8282
*
8383
* @public
84-
* @example To remove tag set from an object version
84+
* @example To remove tag set from an object
8585
* ```javascript
86-
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
86+
* // 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.
8787
* const input = {
8888
* "Bucket": "examplebucket",
89-
* "Key": "HappyFace.jpg",
90-
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
89+
* "Key": "HappyFace.jpg"
9190
* };
9291
* const command = new DeleteObjectTaggingCommand(input);
9392
* const response = await client.send(command);
9493
* /* response ==
9594
* {
96-
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
95+
* "VersionId": "null"
9796
* }
9897
* *\/
99-
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
98+
* // example id: to-remove-tag-set-from-an-object-1483145342862
10099
* ```
101100
*
102-
* @example To remove tag set from an object
101+
* @example To remove tag set from an object version
103102
* ```javascript
104-
* // 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.
103+
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
105104
* const input = {
106105
* "Bucket": "examplebucket",
107-
* "Key": "HappyFace.jpg"
106+
* "Key": "HappyFace.jpg",
107+
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
108108
* };
109109
* const command = new DeleteObjectTaggingCommand(input);
110110
* const response = await client.send(command);
111111
* /* response ==
112112
* {
113-
* "VersionId": "null"
113+
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
114114
* }
115115
* *\/
116-
* // example id: to-remove-tag-set-from-an-object-1483145342862
116+
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
117117
* ```
118118
*
119119
*/

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad
8888
* <p>
8989
* <b>
9090
* <code>s3:DeleteObjectVersion</code>
91-
* </b> - To delete a specific version of an object from a versiong-enabled bucket, you must specify the <code>s3:DeleteObjectVersion</code> permission.</p>
91+
* </b> - To delete a specific version of an object from a versioning-enabled bucket, you must specify the <code>s3:DeleteObjectVersion</code> permission.</p>
9292
* </li>
9393
* </ul>
9494
* </li>

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

+19-19
Original file line numberDiff line numberDiff line change
@@ -286,53 +286,53 @@ export interface GetObjectCommandOutput extends Omit<GetObjectOutput, "Body">, _
286286
* <p>Base exception class for all service exceptions from S3 service.</p>
287287
*
288288
* @public
289-
* @example To retrieve a byte range of an object
289+
* @example To retrieve an object
290290
* ```javascript
291-
* // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.
291+
* // The following example retrieves an object for an S3 bucket.
292292
* const input = {
293293
* "Bucket": "examplebucket",
294-
* "Key": "SampleFile.txt",
295-
* "Range": "bytes=0-9"
294+
* "Key": "HappyFace.jpg"
296295
* };
297296
* const command = new GetObjectCommand(input);
298297
* const response = await client.send(command);
299298
* /* response ==
300299
* {
301300
* "AcceptRanges": "bytes",
302-
* "ContentLength": "10",
303-
* "ContentRange": "bytes 0-9/43",
304-
* "ContentType": "text/plain",
305-
* "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
306-
* "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT",
301+
* "ContentLength": "3191",
302+
* "ContentType": "image/jpeg",
303+
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
304+
* "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT",
307305
* "Metadata": {},
306+
* "TagCount": 2,
308307
* "VersionId": "null"
309308
* }
310309
* *\/
311-
* // example id: to-retrieve-a-byte-range-of-an-object--1481832674603
310+
* // example id: to-retrieve-an-object-1481827837012
312311
* ```
313312
*
314-
* @example To retrieve an object
313+
* @example To retrieve a byte range of an object
315314
* ```javascript
316-
* // The following example retrieves an object for an S3 bucket.
315+
* // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.
317316
* const input = {
318317
* "Bucket": "examplebucket",
319-
* "Key": "HappyFace.jpg"
318+
* "Key": "SampleFile.txt",
319+
* "Range": "bytes=0-9"
320320
* };
321321
* const command = new GetObjectCommand(input);
322322
* const response = await client.send(command);
323323
* /* response ==
324324
* {
325325
* "AcceptRanges": "bytes",
326-
* "ContentLength": "3191",
327-
* "ContentType": "image/jpeg",
328-
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
329-
* "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT",
326+
* "ContentLength": "10",
327+
* "ContentRange": "bytes 0-9/43",
328+
* "ContentType": "text/plain",
329+
* "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
330+
* "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT",
330331
* "Metadata": {},
331-
* "TagCount": 2,
332332
* "VersionId": "null"
333333
* }
334334
* *\/
335-
* // example id: to-retrieve-an-object-1481827837012
335+
* // example id: to-retrieve-a-byte-range-of-an-object--1481832674603
336336
* ```
337337
*
338338
*/

‎clients/client-s3/src/commands/GetObjectTaggingCommand.ts

+19-19
Original file line numberDiff line numberDiff line change
@@ -97,55 +97,55 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _
9797
* <p>Base exception class for all service exceptions from S3 service.</p>
9898
*
9999
* @public
100-
* @example To retrieve tag set of an object
100+
* @example To retrieve tag set of a specific object version
101101
* ```javascript
102-
* // The following example retrieves tag set of an object.
102+
* // The following example retrieves tag set of an object. The request specifies object version.
103103
* const input = {
104104
* "Bucket": "examplebucket",
105-
* "Key": "HappyFace.jpg"
105+
* "Key": "exampleobject",
106+
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
106107
* };
107108
* const command = new GetObjectTaggingCommand(input);
108109
* const response = await client.send(command);
109110
* /* response ==
110111
* {
111112
* "TagSet": [
112113
* {
113-
* "Key": "Key4",
114-
* "Value": "Value4"
115-
* },
116-
* {
117-
* "Key": "Key3",
118-
* "Value": "Value3"
114+
* "Key": "Key1",
115+
* "Value": "Value1"
119116
* }
120117
* ],
121-
* "VersionId": "null"
118+
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
122119
* }
123120
* *\/
124-
* // example id: to-retrieve-tag-set-of-an-object-1481833847896
121+
* // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663
125122
* ```
126123
*
127-
* @example To retrieve tag set of a specific object version
124+
* @example To retrieve tag set of an object
128125
* ```javascript
129-
* // The following example retrieves tag set of an object. The request specifies object version.
126+
* // The following example retrieves tag set of an object.
130127
* const input = {
131128
* "Bucket": "examplebucket",
132-
* "Key": "exampleobject",
133-
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
129+
* "Key": "HappyFace.jpg"
134130
* };
135131
* const command = new GetObjectTaggingCommand(input);
136132
* const response = await client.send(command);
137133
* /* response ==
138134
* {
139135
* "TagSet": [
140136
* {
141-
* "Key": "Key1",
142-
* "Value": "Value1"
137+
* "Key": "Key4",
138+
* "Value": "Value4"
139+
* },
140+
* {
141+
* "Key": "Key3",
142+
* "Value": "Value3"
143143
* }
144144
* ],
145-
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
145+
* "VersionId": "null"
146146
* }
147147
* *\/
148-
* // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663
148+
* // example id: to-retrieve-tag-set-of-an-object-1481833847896
149149
* ```
150150
*
151151
*/

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

+6
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ export interface HeadObjectCommandOutput extends HeadObjectOutput, __MetadataBea
184184
* IfUnmodifiedSince: new Date("TIMESTAMP"),
185185
* Key: "STRING_VALUE", // required
186186
* Range: "STRING_VALUE",
187+
* ResponseCacheControl: "STRING_VALUE",
188+
* ResponseContentDisposition: "STRING_VALUE",
189+
* ResponseContentEncoding: "STRING_VALUE",
190+
* ResponseContentLanguage: "STRING_VALUE",
191+
* ResponseContentType: "STRING_VALUE",
192+
* ResponseExpires: new Date("TIMESTAMP"),
187193
* VersionId: "STRING_VALUE",
188194
* SSECustomerAlgorithm: "STRING_VALUE",
189195
* SSECustomerKey: "STRING_VALUE",

0 commit comments

Comments
 (0)
Please sign in to comment.