Skip to content

Commit 764fa09

Browse files
Adding checksum support for S3 PutBucketOwnershipControls API.
1 parent 2ecce61 commit 764fa09

File tree

14 files changed

+837
-1081
lines changed

14 files changed

+837
-1081
lines changed

generator/ServiceModels/s3/s3-2006-03-01.api.json

Lines changed: 39 additions & 105 deletions
Large diffs are not rendered by default.

generator/ServiceModels/s3/s3-2006-03-01.docs.json

Lines changed: 183 additions & 358 deletions
Large diffs are not rendered by default.

generator/ServiceModels/s3/s3-2006-03-01.examples.json

Lines changed: 241 additions & 390 deletions
Large diffs are not rendered by default.

generator/ServiceModels/s3/s3-2006-03-01.normal.json

Lines changed: 37 additions & 102 deletions
Large diffs are not rendered by default.

sdk/src/Services/S3/Custom/Model/GetObjectAttributesRequest.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ internal bool IsSetKey()
328328
/// <summary>
329329
/// Gets and sets the property MaxParts.
330330
/// <para>
331-
/// Sets the maximum number of parts to return.
331+
/// Sets the maximum number of parts to return. For more information, see
332+
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html">
333+
/// Uploading and copying objects using multipart upload in Amazon S3 </a> in the <i>Amazon Simple Storage Service user guide</i>.
332334
/// </para>
333335
/// </summary>
334336
public int MaxParts
@@ -365,8 +367,9 @@ internal bool IsSetObjectAttributes()
365367
/// <summary>
366368
/// Gets and sets the property PartNumberMarker.
367369
/// <para>
368-
/// Specifies the part after which listing should begin. Only parts with higher part numbers
369-
/// will be listed.
370+
/// Specifies the part after which listing should begin. Only parts with higher part numbers will be listed. For more information,
371+
/// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html">
372+
/// Uploading and copying objects using multipart upload in Amazon S3 </a> in the <i>Amazon Simple Storage Service user guide</i>.
370373
/// </para>
371374
/// </summary>
372375
public int PartNumberMarker

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsRequestMarshaller.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public IRequest Marshall(PutBucketOwnershipControlsRequest putBucketOwnershipCon
5151
if (putBucketOwnershipControlsRequest.IsSetExpectedBucketOwner())
5252
request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(putBucketOwnershipControlsRequest.ExpectedBucketOwner));
5353

54+
if (putBucketOwnershipControlsRequest.IsSetChecksumAlgorithm())
55+
request.Headers.Add(S3Constants.AmzHeaderSdkChecksumAlgorithm, S3Transforms.ToStringValue(putBucketOwnershipControlsRequest.ChecksumAlgorithm));
56+
5457
request.ResourcePath = "/";
5558

5659
request.AddSubResource("ownershipControls");
@@ -86,9 +89,13 @@ public IRequest Marshall(PutBucketOwnershipControlsRequest putBucketOwnershipCon
8689
request.Content = System.Text.Encoding.UTF8.GetBytes(content);
8790
request.Headers[HeaderKeys.ContentTypeHeader] = "application/xml";
8891

89-
// This operation is modeled with "httpChecksum":{"requestChecksumRequired":true}, but S3 doesn't validate the checksum at the moment.
90-
// We'll use the default behavior for now (which is to populate the Content-MD5 header).
91-
ChecksumUtils.SetChecksumData(request);
92+
ChecksumUtils.SetChecksumData(
93+
request,
94+
putBucketOwnershipControlsRequest.ChecksumAlgorithm,
95+
fallbackToMD5: false,
96+
isRequestChecksumRequired: true,
97+
headerName: S3Constants.AmzHeaderSdkChecksumAlgorithm
98+
);
9299
}
93100
catch (EncoderFallbackException e)
94101
{

sdk/src/Services/S3/Custom/Model/LifecycleRule.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ internal bool IsSetNoncurrentVersionExpiration()
102102

103103
/// <summary>
104104
/// Filter identifying one or more objects to which the rule applies.
105+
/// <para>
106+
/// The <c>Filter</c> is used to identify objects that a Lifecycle Rule applies to. A <c>Filter</c> must have exactly one of
107+
/// <c>Prefix</c>, <c>Tag</c>, <c>ObjectSizeGreaterThan</c>, <c>ObjectSizeLessThan</c>, or <c>And</c> specified.
108+
/// <c>Filter</c> is required if the <c>LifecycleRule</c> does not contain a <c>Prefix</c> element.
109+
/// </para>
110+
/// <note>
111+
/// <para>
112+
/// <c>Tag</c> filters are not supported for directory buckets.
113+
/// </para>
114+
/// </note>
105115
/// </summary>
106116
public LifecycleFilter Filter
107117
{

sdk/src/Services/S3/Custom/Model/PutBucketOwnershipControlsRequest.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public partial class PutBucketOwnershipControlsRequest : AmazonWebServiceRequest
5757
private string bucketName;
5858
private string expectedBucketOwner;
5959
private OwnershipControls ownershipControls;
60+
private ChecksumAlgorithm _checksumAlgorithm;
6061

6162
/// <summary>
6263
/// The name of the Amazon S3 bucket whose OwnershipControls you want to set
@@ -105,5 +106,35 @@ public OwnershipControls OwnershipControls
105106
get { return this.ownershipControls; }
106107
set { this.ownershipControls = value; }
107108
}
109+
/// <summary>
110+
/// Gets and sets the property ChecksumAlgorithm.
111+
/// <para>
112+
/// Indicates the algorithm used to create the checksum for the object when you use the
113+
/// SDK. This header will not provide any additional functionality if you don't use the
114+
/// SDK. When you send this header, there must be a corresponding <c>x-amz-checksum-<i>algorithm</i>
115+
/// </c> or <c>x-amz-trailer</c> header sent. Otherwise, Amazon S3 fails the
116+
/// request with the HTTP status code <c>400 Bad Request</c>.
117+
/// </para>
118+
///
119+
/// <para>
120+
/// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html">Checking
121+
/// object integrity</a> in the <i>Amazon S3 User Guide</i>.
122+
/// </para>
123+
///
124+
/// <para>
125+
/// If you provide an individual checksum, Amazon S3 ignores any provided <c>ChecksumAlgorithm</c> parameter.
126+
/// </para>
127+
/// </summary>
128+
public ChecksumAlgorithm ChecksumAlgorithm
129+
{
130+
get { return this._checksumAlgorithm; }
131+
set { this._checksumAlgorithm = value; }
132+
}
133+
134+
// Check to see if ChecksumAlgorithm property is set
135+
internal bool IsSetChecksumAlgorithm()
136+
{
137+
return this._checksumAlgorithm != null;
138+
}
108139
}
109140
}

sdk/src/Services/S3/Generated/_bcl35/AmazonS3Client.cs

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8484,13 +8484,13 @@ public virtual GetObjectResponse EndGetObject(IAsyncResult asyncResult)
84848484
#region GetObjectAttributes
84858485

84868486
/// <summary>
8487-
/// Retrieves all the metadata from an object without returning the object itself. This
8488-
/// operation is useful if you're interested only in an object's metadata.
8487+
/// Retrieves all of the metadata from an object without returning the object itself.
8488+
/// This operation is useful if you're interested only in an object's metadata.
84898489
///
84908490
///
84918491
/// <para>
84928492
/// <c>GetObjectAttributes</c> combines the functionality of <c>HeadObject</c> and <c>ListParts</c>.
8493-
/// All of the data returned with each of those individual calls can be returned with
8493+
/// All of the data returned with both of those individual calls can be returned with
84948494
/// a single call to <c>GetObjectAttributes</c>.
84958495
/// </para>
84968496
/// <note>
@@ -8507,14 +8507,33 @@ public virtual GetObjectResponse EndGetObject(IAsyncResult asyncResult)
85078507
/// </note> <dl> <dt>Permissions</dt> <dd> <ul> <li>
85088508
/// <para>
85098509
/// <b>General purpose bucket permissions</b> - To use <c>GetObjectAttributes</c>, you
8510-
/// must have READ access to the object. The permissions that you need to use this operation
8511-
/// depend on whether the bucket is versioned. If the bucket is versioned, you need both
8512-
/// the <c>s3:GetObjectVersion</c> and <c>s3:GetObjectVersionAttributes</c> permissions
8513-
/// for this operation. If the bucket is not versioned, you need the <c>s3:GetObject</c>
8514-
/// and <c>s3:GetObjectAttributes</c> permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying
8515-
/// Permissions in a Policy</a> in the <i>Amazon S3 User Guide</i>. If the object that
8516-
/// you request does not exist, the error Amazon S3 returns depends on whether you also
8517-
/// have the <c>s3:ListBucket</c> permission.
8510+
/// must have READ access to the object.
8511+
/// </para>
8512+
///
8513+
/// <para>
8514+
/// The other permissions that you need to use this operation depend on whether the bucket
8515+
/// is versioned and if a version ID is passed in the <c>GetObjectAttributes</c> request.
8516+
///
8517+
/// </para>
8518+
/// <ul> <li>
8519+
/// <para>
8520+
/// If you pass a version ID in your request, you need both the <c>s3:GetObjectVersion</c>
8521+
/// and <c>s3:GetObjectVersionAttributes</c> permissions.
8522+
/// </para>
8523+
/// </li> <li>
8524+
/// <para>
8525+
/// If you do not pass a version ID in your request, you need the <c>s3:GetObject</c>
8526+
/// and <c>s3:GetObjectAttributes</c> permissions.
8527+
/// </para>
8528+
/// </li> </ul>
8529+
/// <para>
8530+
/// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying
8531+
/// Permissions in a Policy</a> in the <i>Amazon S3 User Guide</i>.
8532+
/// </para>
8533+
///
8534+
/// <para>
8535+
/// If the object that you request does not exist, the error Amazon S3 returns depends
8536+
/// on whether you also have the <c>s3:ListBucket</c> permission.
85188537
/// </para>
85198538
/// <ul> <li>
85208539
/// <para>
@@ -8561,10 +8580,11 @@ public virtual GetObjectResponse EndGetObject(IAsyncResult asyncResult)
85618580
/// </para>
85628581
/// </note>
85638582
/// <para>
8564-
/// If you encrypt an object by using server-side encryption with customer-provided encryption
8565-
/// keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata
8566-
/// from the object, you must use the following headers to provide the encryption key
8567-
/// for the server to be able to retrieve the object's metadata. The headers are:
8583+
/// If you encrypted an object when you stored the object in Amazon S3 by using server-side
8584+
/// encryption with customer-provided encryption keys (SSE-C), then when you retrieve
8585+
/// the metadata from the object, you must use the following headers. These headers provide
8586+
/// the server with the encryption key required to retrieve the object's metadata. The
8587+
/// headers are:
85688588
/// </para>
85698589
/// <ul> <li>
85708590
/// <para>

sdk/src/Services/S3/Generated/_bcl35/IAmazonS3.cs

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7417,13 +7417,13 @@ public partial interface IAmazonS3 : IAmazonService, IDisposable
74177417

74187418

74197419
/// <summary>
7420-
/// Retrieves all the metadata from an object without returning the object itself. This
7421-
/// operation is useful if you're interested only in an object's metadata.
7420+
/// Retrieves all of the metadata from an object without returning the object itself.
7421+
/// This operation is useful if you're interested only in an object's metadata.
74227422
///
74237423
///
74247424
/// <para>
74257425
/// <c>GetObjectAttributes</c> combines the functionality of <c>HeadObject</c> and <c>ListParts</c>.
7426-
/// All of the data returned with each of those individual calls can be returned with
7426+
/// All of the data returned with both of those individual calls can be returned with
74277427
/// a single call to <c>GetObjectAttributes</c>.
74287428
/// </para>
74297429
/// <note>
@@ -7440,14 +7440,33 @@ public partial interface IAmazonS3 : IAmazonService, IDisposable
74407440
/// </note> <dl> <dt>Permissions</dt> <dd> <ul> <li>
74417441
/// <para>
74427442
/// <b>General purpose bucket permissions</b> - To use <c>GetObjectAttributes</c>, you
7443-
/// must have READ access to the object. The permissions that you need to use this operation
7444-
/// depend on whether the bucket is versioned. If the bucket is versioned, you need both
7445-
/// the <c>s3:GetObjectVersion</c> and <c>s3:GetObjectVersionAttributes</c> permissions
7446-
/// for this operation. If the bucket is not versioned, you need the <c>s3:GetObject</c>
7447-
/// and <c>s3:GetObjectAttributes</c> permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying
7448-
/// Permissions in a Policy</a> in the <i>Amazon S3 User Guide</i>. If the object that
7449-
/// you request does not exist, the error Amazon S3 returns depends on whether you also
7450-
/// have the <c>s3:ListBucket</c> permission.
7443+
/// must have READ access to the object.
7444+
/// </para>
7445+
///
7446+
/// <para>
7447+
/// The other permissions that you need to use this operation depend on whether the bucket
7448+
/// is versioned and if a version ID is passed in the <c>GetObjectAttributes</c> request.
7449+
///
7450+
/// </para>
7451+
/// <ul> <li>
7452+
/// <para>
7453+
/// If you pass a version ID in your request, you need both the <c>s3:GetObjectVersion</c>
7454+
/// and <c>s3:GetObjectVersionAttributes</c> permissions.
7455+
/// </para>
7456+
/// </li> <li>
7457+
/// <para>
7458+
/// If you do not pass a version ID in your request, you need the <c>s3:GetObject</c>
7459+
/// and <c>s3:GetObjectAttributes</c> permissions.
7460+
/// </para>
7461+
/// </li> </ul>
7462+
/// <para>
7463+
/// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying
7464+
/// Permissions in a Policy</a> in the <i>Amazon S3 User Guide</i>.
7465+
/// </para>
7466+
///
7467+
/// <para>
7468+
/// If the object that you request does not exist, the error Amazon S3 returns depends
7469+
/// on whether you also have the <c>s3:ListBucket</c> permission.
74517470
/// </para>
74527471
/// <ul> <li>
74537472
/// <para>
@@ -7494,10 +7513,11 @@ public partial interface IAmazonS3 : IAmazonService, IDisposable
74947513
/// </para>
74957514
/// </note>
74967515
/// <para>
7497-
/// If you encrypt an object by using server-side encryption with customer-provided encryption
7498-
/// keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata
7499-
/// from the object, you must use the following headers to provide the encryption key
7500-
/// for the server to be able to retrieve the object's metadata. The headers are:
7516+
/// If you encrypted an object when you stored the object in Amazon S3 by using server-side
7517+
/// encryption with customer-provided encryption keys (SSE-C), then when you retrieve
7518+
/// the metadata from the object, you must use the following headers. These headers provide
7519+
/// the server with the encryption key required to retrieve the object's metadata. The
7520+
/// headers are:
75017521
/// </para>
75027522
/// <ul> <li>
75037523
/// <para>

0 commit comments

Comments
 (0)