Skip to content

Commit abeb216

Browse files
Adding checksum support for S3 PutBucketOwnershipControls API.
1 parent cd9d952 commit abeb216

File tree

12 files changed

+768
-1051
lines changed

12 files changed

+768
-1051
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
@@ -101,6 +101,16 @@ internal bool IsSetNoncurrentVersionExpiration()
101101

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

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

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

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

Lines changed: 70 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13699,13 +13699,13 @@ public virtual GetObjectAclResponse GetObjectAcl(GetObjectAclRequest request)
1369913699

1370013700

1370113701
/// <summary>
13702-
/// Retrieves all the metadata from an object without returning the object itself. This
13703-
/// operation is useful if you're interested only in an object's metadata.
13702+
/// Retrieves all of the metadata from an object without returning the object itself.
13703+
/// This operation is useful if you're interested only in an object's metadata.
1370413704
///
1370513705
///
1370613706
/// <para>
1370713707
/// <c>GetObjectAttributes</c> combines the functionality of <c>HeadObject</c> and <c>ListParts</c>.
13708-
/// All of the data returned with each of those individual calls can be returned with
13708+
/// All of the data returned with both of those individual calls can be returned with
1370913709
/// a single call to <c>GetObjectAttributes</c>.
1371013710
/// </para>
1371113711
/// <note>
@@ -13722,14 +13722,33 @@ public virtual GetObjectAclResponse GetObjectAcl(GetObjectAclRequest request)
1372213722
/// </note> <dl> <dt>Permissions</dt> <dd> <ul> <li>
1372313723
/// <para>
1372413724
/// <b>General purpose bucket permissions</b> - To use <c>GetObjectAttributes</c>, you
13725-
/// must have READ access to the object. The permissions that you need to use this operation
13726-
/// depend on whether the bucket is versioned. If the bucket is versioned, you need both
13727-
/// the <c>s3:GetObjectVersion</c> and <c>s3:GetObjectVersionAttributes</c> permissions
13728-
/// for this operation. If the bucket is not versioned, you need the <c>s3:GetObject</c>
13729-
/// 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
13730-
/// Permissions in a Policy</a> in the <i>Amazon S3 User Guide</i>. If the object that
13731-
/// you request does not exist, the error Amazon S3 returns depends on whether you also
13732-
/// have the <c>s3:ListBucket</c> permission.
13725+
/// must have READ access to the object.
13726+
/// </para>
13727+
///
13728+
/// <para>
13729+
/// The other permissions that you need to use this operation depend on whether the bucket
13730+
/// is versioned and if a version ID is passed in the <c>GetObjectAttributes</c> request.
13731+
///
13732+
/// </para>
13733+
/// <ul> <li>
13734+
/// <para>
13735+
/// If you pass a version ID in your request, you need both the <c>s3:GetObjectVersion</c>
13736+
/// and <c>s3:GetObjectVersionAttributes</c> permissions.
13737+
/// </para>
13738+
/// </li> <li>
13739+
/// <para>
13740+
/// If you do not pass a version ID in your request, you need the <c>s3:GetObject</c>
13741+
/// and <c>s3:GetObjectAttributes</c> permissions.
13742+
/// </para>
13743+
/// </li> </ul>
13744+
/// <para>
13745+
/// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying
13746+
/// Permissions in a Policy</a> in the <i>Amazon S3 User Guide</i>.
13747+
/// </para>
13748+
///
13749+
/// <para>
13750+
/// If the object that you request does not exist, the error Amazon S3 returns depends
13751+
/// on whether you also have the <c>s3:ListBucket</c> permission.
1373313752
/// </para>
1373413753
/// <ul> <li>
1373513754
/// <para>
@@ -13776,10 +13795,11 @@ public virtual GetObjectAclResponse GetObjectAcl(GetObjectAclRequest request)
1377613795
/// </para>
1377713796
/// </note>
1377813797
/// <para>
13779-
/// If you encrypt an object by using server-side encryption with customer-provided encryption
13780-
/// keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata
13781-
/// from the object, you must use the following headers to provide the encryption key
13782-
/// for the server to be able to retrieve the object's metadata. The headers are:
13798+
/// If you encrypted an object when you stored the object in Amazon S3 by using server-side
13799+
/// encryption with customer-provided encryption keys (SSE-C), then when you retrieve
13800+
/// the metadata from the object, you must use the following headers. These headers provide
13801+
/// the server with the encryption key required to retrieve the object's metadata. The
13802+
/// headers are:
1378313803
/// </para>
1378413804
/// <ul> <li>
1378513805
/// <para>
@@ -13927,13 +13947,13 @@ public virtual GetObjectAttributesResponse GetObjectAttributes(GetObjectAttribut
1392713947

1392813948

1392913949
/// <summary>
13930-
/// Retrieves all the metadata from an object without returning the object itself. This
13931-
/// operation is useful if you're interested only in an object's metadata.
13950+
/// Retrieves all of the metadata from an object without returning the object itself.
13951+
/// This operation is useful if you're interested only in an object's metadata.
1393213952
///
1393313953
///
1393413954
/// <para>
1393513955
/// <c>GetObjectAttributes</c> combines the functionality of <c>HeadObject</c> and <c>ListParts</c>.
13936-
/// All of the data returned with each of those individual calls can be returned with
13956+
/// All of the data returned with both of those individual calls can be returned with
1393713957
/// a single call to <c>GetObjectAttributes</c>.
1393813958
/// </para>
1393913959
/// <note>
@@ -13950,14 +13970,33 @@ public virtual GetObjectAttributesResponse GetObjectAttributes(GetObjectAttribut
1395013970
/// </note> <dl> <dt>Permissions</dt> <dd> <ul> <li>
1395113971
/// <para>
1395213972
/// <b>General purpose bucket permissions</b> - To use <c>GetObjectAttributes</c>, you
13953-
/// must have READ access to the object. The permissions that you need to use this operation
13954-
/// depend on whether the bucket is versioned. If the bucket is versioned, you need both
13955-
/// the <c>s3:GetObjectVersion</c> and <c>s3:GetObjectVersionAttributes</c> permissions
13956-
/// for this operation. If the bucket is not versioned, you need the <c>s3:GetObject</c>
13957-
/// 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
13958-
/// Permissions in a Policy</a> in the <i>Amazon S3 User Guide</i>. If the object that
13959-
/// you request does not exist, the error Amazon S3 returns depends on whether you also
13960-
/// have the <c>s3:ListBucket</c> permission.
13973+
/// must have READ access to the object.
13974+
/// </para>
13975+
///
13976+
/// <para>
13977+
/// The other permissions that you need to use this operation depend on whether the bucket
13978+
/// is versioned and if a version ID is passed in the <c>GetObjectAttributes</c> request.
13979+
///
13980+
/// </para>
13981+
/// <ul> <li>
13982+
/// <para>
13983+
/// If you pass a version ID in your request, you need both the <c>s3:GetObjectVersion</c>
13984+
/// and <c>s3:GetObjectVersionAttributes</c> permissions.
13985+
/// </para>
13986+
/// </li> <li>
13987+
/// <para>
13988+
/// If you do not pass a version ID in your request, you need the <c>s3:GetObject</c>
13989+
/// and <c>s3:GetObjectAttributes</c> permissions.
13990+
/// </para>
13991+
/// </li> </ul>
13992+
/// <para>
13993+
/// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying
13994+
/// Permissions in a Policy</a> in the <i>Amazon S3 User Guide</i>.
13995+
/// </para>
13996+
///
13997+
/// <para>
13998+
/// If the object that you request does not exist, the error Amazon S3 returns depends
13999+
/// on whether you also have the <c>s3:ListBucket</c> permission.
1396114000
/// </para>
1396214001
/// <ul> <li>
1396314002
/// <para>
@@ -14004,10 +14043,11 @@ public virtual GetObjectAttributesResponse GetObjectAttributes(GetObjectAttribut
1400414043
/// </para>
1400514044
/// </note>
1400614045
/// <para>
14007-
/// If you encrypt an object by using server-side encryption with customer-provided encryption
14008-
/// keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata
14009-
/// from the object, you must use the following headers to provide the encryption key
14010-
/// for the server to be able to retrieve the object's metadata. The headers are:
14046+
/// If you encrypted an object when you stored the object in Amazon S3 by using server-side
14047+
/// encryption with customer-provided encryption keys (SSE-C), then when you retrieve
14048+
/// the metadata from the object, you must use the following headers. These headers provide
14049+
/// the server with the encryption key required to retrieve the object's metadata. The
14050+
/// headers are:
1401114051
/// </para>
1401214052
/// <ul> <li>
1401314053
/// <para>

0 commit comments

Comments
 (0)