Skip to content

Commit

Permalink
feat(client-s3): S3 Inventory now supports Object Access Control List…
Browse files Browse the repository at this point in the history
… and Object Owner as available object metadata fields in inventory reports.
  • Loading branch information
awstools committed Jul 13, 2023
1 parent a6c3b78 commit 53ac18c
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 97 deletions.
4 changes: 3 additions & 1 deletion clients/client-s3/src/commands/CopyObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export interface CopyObjectCommandOutput extends CopyObjectOutput, __MetadataBea
* body.</p>
* </note>
* <p>The copy request charge is based on the storage class and Region that you specify for
* the destination object. For pricing information, see <a href="http://aws.amazon.com/s3/pricing/">Amazon S3 pricing</a>.</p>
* the destination object. The request can also result in a data retrieval charge for the
* source if the source storage class bills for data retrieval. For pricing information, see
* <a href="http://aws.amazon.com/s3/pricing/">Amazon S3 pricing</a>.</p>
* <important>
* <p>Amazon S3 transfer acceleration does not support cross-Region copies. If you request a
* cross-Region copy using a transfer acceleration endpoint, you get a 400 <code>Bad
Expand Down
28 changes: 14 additions & 14 deletions clients/client-s3/src/commands/CreateBucketCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
* ACL: "private" || "public-read" || "public-read-write" || "authenticated-read",
* Bucket: "STRING_VALUE", // required
* CreateBucketConfiguration: { // CreateBucketConfiguration
* LocationConstraint: "af-south-1" || "ap-east-1" || "ap-northeast-1" || "ap-northeast-2" || "ap-northeast-3" || "ap-south-1" || "ap-southeast-1" || "ap-southeast-2" || "ap-southeast-3" || "ca-central-1" || "cn-north-1" || "cn-northwest-1" || "EU" || "eu-central-1" || "eu-north-1" || "eu-south-1" || "eu-west-1" || "eu-west-2" || "eu-west-3" || "me-south-1" || "sa-east-1" || "us-east-2" || "us-gov-east-1" || "us-gov-west-1" || "us-west-1" || "us-west-2",
* LocationConstraint: "af-south-1" || "ap-east-1" || "ap-northeast-1" || "ap-northeast-2" || "ap-northeast-3" || "ap-south-1" || "ap-southeast-1" || "ap-southeast-2" || "ap-southeast-3" || "ca-central-1" || "cn-north-1" || "cn-northwest-1" || "EU" || "eu-central-1" || "eu-north-1" || "eu-south-1" || "eu-west-1" || "eu-west-2" || "eu-west-3" || "me-south-1" || "sa-east-1" || "us-east-2" || "us-gov-east-1" || "us-gov-west-1" || "us-west-1" || "us-west-2" || "ap-south-2" || "eu-south-2",
* },
* GrantFullControl: "STRING_VALUE",
* GrantRead: "STRING_VALUE",
Expand Down Expand Up @@ -169,39 +169,39 @@ export interface CreateBucketCommandOutput extends CreateBucketOutput, __Metadat
* @throws {@link S3ServiceException}
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @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 @@ -96,28 +96,28 @@ export interface DeleteObjectCommandOutput extends DeleteObjectOutput, __Metadat
* @throws {@link S3ServiceException}
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @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
* ```
*
* @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
* ```
*
*/
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 @@ -85,39 +85,39 @@ export interface DeleteObjectTaggingCommandOutput extends DeleteObjectTaggingOut
* @throws {@link S3ServiceException}
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @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
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export interface GetBucketInventoryConfigurationCommandOutput
* // Id: "STRING_VALUE", // required
* // IncludedObjectVersions: "All" || "Current", // required
* // OptionalFields: [ // InventoryOptionalFields
* // "Size" || "LastModifiedDate" || "StorageClass" || "ETag" || "IsMultipartUploaded" || "ReplicationStatus" || "EncryptionStatus" || "ObjectLockRetainUntilDate" || "ObjectLockMode" || "ObjectLockLegalHoldStatus" || "IntelligentTieringAccessTier" || "BucketKeyStatus" || "ChecksumAlgorithm",
* // "Size" || "LastModifiedDate" || "StorageClass" || "ETag" || "IsMultipartUploaded" || "ReplicationStatus" || "EncryptionStatus" || "ObjectLockRetainUntilDate" || "ObjectLockMode" || "ObjectLockLegalHoldStatus" || "IntelligentTieringAccessTier" || "BucketKeyStatus" || "ChecksumAlgorithm" || "ObjectAccessControlList" || "ObjectOwner",
* // ],
* // Schedule: { // InventorySchedule
* // Frequency: "Daily" || "Weekly", // required
Expand Down
2 changes: 1 addition & 1 deletion clients/client-s3/src/commands/GetBucketLocationCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface GetBucketLocationCommandOutput extends GetBucketLocationOutput,
* const command = new GetBucketLocationCommand(input);
* const response = await client.send(command);
* // { // GetBucketLocationOutput
* // LocationConstraint: "af-south-1" || "ap-east-1" || "ap-northeast-1" || "ap-northeast-2" || "ap-northeast-3" || "ap-south-1" || "ap-southeast-1" || "ap-southeast-2" || "ap-southeast-3" || "ca-central-1" || "cn-north-1" || "cn-northwest-1" || "EU" || "eu-central-1" || "eu-north-1" || "eu-south-1" || "eu-west-1" || "eu-west-2" || "eu-west-3" || "me-south-1" || "sa-east-1" || "us-east-2" || "us-gov-east-1" || "us-gov-west-1" || "us-west-1" || "us-west-2",
* // LocationConstraint: "af-south-1" || "ap-east-1" || "ap-northeast-1" || "ap-northeast-2" || "ap-northeast-3" || "ap-south-1" || "ap-southeast-1" || "ap-southeast-2" || "ap-southeast-3" || "ca-central-1" || "cn-north-1" || "cn-northwest-1" || "EU" || "eu-central-1" || "eu-north-1" || "eu-south-1" || "eu-west-1" || "eu-west-2" || "eu-west-3" || "me-south-1" || "sa-east-1" || "us-east-2" || "us-gov-east-1" || "us-gov-west-1" || "us-west-1" || "us-west-2" || "ap-south-2" || "eu-south-2",
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export interface ListBucketInventoryConfigurationsCommandOutput
* // Id: "STRING_VALUE", // required
* // IncludedObjectVersions: "All" || "Current", // required
* // OptionalFields: [ // InventoryOptionalFields
* // "Size" || "LastModifiedDate" || "StorageClass" || "ETag" || "IsMultipartUploaded" || "ReplicationStatus" || "EncryptionStatus" || "ObjectLockRetainUntilDate" || "ObjectLockMode" || "ObjectLockLegalHoldStatus" || "IntelligentTieringAccessTier" || "BucketKeyStatus" || "ChecksumAlgorithm",
* // "Size" || "LastModifiedDate" || "StorageClass" || "ETag" || "IsMultipartUploaded" || "ReplicationStatus" || "EncryptionStatus" || "ObjectLockRetainUntilDate" || "ObjectLockMode" || "ObjectLockLegalHoldStatus" || "IntelligentTieringAccessTier" || "BucketKeyStatus" || "ChecksumAlgorithm" || "ObjectAccessControlList" || "ObjectOwner",
* // ],
* // Schedule: { // InventorySchedule
* // Frequency: "Daily" || "Weekly", // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export interface PutBucketInventoryConfigurationCommandOutput extends __Metadata
* Id: "STRING_VALUE", // required
* IncludedObjectVersions: "All" || "Current", // required
* OptionalFields: [ // InventoryOptionalFields
* "Size" || "LastModifiedDate" || "StorageClass" || "ETag" || "IsMultipartUploaded" || "ReplicationStatus" || "EncryptionStatus" || "ObjectLockRetainUntilDate" || "ObjectLockMode" || "ObjectLockLegalHoldStatus" || "IntelligentTieringAccessTier" || "BucketKeyStatus" || "ChecksumAlgorithm",
* "Size" || "LastModifiedDate" || "StorageClass" || "ETag" || "IsMultipartUploaded" || "ReplicationStatus" || "EncryptionStatus" || "ObjectLockRetainUntilDate" || "ObjectLockMode" || "ObjectLockLegalHoldStatus" || "IntelligentTieringAccessTier" || "BucketKeyStatus" || "ChecksumAlgorithm" || "ObjectAccessControlList" || "ObjectOwner",
* ],
* Schedule: { // InventorySchedule
* Frequency: "Daily" || "Weekly", // required
Expand Down
86 changes: 43 additions & 43 deletions clients/client-s3/src/commands/PutObjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,68 +218,65 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare
* @throws {@link S3ServiceException}
* <p>Base exception class for all service exceptions from S3 service.</p>
*
* @example To upload object and specify user-defined metadata
* @example To create an object.
* ```javascript
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
* // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
* const input = {
* "Body": "filetoupload",
* "Bucket": "examplebucket",
* "Key": "exampleobject",
* "Metadata": {
* "metadata1": "value1",
* "metadata2": "value2"
* }
* "Key": "objectkey"
* };
* const command = new PutObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
* "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
* }
* *\/
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
* // example id: to-create-an-object-1483147613675
* ```
*
* @example To upload an object (specify optional headers)
* @example To upload object and specify user-defined metadata
* ```javascript
* // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption.
* // The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.
* const input = {
* "Body": "HappyFace.jpg",
* "Body": "filetoupload",
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg",
* "ServerSideEncryption": "AES256",
* "StorageClass": "STANDARD_IA"
* "Key": "exampleobject",
* "Metadata": {
* "metadata1": "value1",
* "metadata2": "value2"
* }
* };
* const command = new PutObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "ServerSideEncryption": "AES256",
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
* "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0"
* }
* *\/
* // example id: to-upload-an-object-(specify-optional-headers)
* // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757
* ```
*
* @example To create an object.
* @example To upload an object
* ```javascript
* // The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
* // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object.
* const input = {
* "Body": "filetoupload",
* "Body": "HappyFace.jpg",
* "Bucket": "examplebucket",
* "Key": "objectkey"
* "Key": "HappyFace.jpg"
* };
* const command = new PutObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ"
* "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk"
* }
* *\/
* // example id: to-create-an-object-1483147613675
* // example id: to-upload-an-object-1481760101010
* ```
*
* @example To upload an object and specify canned ACL.
Expand All @@ -302,65 +299,68 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare
* // example id: to-upload-an-object-and-specify-canned-acl-1483397779571
* ```
*
* @example To upload an object
* @example To upload an object (specify optional headers)
* ```javascript
* // The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object.
* // The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption.
* const input = {
* "Body": "HappyFace.jpg",
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg"
* "Key": "HappyFace.jpg",
* "ServerSideEncryption": "AES256",
* "StorageClass": "STANDARD_IA"
* };
* const command = new PutObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk"
* "ServerSideEncryption": "AES256",
* "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp"
* }
* *\/
* // example id: to-upload-an-object-1481760101010
* // example id: to-upload-an-object-(specify-optional-headers)
* ```
*
* @example To upload an object and specify server-side encryption and object tags
* @example To upload an object and specify optional tags
* ```javascript
* // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
* // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object.
* const input = {
* "Body": "filetoupload",
* "Body": "c:\\HappyFace.jpg",
* "Bucket": "examplebucket",
* "Key": "exampleobject",
* "ServerSideEncryption": "AES256",
* "Key": "HappyFace.jpg",
* "Tagging": "key1=value1&key2=value2"
* };
* const command = new PutObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "ServerSideEncryption": "AES256",
* "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
* "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
* }
* *\/
* // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831
* // example id: to-upload-an-object-and-specify-optional-tags-1481762310955
* ```
*
* @example To upload an object and specify optional tags
* @example To upload an object and specify server-side encryption and object tags
* ```javascript
* // The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object.
* // The following example uploads an object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
* const input = {
* "Body": "c:\\HappyFace.jpg",
* "Body": "filetoupload",
* "Bucket": "examplebucket",
* "Key": "HappyFace.jpg",
* "Key": "exampleobject",
* "ServerSideEncryption": "AES256",
* "Tagging": "key1=value1&key2=value2"
* };
* const command = new PutObjectCommand(input);
* const response = await client.send(command);
* /* response ==
* {
* "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"",
* "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a"
* "ServerSideEncryption": "AES256",
* "VersionId": "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt"
* }
* *\/
* // example id: to-upload-an-object-and-specify-optional-tags-1481762310955
* // example id: to-upload-an-object-and-specify-server-side-encryption-and-object-tags-1483398331831
* ```
*
*/
Expand Down
Loading

0 comments on commit 53ac18c

Please sign in to comment.