Skip to content

Commit

Permalink
feat(client-s3): Added response overrides to Head Object requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Jul 2, 2024
1 parent bc48cce commit ac9f3d2
Show file tree
Hide file tree
Showing 13 changed files with 340 additions and 245 deletions.
8 changes: 4 additions & 4 deletions clients/client-s3/src/commands/CopyObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ export interface CopyObjectCommandOutput extends CopyObjectOutput, __MetadataBea
* </dd>
* <dt>Response and special errors</dt>
* <dd>
* <p>When the request is an HTTP 1.1 request, the response is chunk encoded.
* When the request is not an HTTP 1.1 request, the response would not contain the <code>Content-Length</code>.
* You always need to read the entire response body to check if the copy succeeds.
* to keep the connection alive while we copy the data. </p>
* <p>When the request is an HTTP 1.1 request, the response is chunk encoded. When
* the request is not an HTTP 1.1 request, the response would not contain the
* <code>Content-Length</code>. You always need to read the entire response body
* to check if the copy succeeds. </p>
* <ul>
* <li>
* <p>If the copy is successful, you receive a response with information about the copied
Expand Down
26 changes: 13 additions & 13 deletions clients/client-s3/src/commands/CreateBucketCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,39 +218,39 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @public
* @example To create a bucket
* @example To create a bucket in a specific region
* ```javascript
* // The following example creates a bucket.
* // The following example creates a bucket. The request specifies an AWS region where to create the bucket.
* const input = {
* "Bucket": "examplebucket"
* "Bucket": "examplebucket",
* "CreateBucketConfiguration": {
* "LocationConstraint": "eu-west-1"
* }
* };
* const command = new CreateBucketCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "Location": "/examplebucket"
* "Location": "http://examplebucket.<Region>.s3.amazonaws.com/"
* }
* *\/
* // example id: to-create-a-bucket--1472851826060
* // example id: to-create-a-bucket-in-a-specific-region-1483399072992
* ```
*
* @example To create a bucket in a specific region
* @example To create a bucket
* ```javascript
* // The following example creates a bucket. The request specifies an AWS region where to create the bucket.
* // The following example creates a bucket.
* const input = {
* "Bucket": "examplebucket",
* "CreateBucketConfiguration": {
* "LocationConstraint": "eu-west-1"
* }
* "Bucket": "examplebucket"
* };
* const command = new CreateBucketCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "Location": "http://examplebucket.<Region>.s3.amazonaws.com/"
* "Location": "/examplebucket"
* }
* *\/
* // example id: to-create-a-bucket-in-a-specific-region-1483399072992
* // example id: to-create-a-bucket--1472851826060
* ```
*
*/
Expand Down
20 changes: 10 additions & 10 deletions clients/client-s3/src/commands/DeleteObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,28 +162,28 @@ export interface DeleteObjectCommandOutput extends DeleteObjectOutput, __Metadat
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @public
* @example To delete an object (from a non-versioned bucket)
* @example To delete an object
* ```javascript
* // The following example deletes an object from a non-versioned bucket.
* // The following example deletes an object from an S3 bucket.
* const input = {
* "Bucket": "ExampleBucket",
* "Key": "HappyFace.jpg"
* "Bucket": "examplebucket",
* "Key": "objectkey.jpg"
* };
* const command = new DeleteObjectCommand(input);
* await client.send(command);
* // example id: to-delete-an-object-from-a-non-versioned-bucket-1481588533089
* // example id: to-delete-an-object-1472850136595
* ```
*
* @example To delete an object
* @example To delete an object (from a non-versioned bucket)
* ```javascript
* // The following example deletes an object from an S3 bucket.
* // The following example deletes an object from a non-versioned bucket.
* const input = {
* "Bucket": "examplebucket",
* "Key": "objectkey.jpg"
* "Bucket": "ExampleBucket",
* "Key": "HappyFace.jpg"
* };
* const command = new DeleteObjectCommand(input);
* await client.send(command);
* // example id: to-delete-an-object-1472850136595
* // example id: to-delete-an-object-from-a-non-versioned-bucket-1481588533089
* ```
*
*/
Expand Down
22 changes: 11 additions & 11 deletions clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,39 +81,39 @@ export interface DeleteObjectTaggingCommandOutput extends DeleteObjectTaggingOut
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @public
* @example To remove tag set from an object version
* @example To remove tag set from an object
* ```javascript
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
* // 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.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "Key": "HappyFace.jpg"
* };
* const command = new DeleteObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "VersionId": "null"
* }
* *\/
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
* // example id: to-remove-tag-set-from-an-object-1483145342862
* ```
*
* @example To remove tag set from an object
* @example To remove tag set from an object version
* ```javascript
* // 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.
* // The following example removes tag set associated with the specified object version. The request specifies both the object key and object version.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg"
* "Key": "HappyFace.jpg",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* };
* const command = new DeleteObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "VersionId": "null"
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* }
* *\/
* // example id: to-remove-tag-set-from-an-object-1483145342862
* // example id: to-remove-tag-set-from-an-object-version-1483145285913
* ```
*
*/
Expand Down
2 changes: 1 addition & 1 deletion clients/client-s3/src/commands/DeleteObjectsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export interface DeleteObjectsCommandOutput extends DeleteObjectsOutput, __Metad
* <p>
* <b>
* <code>s3:DeleteObjectVersion</code>
* </b> - To delete a specific version of an object from a versiong-enabled bucket, you must specify the <code>s3:DeleteObjectVersion</code> permission.</p>
* </b> - To delete a specific version of an object from a versioning-enabled bucket, you must specify the <code>s3:DeleteObjectVersion</code> permission.</p>
* </li>
* </ul>
* </li>
Expand Down
38 changes: 19 additions & 19 deletions clients/client-s3/src/commands/GetObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,53 +286,53 @@ export interface GetObjectCommandOutput extends Omit<GetObjectOutput, "Body">, _
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @public
* @example To retrieve a byte range of an object
* @example To retrieve an object
* ```javascript
* // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.
* // The following example retrieves an object for an S3 bucket.
* const input = {
* "Bucket": "examplebucket",
* "Key": "SampleFile.txt",
* "Range": "bytes=0-9"
* "Key": "HappyFace.jpg"
* };
* const command = new GetObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "AcceptRanges": "bytes",
* "ContentLength": "10",
* "ContentRange": "bytes 0-9/43",
* "ContentType": "text/plain",
* "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
* "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT",
* "ContentLength": "3191",
* "ContentType": "image/jpeg",
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT",
* "Metadata": {},
* "TagCount": 2,
* "VersionId": "null"
* }
* *\/
* // example id: to-retrieve-a-byte-range-of-an-object--1481832674603
* // example id: to-retrieve-an-object-1481827837012
* ```
*
* @example To retrieve an object
* @example To retrieve a byte range of an object
* ```javascript
* // The following example retrieves an object for an S3 bucket.
* // The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg"
* "Key": "SampleFile.txt",
* "Range": "bytes=0-9"
* };
* const command = new GetObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "AcceptRanges": "bytes",
* "ContentLength": "3191",
* "ContentType": "image/jpeg",
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "LastModified": "Thu, 15 Dec 2016 01:19:41 GMT",
* "ContentLength": "10",
* "ContentRange": "bytes 0-9/43",
* "ContentType": "text/plain",
* "ETag": "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
* "LastModified": "Thu, 09 Oct 2014 22:57:28 GMT",
* "Metadata": {},
* "TagCount": 2,
* "VersionId": "null"
* }
* *\/
* // example id: to-retrieve-an-object-1481827837012
* // example id: to-retrieve-a-byte-range-of-an-object--1481832674603
* ```
*
*/
Expand Down
38 changes: 19 additions & 19 deletions clients/client-s3/src/commands/GetObjectTaggingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,55 +97,55 @@ export interface GetObjectTaggingCommandOutput extends GetObjectTaggingOutput, _
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @public
* @example To retrieve tag set of an object
* @example To retrieve tag set of a specific object version
* ```javascript
* // The following example retrieves tag set of an object.
* // The following example retrieves tag set of an object. The request specifies object version.
* const input = {
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg"
* "Key": "exampleobject",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* };
* const command = new GetObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "TagSet": [
* {
* "Key": "Key4",
* "Value": "Value4"
* },
* {
* "Key": "Key3",
* "Value": "Value3"
* "Key": "Key1",
* "Value": "Value1"
* }
* ],
* "VersionId": "null"
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* }
* *\/
* // example id: to-retrieve-tag-set-of-an-object-1481833847896
* // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663
* ```
*
* @example To retrieve tag set of a specific object version
* @example To retrieve tag set of an object
* ```javascript
* // The following example retrieves tag set of an object. The request specifies object version.
* // The following example retrieves tag set of an object.
* const input = {
* "Bucket": "examplebucket",
* "Key": "exampleobject",
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "Key": "HappyFace.jpg"
* };
* const command = new GetObjectTaggingCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "TagSet": [
* {
* "Key": "Key1",
* "Value": "Value1"
* "Key": "Key4",
* "Value": "Value4"
* },
* {
* "Key": "Key3",
* "Value": "Value3"
* }
* ],
* "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"
* "VersionId": "null"
* }
* *\/
* // example id: to-retrieve-tag-set-of-a-specific-object-version-1483400283663
* // example id: to-retrieve-tag-set-of-an-object-1481833847896
* ```
*
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-s3/src/commands/HeadObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ export interface HeadObjectCommandOutput extends HeadObjectOutput, __MetadataBea
* IfUnmodifiedSince: new Date("TIMESTAMP"),
* Key: "STRING_VALUE", // required
* Range: "STRING_VALUE",
* ResponseCacheControl: "STRING_VALUE",
* ResponseContentDisposition: "STRING_VALUE",
* ResponseContentEncoding: "STRING_VALUE",
* ResponseContentLanguage: "STRING_VALUE",
* ResponseContentType: "STRING_VALUE",
* ResponseExpires: new Date("TIMESTAMP"),
* VersionId: "STRING_VALUE",
* SSECustomerAlgorithm: "STRING_VALUE",
* SSECustomerKey: "STRING_VALUE",
Expand Down
Loading

0 comments on commit ac9f3d2

Please sign in to comment.