Skip to content

Commit

Permalink
feat(client-s3): The S3 LISTObjects, ListObjectsV2 and ListObjectVers…
Browse files Browse the repository at this point in the history
…ions API now supports a new optional header x-amz-optional-object-attributes. If header contains RestoreStatus as the value, then S3 will include Glacier restore status i.e. isRestoreInProgress and RestoreExpiryDate in List response.
  • Loading branch information
awstools committed Jun 28, 2023
1 parent 3cb41fa commit 5457785
Show file tree
Hide file tree
Showing 8 changed files with 469 additions and 965 deletions.
14 changes: 11 additions & 3 deletions clients/client-s3/src/commands/ListObjectVersionsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ export interface ListObjectVersionsCommandOutput extends ListObjectVersionsOutpu
* parameters as selection criteria to return metadata about a subset of all the object
* versions.</p>
* <important>
* <p> To use this operation, you must have permissions to perform the
* <p> To use this operation, you must have permission to perform the
* <code>s3:ListBucketVersions</code> action. Be aware of the name difference. </p>
* </important>
* <note>
* <p> A 200 OK response can contain valid or invalid XML. Make sure to design your
* application to parse the contents of the response and handle it appropriately.</p>
* <p> A <code>200 OK</code> response can contain valid or invalid XML. Make sure to design
* your application to parse the contents of the response and handle it
* appropriately.</p>
* </note>
* <p>To use this operation, you must have READ access to the bucket.</p>
* <p>This action is not supported by Amazon S3 on Outposts.</p>
Expand Down Expand Up @@ -88,6 +89,9 @@ export interface ListObjectVersionsCommandOutput extends ListObjectVersionsOutpu
* VersionIdMarker: "STRING_VALUE",
* ExpectedBucketOwner: "STRING_VALUE",
* RequestPayer: "requester",
* OptionalObjectAttributes: [ // OptionalObjectAttributesList
* "RestoreStatus",
* ],
* };
* const command = new ListObjectVersionsCommand(input);
* const response = await client.send(command);
Expand All @@ -113,6 +117,10 @@ export interface ListObjectVersionsCommandOutput extends ListObjectVersionsOutpu
* // DisplayName: "STRING_VALUE",
* // ID: "STRING_VALUE",
* // },
* // RestoreStatus: { // RestoreStatus
* // IsRestoreInProgress: true || false,
* // RestoreExpiryDate: new Date("TIMESTAMP"),
* // },
* // },
* // ],
* // DeleteMarkers: [ // DeleteMarkers
Expand Down
7 changes: 7 additions & 0 deletions clients/client-s3/src/commands/ListObjectsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export interface ListObjectsCommandOutput extends ListObjectsOutput, __MetadataB
* Prefix: "STRING_VALUE",
* RequestPayer: "requester",
* ExpectedBucketOwner: "STRING_VALUE",
* OptionalObjectAttributes: [ // OptionalObjectAttributesList
* "RestoreStatus",
* ],
* };
* const command = new ListObjectsCommand(input);
* const response = await client.send(command);
Expand All @@ -108,6 +111,10 @@ export interface ListObjectsCommandOutput extends ListObjectsOutput, __MetadataB
* // DisplayName: "STRING_VALUE",
* // ID: "STRING_VALUE",
* // },
* // RestoreStatus: { // RestoreStatus
* // IsRestoreInProgress: true || false,
* // RestoreExpiryDate: new Date("TIMESTAMP"),
* // },
* // },
* // ],
* // Name: "STRING_VALUE",
Expand Down
19 changes: 13 additions & 6 deletions clients/client-s3/src/commands/ListObjectsV2Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ export interface ListObjectsV2CommandOutput extends ListObjectsV2Output, __Metad
* design your application to parse the contents of the response and handle it appropriately.
* Objects are returned sorted in an ascending order of the respective key names in the list.
* For more information about listing objects, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html">Listing object keys
* programmatically</a>
* </p>
* programmatically</a> in the <i>Amazon S3 User Guide</i>.</p>
* <p>To use this operation, you must have READ access to the bucket.</p>
* <p>To use this action in an Identity and Access Management (IAM) policy, you must have permissions to perform
* <p>To use this action in an Identity and Access Management (IAM) policy, you must have permission to perform
* the <code>s3:ListBucket</code> action. The bucket owner has this permission by default and
* can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing
* Access Permissions to Your Amazon S3 Resources</a>.</p>
* Access Permissions to Your Amazon S3 Resources</a> in the
* <i>Amazon S3 User Guide</i>.</p>
* <important>
* <p>This section describes the latest revision of this action. We recommend that you use
* this revised API for application development. For backward compatibility, Amazon S3 continues
* to support the prior version of this API, <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html">ListObjects</a>.</p>
* this revised API operation for application development. For backward compatibility, Amazon S3
* continues to support the prior version of this API operation, <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html">ListObjects</a>.</p>
* </important>
* <p>To get a list of your buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html">ListBuckets</a>.</p>
* <p>The following operations are related to <code>ListObjectsV2</code>:</p>
Expand Down Expand Up @@ -90,6 +90,9 @@ export interface ListObjectsV2CommandOutput extends ListObjectsV2Output, __Metad
* StartAfter: "STRING_VALUE",
* RequestPayer: "requester",
* ExpectedBucketOwner: "STRING_VALUE",
* OptionalObjectAttributes: [ // OptionalObjectAttributesList
* "RestoreStatus",
* ],
* };
* const command = new ListObjectsV2Command(input);
* const response = await client.send(command);
Expand All @@ -109,6 +112,10 @@ export interface ListObjectsV2CommandOutput extends ListObjectsV2Output, __Metad
* // DisplayName: "STRING_VALUE",
* // ID: "STRING_VALUE",
* // },
* // RestoreStatus: { // RestoreStatus
* // IsRestoreInProgress: true || false,
* // RestoreExpiryDate: new Date("TIMESTAMP"),
* // },
* // },
* // ],
* // Name: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { PutObjectLockConfigurationOutput, PutObjectLockConfigurationRequest } from "../models/models_0";
import { PutObjectLockConfigurationOutput, PutObjectLockConfigurationRequest } from "../models/models_1";
import { de_PutObjectLockConfigurationCommand, se_PutObjectLockConfigurationCommand } from "../protocols/Aws_restXml";
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";

Expand Down
Loading

0 comments on commit 5457785

Please sign in to comment.