diff --git a/generator/.DevConfigs/3d12779c-4e5d-4021-9592-7e0060b2fa80.json b/generator/.DevConfigs/3d12779c-4e5d-4021-9592-7e0060b2fa80.json new file mode 100644 index 000000000000..fef1d93dae81 --- /dev/null +++ b/generator/.DevConfigs/3d12779c-4e5d-4021-9592-7e0060b2fa80.json @@ -0,0 +1,11 @@ +{ + "services": [ + { + "serviceName": "S3", + "type": "patch", + "changeLogMessages": [ + "Generate PutBucketOwnershipControls S3 operation" + ] + } + ] +} \ No newline at end of file diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 36758dc20b63..5cfd504801e2 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -576,6 +576,7 @@ public List S3AllowListOperations new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"]), new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"]), new Operation(this, "RenameObject", DocumentRoot[OperationsKey]["RenameObject"]), + new Operation(this, "PutBucketOwnershipControls", DocumentRoot[OperationsKey]["PutBucketOwnershipControls"]), }; } return _s3AllowListOperations.Where(operation => operation.data != null).ToList(); diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 79d32830cec5..58b9e0605459 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1245,6 +1245,13 @@ "SourceIfNoneMatch" :{"injectXmlIsSet":["return !string.IsNullOrEmpty(this._sourceIfNoneMatch);"]} } ] + }, + "PutBucketOwnershipControlsRequest":{ + "modify":[ + { + "ExpectedBucketOwner" :{"injectXmlIsSet":["return !string.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsRequestMarshaller.cs deleted file mode 100644 index eb32878b6590..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsRequestMarshaller.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Xml; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.Runtime.Internal.Util; -using Amazon.S3.Util; -using Amazon.Util; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// PutBucketOwnershipControls Request Marshaller - /// - public class PutBucketOwnershipControlsRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((PutBucketOwnershipControlsRequest)input); - } - - public IRequest Marshall(PutBucketOwnershipControlsRequest putBucketOwnershipControlsRequest) - { - IRequest request = new DefaultRequest(putBucketOwnershipControlsRequest, "Amazon.S3"); - - request.HttpMethod = "PUT"; - - if (string.IsNullOrEmpty(putBucketOwnershipControlsRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "PutBucketOwnershipControlsRequest.BucketName"); - - if (putBucketOwnershipControlsRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(putBucketOwnershipControlsRequest.ExpectedBucketOwner)); - - if (putBucketOwnershipControlsRequest.IsSetChecksumAlgorithm()) - request.Headers.Add(S3Constants.AmzHeaderSdkChecksumAlgorithm, S3Transforms.ToStringValue(putBucketOwnershipControlsRequest.ChecksumAlgorithm)); - - request.ResourcePath = "/"; - - request.AddSubResource("ownershipControls"); - - var stringWriter = new XMLEncodedStringWriter(System.Globalization.CultureInfo.InvariantCulture); - using (var xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings() { Encoding = Encoding.UTF8, OmitXmlDeclaration = true, NewLineHandling = NewLineHandling.Entitize })) - { - var ownershipControls = putBucketOwnershipControlsRequest.OwnershipControls; - - if (ownershipControls != null) - { - xmlWriter.WriteStartElement("OwnershipControls", S3Constants.S3RequestXmlNamespace); - - if (ownershipControls.Rules != null) - { - foreach (var rule in ownershipControls.Rules) - { - xmlWriter.WriteStartElement("Rule"); - if (rule.IsSetObjectOwnership()) - { - xmlWriter.WriteElementString("ObjectOwnership", S3Transforms.ToXmlStringValue(rule.ObjectOwnership)); - } - xmlWriter.WriteEndElement(); - } - } - xmlWriter.WriteEndElement(); - } - } - - try - { - var content = stringWriter.ToString(); - request.Content = System.Text.Encoding.UTF8.GetBytes(content); - request.Headers[HeaderKeys.ContentTypeHeader] = "application/xml"; - - ChecksumUtils.SetChecksumData( - request, - putBucketOwnershipControlsRequest.ChecksumAlgorithm, - fallbackToMD5: false, - isRequestChecksumRequired: true, - headerName: S3Constants.AmzHeaderSdkChecksumAlgorithm - ); - } - catch (EncoderFallbackException e) - { - throw new AmazonServiceException("Unable to marshall request to XML", e); - } - - return request; - } - - private static PutBucketOwnershipControlsRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static PutBucketOwnershipControlsRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketOwnershipControlsRequestMarshaller(); - } - return _instance; - } - } - - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsResponseUnmarshaller.cs deleted file mode 100644 index 65ad4d231099..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsResponseUnmarshaller.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Amazon.Runtime; -using Amazon.Runtime.Internal.Transform; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for PutBucketOwnershipControls operation - /// - public class PutBucketOwnershipControlsResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - PutBucketOwnershipControlsResponse response = new PutBucketOwnershipControlsResponse(); - - return response; - } - - private static PutBucketOwnershipControlsResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static PutBucketOwnershipControlsResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketOwnershipControlsResponseUnmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketOwnershipControlsRequest.cs b/sdk/src/Services/S3/Custom/Model/PutBucketOwnershipControlsRequest.cs deleted file mode 100644 index efcaf095c3d7..000000000000 --- a/sdk/src/Services/S3/Custom/Model/PutBucketOwnershipControlsRequest.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Amazon.Runtime; - -namespace Amazon.S3.Model -{ - /// - /// Container for the parameters to the PutBucketOwnershipControls operation. - /// - /// - /// This operation is not supported by directory buckets. - /// - /// - /// - /// Creates or modifies OwnershipControls for an Amazon S3 bucket. To use - /// this operation, you must have the s3:PutBucketOwnershipControls permission. - /// For more information about Amazon S3 permissions, see Specifying - /// permissions in a policy. - /// - /// - /// - /// For information about Amazon S3 Object Ownership, see Using - /// object ownership. - /// - /// - /// - /// The following operations are related to PutBucketOwnershipControls: - /// - /// - /// - public partial class PutBucketOwnershipControlsRequest : AmazonWebServiceRequest - { - private string bucketName; - private string expectedBucketOwner; - private OwnershipControls ownershipControls; - private ChecksumAlgorithm _checksumAlgorithm; - - /// - /// The name of the Amazon S3 bucket whose OwnershipControls you want to set - /// - public string BucketName - { - get { return this.bucketName; } - set { this.bucketName = value; } - } - - - // Check to see if BucketName property is set - internal bool IsSetBucketName() - { - return this.BucketName != null; - } - - /// - ///

The account ID of the expected bucket owner. If the bucket is owned by a different account, - /// the request will fail with an HTTP 403 (Access Denied) error.

- ///
- public string ExpectedBucketOwner - { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } - } - - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() - { - return !String.IsNullOrEmpty(this.expectedBucketOwner); - } - - /// - /// Gets and sets the property OwnershipControls. - /// - /// The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or - /// ObjectWriter) that you want to apply to this Amazon S3 bucket. - /// - /// - public OwnershipControls OwnershipControls - { - get { return this.ownershipControls; } - set { this.ownershipControls = value; } - } - - /// - /// Gets and sets the property ChecksumAlgorithm. - /// - /// Indicates the algorithm used to create the checksum for the object when you use the - /// SDK. This header will not provide any additional functionality if you don't use the - /// SDK. When you send this header, there must be a corresponding x-amz-checksum-algorithm - /// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the - /// request with the HTTP status code 400 Bad Request. - /// - /// - /// - /// For more information, see Checking - /// object integrity in the Amazon S3 User Guide. - /// - /// - /// - /// If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter. - /// - /// - public ChecksumAlgorithm ChecksumAlgorithm - { - get { return this._checksumAlgorithm; } - set { this._checksumAlgorithm = value; } - } - - // Check to see if ChecksumAlgorithm property is set - internal bool IsSetChecksumAlgorithm() - { - return this._checksumAlgorithm != null; - } - } -} diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsRequestMarshaller.cs new file mode 100644 index 000000000000..0bc5e97e1929 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsRequestMarshaller.cs @@ -0,0 +1,146 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +using System.Xml; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// PutBucketOwnershipControls Request Marshaller + /// + public partial class PutBucketOwnershipControlsRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((PutBucketOwnershipControlsRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(PutBucketOwnershipControlsRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "PUT"; + request.AddSubResource("ownershipControls"); + + if (publicRequest.IsSetChecksumAlgorithm()) + { + request.Headers["x-amz-sdk-checksum-algorithm"] = publicRequest.ChecksumAlgorithm; + } + + if (publicRequest.IsSetContentMD5()) + { + request.Headers["Content-MD5"] = publicRequest.ContentMD5; + } + + if (publicRequest.IsSetExpectedBucketOwner()) + { + request.Headers["x-amz-expected-bucket-owner"] = publicRequest.ExpectedBucketOwner; + } + if (string.IsNullOrEmpty(publicRequest.BucketName)) + throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "PutBucketOwnershipControlsRequest.BucketName"); + request.ResourcePath = "/"; + var stringWriter = new XMLEncodedStringWriter(CultureInfo.InvariantCulture); + using (var xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings() { Encoding = System.Text.Encoding.UTF8, OmitXmlDeclaration = true, NewLineHandling = NewLineHandling.Entitize })) + { + if (publicRequest.IsSetOwnershipControls()) + { + xmlWriter.WriteStartElement("OwnershipControls", "http://s3.amazonaws.com/doc/2006-03-01/"); + var publicRequestOwnershipControlsRules = publicRequest.OwnershipControls.Rules; + if (publicRequestOwnershipControlsRules != null && (publicRequestOwnershipControlsRules.Count > 0 || !AWSConfigs.InitializeCollections)) + { + foreach (var publicRequestOwnershipControlsRulesValue in publicRequestOwnershipControlsRules) + { + if (publicRequestOwnershipControlsRulesValue != null) + { + xmlWriter.WriteStartElement("Rule"); + if(publicRequestOwnershipControlsRulesValue.IsSetObjectOwnership()) + xmlWriter.WriteElementString("ObjectOwnership", StringUtils.FromString(publicRequestOwnershipControlsRulesValue.ObjectOwnership)); + xmlWriter.WriteEndElement(); + } + } + } + + xmlWriter.WriteEndElement(); + } + } + PostMarshallCustomization(request, publicRequest); + try + { + string content = stringWriter.ToString(); + request.Content = System.Text.Encoding.UTF8.GetBytes(content); + request.Headers["Content-Type"] = "application/xml"; + ChecksumUtils.SetChecksumData( + request, + publicRequest.ChecksumAlgorithm, + fallbackToMD5: false, + isRequestChecksumRequired: true, + headerName: "x-amz-sdk-checksum-algorithm" + ); + request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2006-03-01"; + } + catch (EncoderFallbackException e) + { + throw new AmazonServiceException("Unable to marshall request to XML", e); + } + return request; + } + private static PutBucketOwnershipControlsRequestMarshaller _instance = new PutBucketOwnershipControlsRequestMarshaller(); + + internal static PutBucketOwnershipControlsRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketOwnershipControlsRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketOwnershipControlsRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, PutBucketOwnershipControlsRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsResponseUnmarshaller.cs new file mode 100644 index 000000000000..028475e97239 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketOwnershipControlsResponseUnmarshaller.cs @@ -0,0 +1,98 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// Response Unmarshaller for PutBucketOwnershipControls operation + /// + public partial class PutBucketOwnershipControlsResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + PutBucketOwnershipControlsResponse response = new PutBucketOwnershipControlsResponse(); + + PostUnmarshallCustomization(context, response); + return response; + } + + + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, PutBucketOwnershipControlsResponse response); + + private static PutBucketOwnershipControlsResponseUnmarshaller _instance = new PutBucketOwnershipControlsResponseUnmarshaller(); + + internal static PutBucketOwnershipControlsResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketOwnershipControlsResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/PutBucketOwnershipControlsRequest.cs b/sdk/src/Services/S3/Generated/Model/PutBucketOwnershipControlsRequest.cs new file mode 100644 index 000000000000..197e7bc83288 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/PutBucketOwnershipControlsRequest.cs @@ -0,0 +1,189 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Container for the parameters to the PutBucketOwnershipControls operation. + /// + /// + /// This operation is not supported for directory buckets. + /// + /// + /// + /// Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this + /// operation, you must have the s3:PutBucketOwnershipControls permission. For + /// more information about Amazon S3 permissions, see Specifying + /// permissions in a policy. + /// + /// + /// + /// For information about Amazon S3 Object Ownership, see Using + /// object ownership. + /// + /// + /// + /// The following operations are related to PutBucketOwnershipControls: + /// + /// + /// + /// You must URL encode any signed header values that contain spaces. For example, if + /// your header value is my file.txt, containing two spaces after my, you + /// must URL encode this value to my%20%20file.txt. + /// + /// + /// + public partial class PutBucketOwnershipControlsRequest : AmazonWebServiceRequest + { + private string _bucketName; + private ChecksumAlgorithm _checksumAlgorithm; + private string _contentMD5; + private string _expectedBucketOwner; + private OwnershipControls _ownershipControls; + + /// + /// Gets and sets the property BucketName. + /// + /// The name of the Amazon S3 bucket whose OwnershipControls you want to set. + /// + /// + [AWSProperty(Required=true)] + public string BucketName + { + get { return this._bucketName; } + set { this._bucketName = value; } + } + + // Check to see if BucketName property is set + internal bool IsSetBucketName() + { + return this._bucketName != null; + } + + /// + /// Gets and sets the property ChecksumAlgorithm. + /// + /// Indicates the algorithm used to create the checksum for the object when you use the + /// SDK. This header will not provide any additional functionality if you don't use the + /// SDK. When you send this header, there must be a corresponding x-amz-checksum-algorithm + /// header sent. Otherwise, Amazon S3 fails the request with the HTTP status code + /// 400 Bad Request. For more information, see Checking + /// object integrity in the Amazon S3 User Guide. + /// + /// + /// + /// If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm + /// parameter. + /// + /// + public ChecksumAlgorithm ChecksumAlgorithm + { + get { return this._checksumAlgorithm; } + set { this._checksumAlgorithm = value; } + } + + // Check to see if ChecksumAlgorithm property is set + internal bool IsSetChecksumAlgorithm() + { + return this._checksumAlgorithm != null; + } + + /// + /// Gets and sets the property ContentMD5. + /// + /// The MD5 hash of the OwnershipControls request body. + /// + /// + /// + /// For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon + /// Web Services SDKs, this field is calculated automatically. + /// + /// + public string ContentMD5 + { + get { return this._contentMD5; } + set { this._contentMD5 = value; } + } + + // Check to see if ContentMD5 property is set + internal bool IsSetContentMD5() + { + return this._contentMD5 != null; + } + + /// + /// Gets and sets the property ExpectedBucketOwner. + /// + /// The account ID of the expected bucket owner. If the account ID that you provide does + /// not match the actual owner of the bucket, the request fails with the HTTP status code + /// 403 Forbidden (access denied). + /// + /// + public string ExpectedBucketOwner + { + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } + } + + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() + { + return !string.IsNullOrEmpty(this._expectedBucketOwner); + } + + /// + /// Gets and sets the property OwnershipControls. + /// + /// The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or ObjectWriter) + /// that you want to apply to this Amazon S3 bucket. + /// + /// + [AWSProperty(Required=true)] + public OwnershipControls OwnershipControls + { + get { return this._ownershipControls; } + set { this._ownershipControls = value; } + } + + // Check to see if OwnershipControls property is set + internal bool IsSetOwnershipControls() + { + return this._ownershipControls != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketOwnershipControlsResponse.cs b/sdk/src/Services/S3/Generated/Model/PutBucketOwnershipControlsResponse.cs similarity index 70% rename from sdk/src/Services/S3/Custom/Model/PutBucketOwnershipControlsResponse.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketOwnershipControlsResponse.cs index 8d733ae655bb..3f07f6183a47 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketOwnershipControlsResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketOwnershipControlsResponse.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,19 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; -using System.Linq; +using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; + using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// Returns information about the PutBucketOwnershipControls response metadata. - /// The PutBucketOwnershipControls operation has a void result type. + /// This is the response object from the PutBucketOwnershipControls operation. /// public partial class PutBucketOwnershipControlsResponse : AmazonWebServiceResponse { + } -} +} \ No newline at end of file