diff --git a/clients/client-s3/src/commands/PutObjectCommand.ts b/clients/client-s3/src/commands/PutObjectCommand.ts index a6076e3bf0d54..a94502b2c78dd 100644 --- a/clients/client-s3/src/commands/PutObjectCommand.ts +++ b/clients/client-s3/src/commands/PutObjectCommand.ts @@ -263,49 +263,49 @@ export interface PutObjectCommandOutput extends PutObjectOutput, __MetadataBeare * // example id: to-upload-an-object-1481760101010 * ``` * - * @example To upload object and specify user-defined metadata + * @example To upload an object (specify optional headers) * ```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 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": "filetoupload", + * "Body": "HappyFace.jpg", * "Bucket": "examplebucket", - * "Key": "exampleobject", - * "Metadata": { - * "metadata1": "value1", - * "metadata2": "value2" - * } + * "Key": "HappyFace.jpg", + * "ServerSideEncryption": "AES256", + * "StorageClass": "STANDARD_IA" * }; * const command = new PutObjectCommand(input); * const response = await client.send(command); * /* response == * { * "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - * "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0" + * "ServerSideEncryption": "AES256", + * "VersionId": "CG612hodqujkf8FaaNfp8U..FIhLROcp" * } * *\/ - * // example id: to-upload-object-and-specify-user-defined-metadata-1483396974757 + * // example id: to-upload-an-object-(specify-optional-headers) * ``` * - * @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 upload an object and specify canned ACL. diff --git a/clients/client-s3/src/protocols/Aws_restXml.ts b/clients/client-s3/src/protocols/Aws_restXml.ts index 2e6eae7adc256..579d277e747f5 100644 --- a/clients/client-s3/src/protocols/Aws_restXml.ts +++ b/clients/client-s3/src/protocols/Aws_restXml.ts @@ -492,7 +492,6 @@ export const se_CompleteMultipartUploadCommand = async ( b.p("Bucket", () => input.Bucket!, "{Bucket}", false); b.p("Key", () => input.Key!, "{Key+}", true); const query: any = map({ - [_xi]: [, "CompleteMultipartUpload"], [_uI]: [, __expectNonNull(input[_UI]!, `UploadId`)], }); let body: any; @@ -658,7 +657,6 @@ export const se_CreateMultipartUploadCommand = async ( b.p("Key", () => input.Key!, "{Key+}", true); const query: any = map({ [_u]: [, ""], - [_xi]: [, "CreateMultipartUpload"], }); let body: any; b.m("POST").h(headers).q(query).b(body); @@ -1004,7 +1002,6 @@ export const se_DeleteObjectsCommand = async ( b.p("Bucket", () => input.Bucket!, "{Bucket}", false); const query: any = map({ [_d]: [, ""], - [_xi]: [, "DeleteObjects"], }); let body: any; let contents: any; @@ -2909,7 +2906,6 @@ export const se_RestoreObjectCommand = async ( b.p("Key", () => input.Key!, "{Key+}", true); const query: any = map({ [_res]: [, ""], - [_xi]: [, "RestoreObject"], [_vI]: [, input[_VI]!], }); let body: any; @@ -2945,7 +2941,6 @@ export const se_SelectObjectContentCommand = async ( const query: any = map({ [_se]: [, ""], [_st]: [, "2"], - [_xi]: [, "SelectObjectContent"], }); let body: any; body = _ve; @@ -3108,9 +3103,6 @@ export const se_WriteGetObjectResponseCommand = async ( }, {})), }); b.bp("/WriteGetObjectResponse"); - const query: any = map({ - [_xi]: [, "WriteGetObjectResponse"], - }); let body: any; let contents: any; if (input.Body !== undefined) { @@ -3129,7 +3121,7 @@ export const se_WriteGetObjectResponseCommand = async ( } } b.hn(resolvedHostname); - b.m("POST").h(headers).q(query).b(body); + b.m("POST").h(headers).b(body); return b.build(); }; diff --git a/codegen/sdk-codegen/aws-models/s3.json b/codegen/sdk-codegen/aws-models/s3.json index 2843f9e4358b0..e35fefbb233a9 100644 --- a/codegen/sdk-codegen/aws-models/s3.json +++ b/codegen/sdk-codegen/aws-models/s3.json @@ -18255,7 +18255,7 @@ "smithy.api#documentation": "

Completes a multipart upload by assembling previously uploaded parts.

\n

You first initiate the multipart upload and then upload all parts using the UploadPart\n operation or the UploadPartCopy\n operation. After successfully uploading all relevant parts of an upload, you call this\n CompleteMultipartUpload operation to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts\n in ascending order by part number to create a new object. In the CompleteMultipartUpload \n request, you must provide the parts list and ensure that the parts list is complete.\n The CompleteMultipartUpload API operation concatenates the parts that you provide in the list. For each part in the list,\n you must provide the PartNumber value and the ETag value that are returned after that part\n was uploaded.

\n

The processing of a CompleteMultipartUpload request could take several minutes to\n finalize. After Amazon S3 begins processing the request, it sends an HTTP response header that\n specifies a 200 OK response. While processing is in progress, Amazon S3 periodically sends white\n space characters to keep the connection from timing out. A request could fail after the\n initial 200 OK response has been sent. This means that a 200 OK response can\n contain either a success or an error. The error response might be embedded in the 200 OK response. \n If you call this API operation directly, make sure to design\n your application to parse the contents of the response and handle it appropriately. If you\n use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply\n error handling per your configuration settings (including automatically retrying the\n request as appropriate). If the condition persists, the SDKs throw an exception (or, for\n the SDKs that don't use exceptions, they return an error).

\n

Note that if CompleteMultipartUpload fails, applications should be prepared\n to retry any failed requests (including 500 error responses). For more information, see Amazon S3 Error Best\n Practices.

\n \n

You can't use Content-Type: application/x-www-form-urlencoded for the \n CompleteMultipartUpload requests. Also, if you don't provide a\n Content-Type header, CompleteMultipartUpload can still return a 200\n OK response.

\n
\n

For more information about multipart uploads, see Uploading Objects Using Multipart\n Upload in the Amazon S3\n User Guide.

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Permissions
\n
\n \n
\n
Special errors
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to CompleteMultipartUpload:

\n ", "smithy.api#http": { "method": "POST", - "uri": "/{Bucket}/{Key+}?x-id=CompleteMultipartUpload", + "uri": "/{Bucket}/{Key+}", "code": 200 } } @@ -19366,7 +19366,7 @@ ], "smithy.api#http": { "method": "POST", - "uri": "/{Bucket}/{Key+}?uploads&x-id=CreateMultipartUpload", + "uri": "/{Bucket}/{Key+}?uploads", "code": 200 } } @@ -20641,6 +20641,14 @@ "traits": { "smithy.api#documentation": "

Removes an object from a bucket. The behavior depends on the bucket's versioning state:

\n \n \n \n \n

To remove a specific version, you must use the versionId query parameter. Using this\n query parameter permanently deletes the version. If the object deleted is a delete marker, Amazon S3\n sets the response header x-amz-delete-marker to true.

\n

If the object you want to delete is in a bucket where the bucket versioning\n configuration is MFA Delete enabled, you must include the x-amz-mfa request\n header in the DELETE versionId request. Requests that include\n x-amz-mfa must use HTTPS. For more information about MFA Delete, see Using MFA Delete in the Amazon S3\n User Guide. To see sample\n requests that use versioning, see Sample\n Request.

\n \n

\n Directory buckets - MFA delete is not supported by directory buckets.

\n
\n

You can delete objects by explicitly calling DELETE Object or calling \n (PutBucketLifecycle) to enable Amazon S3 to remove them for you. If you want to block\n users or accounts from removing or deleting objects from your bucket, you must deny them\n the s3:DeleteObject, s3:DeleteObjectVersion, and\n s3:PutLifeCycleConfiguration actions.

\n \n

\n Directory buckets - S3 Lifecycle is not supported by directory buckets.

\n
\n
\n
Permissions
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following action is related to DeleteObject:

\n ", "smithy.api#examples": [ + { + "title": "To delete an object (from a non-versioned bucket)", + "documentation": "The following example deletes an object from a non-versioned bucket.", + "input": { + "Bucket": "ExampleBucket", + "Key": "HappyFace.jpg" + } + }, { "title": "To delete an object", "documentation": "The following example deletes an object from an S3 bucket.", @@ -20649,14 +20657,6 @@ "Key": "objectkey.jpg" }, "output": {} - }, - { - "title": "To delete an object (from a non-versioned bucket)", - "documentation": "The following example deletes an object from a non-versioned bucket.", - "input": { - "Bucket": "ExampleBucket", - "Key": "HappyFace.jpg" - } } ], "smithy.api#http": { @@ -20906,7 +20906,7 @@ ], "smithy.api#http": { "method": "POST", - "uri": "/{Bucket}?delete&x-id=DeleteObjects", + "uri": "/{Bucket}?delete", "code": 200 } } @@ -24160,40 +24160,40 @@ "smithy.api#documentation": "\n

This operation is not supported by directory buckets.

\n
\n

Returns the tag-set of an object. You send the GET request against the tagging\n subresource associated with the object.

\n

To use this operation, you must have permission to perform the\n s3:GetObjectTagging action. By default, the GET action returns information\n about current version of an object. For a versioned bucket, you can have multiple versions\n of an object in your bucket. To retrieve tags of any other version, use the versionId query\n parameter. You also need permission for the s3:GetObjectVersionTagging\n action.

\n

By default, the bucket owner has this permission and can grant this permission to\n others.

\n

For information about the Amazon S3 object tagging feature, see Object Tagging.

\n

The following actions are related to GetObjectTagging:

\n ", "smithy.api#examples": [ { - "title": "To retrieve tag set of a specific object version", - "documentation": "The following example retrieves tag set of an object. The request specifies object version.", + "title": "To retrieve tag set of an object", + "documentation": "The following example retrieves tag set of an object.", "input": { "Bucket": "examplebucket", - "Key": "exampleobject", - "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" + "Key": "HappyFace.jpg" }, "output": { - "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI", + "VersionId": "null", "TagSet": [ { - "Value": "Value1", - "Key": "Key1" + "Value": "Value4", + "Key": "Key4" + }, + { + "Value": "Value3", + "Key": "Key3" } ] } }, { - "title": "To retrieve tag set of an object", - "documentation": "The following example retrieves tag set of an object.", + "title": "To retrieve tag set of a specific object version", + "documentation": "The following example retrieves tag set of an object. The request specifies object version.", "input": { "Bucket": "examplebucket", - "Key": "HappyFace.jpg" + "Key": "exampleobject", + "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI" }, "output": { - "VersionId": "null", + "VersionId": "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI", "TagSet": [ { - "Value": "Value4", - "Key": "Key4" - }, - { - "Value": "Value3", - "Key": "Key3" + "Value": "Value1", + "Key": "Key1" } ] } @@ -26637,44 +26637,6 @@ "traits": { "smithy.api#documentation": "\n

This operation is not supported by directory buckets.

\n
\n

Returns metadata about all versions of the objects in a bucket. You can also use request\n parameters as selection criteria to return metadata about a subset of all the object\n versions.

\n \n

To use this operation, you must have permission to perform the\n s3:ListBucketVersions action. Be aware of the name difference.

\n
\n \n

A 200 OK response can contain valid or invalid XML. Make sure to design\n your application to parse the contents of the response and handle it\n appropriately.

\n
\n

To use this operation, you must have READ access to the bucket.

\n

The following operations are related to ListObjectVersions:

\n ", "smithy.api#examples": [ - { - "title": "To list object versions", - "documentation": "The following example return versions of an object with specific key name prefix. The request limits the number of items returned to two. If there are are more than two object version, S3 returns NextToken in the response. You can specify this token value in your next request to fetch next set of object versions.", - "input": { - "Bucket": "examplebucket", - "Prefix": "HappyFace.jpg" - }, - "output": { - "Versions": [ - { - "LastModified": "2016-12-15T01:19:41.000Z", - "VersionId": "null", - "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - "StorageClass": "STANDARD", - "Key": "HappyFace.jpg", - "Owner": { - "DisplayName": "owner-display-name", - "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" - }, - "IsLatest": true, - "Size": 3191 - }, - { - "LastModified": "2016-12-13T00:58:26.000Z", - "VersionId": "PHtexPGjH2y.zBgT8LmB7wwLI2mpbz.k", - "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", - "StorageClass": "STANDARD", - "Key": "HappyFace.jpg", - "Owner": { - "DisplayName": "owner-display-name", - "ID": "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc" - }, - "IsLatest": false, - "Size": 3191 - } - ] - } - }, { "title": "To list object versions", "documentation": "The following example returns versions of an object with specific key name prefix.", @@ -30579,15 +30541,19 @@ "smithy.api#documentation": "

Adds an object to a bucket.

\n \n \n \n

Amazon S3 is a distributed system. If it receives multiple write requests for the same object\n simultaneously, it overwrites all but the last object written. However, Amazon S3 provides features that can modify this behavior:

\n \n
\n
Permissions
\n
\n \n
\n
Data integrity with Content-MD5
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

For more information about related Amazon S3 APIs, see the following:

\n ", "smithy.api#examples": [ { - "title": "To upload an object", - "documentation": "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.", + "title": "To upload object and specify user-defined metadata", + "documentation": "The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.", "input": { - "Body": "HappyFace.jpg", + "Body": "filetoupload", "Bucket": "examplebucket", - "Key": "HappyFace.jpg" + "Key": "exampleobject", + "Metadata": { + "metadata1": "value1", + "metadata2": "value2" + } }, "output": { - "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk", + "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0", "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"" } }, @@ -30608,46 +30574,56 @@ } }, { - "title": "To upload object and specify user-defined metadata", - "documentation": "The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response.", + "title": "To upload an object and specify optional tags", + "documentation": "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.", "input": { - "Body": "filetoupload", + "Body": "c:\\HappyFace.jpg", "Bucket": "examplebucket", - "Key": "exampleobject", - "Metadata": { - "metadata1": "value1", - "metadata2": "value2" - } + "Key": "HappyFace.jpg", + "Tagging": "key1=value1&key2=value2" }, "output": { - "VersionId": "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0", + "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a", "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"" } }, { - "title": "To upload an object and specify canned ACL.", - "documentation": "The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.", + "title": "To create an object.", + "documentation": "The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.", "input": { - "ACL": "authenticated-read", "Body": "filetoupload", "Bucket": "examplebucket", - "Key": "exampleobject" + "Key": "objectkey" }, "output": { - "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr", + "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ", "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"" } }, { - "title": "To create an object.", - "documentation": "The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.", + "title": "To upload an object", + "documentation": "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.", + "input": { + "Body": "HappyFace.jpg", + "Bucket": "examplebucket", + "Key": "HappyFace.jpg" + }, + "output": { + "VersionId": "tpf3zF08nBplQK1XLOefGskR7mGDwcDk", + "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"" + } + }, + { + "title": "To upload an object and specify canned ACL.", + "documentation": "The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.", "input": { + "ACL": "authenticated-read", "Body": "filetoupload", "Bucket": "examplebucket", - "Key": "objectkey" + "Key": "exampleobject" }, "output": { - "VersionId": "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ", + "VersionId": "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr", "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"" } }, @@ -30666,20 +30642,6 @@ "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"", "ServerSideEncryption": "AES256" } - }, - { - "title": "To upload an object and specify optional tags", - "documentation": "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.", - "input": { - "Body": "c:\\HappyFace.jpg", - "Bucket": "examplebucket", - "Key": "HappyFace.jpg", - "Tagging": "key1=value1&key2=value2" - }, - "output": { - "VersionId": "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a", - "ETag": "\"6805f2cfc46c0f04559748bb039d69ae\"" - } } ], "smithy.api#http": { @@ -32319,7 +32281,7 @@ ], "smithy.api#http": { "method": "POST", - "uri": "/{Bucket}/{Key+}?restore&x-id=RestoreObject", + "uri": "/{Bucket}/{Key+}?restore", "code": 200 } } @@ -32673,7 +32635,7 @@ "smithy.api#documentation": "\n

This operation is not supported by directory buckets.

\n
\n

This action filters the contents of an Amazon S3 object based on a simple structured query\n language (SQL) statement. In the request, along with the SQL expression, you must also\n specify a data serialization format (JSON, CSV, or Apache Parquet) of the object. Amazon S3 uses\n this format to parse object data into records, and returns only records that match the\n specified SQL expression. You must also specify the data serialization format for the\n response.

\n

This functionality is not supported for Amazon S3 on Outposts.

\n

For more information about Amazon S3 Select, see Selecting Content from\n Objects and SELECT\n Command in the Amazon S3 User Guide.

\n

\n
\n
Permissions
\n
\n

You must have the s3:GetObject permission for this operation. Amazon S3\n Select does not support anonymous access. For more information about permissions,\n see Specifying Permissions in\n a Policy in the Amazon S3 User Guide.

\n
\n
Object Data Formats
\n
\n

You can use Amazon S3 Select to query objects that have the following format\n properties:

\n \n
\n
Working with the Response Body
\n
\n

Given the response size is unknown, Amazon S3 Select streams the response as a\n series of messages and includes a Transfer-Encoding header with\n chunked as its value in the response. For more information, see\n Appendix:\n SelectObjectContent\n Response.

\n
\n
GetObject Support
\n
\n

The SelectObjectContent action does not support the following\n GetObject functionality. For more information, see GetObject.

\n \n
\n
Special Errors
\n
\n

For a list of special errors for this operation, see List of SELECT Object Content Error Codes\n

\n
\n
\n

The following operations are related to SelectObjectContent:

\n ", "smithy.api#http": { "method": "POST", - "uri": "/{Bucket}/{Key+}?select&select-type=2&x-id=SelectObjectContent", + "uri": "/{Bucket}/{Key+}?select&select-type=2", "code": 200 } } @@ -34151,7 +34113,7 @@ }, "smithy.api#http": { "method": "POST", - "uri": "/WriteGetObjectResponse?x-id=WriteGetObjectResponse", + "uri": "/WriteGetObjectResponse", "code": 200 }, "smithy.rules#staticContextParams": {