diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 622b800def9f..917df042aa62 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -563,7 +563,7 @@ public List S3AllowListOperations //new Operation(this, "RestoreObject", DocumentRoot[OperationsKey]["RestoreObject"]), //new Operation(this, "SelectObjectContent", DocumentRoot[OperationsKey]["SelectObjectContent"]), new Operation(this, "PutBucketAnalyticsConfiguration" , DocumentRoot[OperationsKey]["PutBucketAnalyticsConfiguration"]), - //new Operation(this, "PutBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["PutBucketIntelligentTieringConfiguration"]), + new Operation(this, "PutBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["PutBucketIntelligentTieringConfiguration"]), //new Operation(this, "PutBucketInventoryConfiguration", DocumentRoot[OperationsKey]["PutBucketInventoryConfiguration"]), new Operation(this, "PutBucketMetricsConfiguration", DocumentRoot[OperationsKey]["PutBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketMetricsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetricsConfiguration"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index ccbd3df8c26d..faecb8a73e07 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1007,6 +1007,28 @@ ]} } ] + }, + "PutBucketIntelligentTieringConfigurationRequest" : { + "modify" : [ + { + "Id": {"emitPropertyName": "IntelligentTieringId"} + } + ] + }, + "IntelligentTieringConfiguration" : { + "modify": [ + { + "Id" :{"emitPropertyName":"IntelligentTieringId"} + }, + { + "Filter": {"emitPropertyName": "IntelligentTieringFilter"} + }, + { + "IntelligentTieringFilter" :{ + "injectXmlMarshallCode": ["IntelligentTieringFilterCustomMarshall(publicRequest, xmlWriter);"] + } + } + ] } }, "operationModifiers": { @@ -1381,6 +1403,8 @@ "MetricsFilter", "MetricsAndOperator", "AnalyticsFilter", - "AnalyticsAndOperator" + "AnalyticsAndOperator", + "IntelligentTieringFilter", + "IntelligentTieringAndOperator" ] } diff --git a/sdk/src/Services/S3/Custom/Model/IntelligentTieringConfiguration.cs b/sdk/src/Services/S3/Custom/Model/IntelligentTieringConfiguration.cs deleted file mode 100644 index bf1239e2571a..000000000000 --- a/sdk/src/Services/S3/Custom/Model/IntelligentTieringConfiguration.cs +++ /dev/null @@ -1,93 +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.Text; - -namespace Amazon.S3.Model -{ - /// - /// Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. - /// For information about the S3 Intelligent-Tiering storage class, see Storage class for automatically optimizing frequently and infrequently accessed objects. - /// - public class IntelligentTieringConfiguration - { - private string intelligentTieringId; - private IntelligentTieringFilter intelligentTieringFilter; - private IntelligentTieringStatus status; - private List tierings = AWSConfigs.InitializeCollections ? new List() : null; - - /// - /// The ID used to identify the S3 Intelligent-Tiering configuration. - /// - public string IntelligentTieringId - { - get { return this.intelligentTieringId; } - set { this.intelligentTieringId = value; } - } - - // Check to see if IntelligentTieringId property is set - internal bool IsSetIntelligentTieringId() - { - return !(string.IsNullOrEmpty(this.intelligentTieringId)); - } - - /// - /// Specifies a bucket filter. - /// The configuration only includes objects that meet the filter's criteria. - /// - public IntelligentTieringFilter IntelligentTieringFilter - { - get { return this.intelligentTieringFilter; } - set { this.intelligentTieringFilter = value; } - } - - // Check to see if InventoryFilter property is set - internal bool IsSetIntelligentTieringFilter() - { - return this.intelligentTieringFilter != null; - } - - /// - /// Specifies the status of the configuration. - /// - public IntelligentTieringStatus Status - { - get { return this.status; } - set { this.status = value; } - } - - // Check to see if Status property is set - internal bool IsSetStatus() - { - return this.status != null; - } - - /// - /// Specifies the S3 Intelligent-Tiering storage class tier of the configuration. - /// - public List Tierings - { - get { return this.tierings; } - set { this.tierings = value; } - } - - // Check if the tieringList property is set - internal bool IsSetTieringList() - { - return this.tierings != null && (this.tierings.Count > 0 || !AWSConfigs.InitializeCollections); - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationRequestMarshaller.cs index dcfb414d0967..7f715f1b255b 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationRequestMarshaller.cs @@ -28,134 +28,42 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Put Bucket IntelligentTieringConfigurationRequest Marshaller /// - public class PutBucketIntelligentTieringConfigurationRequestMarshaller : IMarshaller, IMarshaller + public partial class PutBucketIntelligentTieringConfigurationRequestMarshaller : IMarshaller, IMarshaller { - /// - /// Marshall the public request to the internal IRequest structure. - /// - /// - /// - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) + void IntelligentTieringFilterCustomMarshall(PutBucketIntelligentTieringConfigurationRequest publicRequest, XmlWriter xmlWriter) { - return this.Marshall((PutBucketIntelligentTieringConfigurationRequest)input); - } + if (publicRequest.IntelligentTieringConfiguration.IsSetIntelligentTieringFilter()) + { + xmlWriter.WriteStartElement("Filter"); + var filterPredicate = publicRequest.IntelligentTieringConfiguration.IntelligentTieringFilter.IntelligentTieringFilterPredicate; + filterPredicate.Accept(new IntelligentTieringPredicateVisitor(xmlWriter)); - /// - /// Marshall the public request to the internal IRequest structure. - /// - /// - /// - public IRequest Marshall(PutBucketIntelligentTieringConfigurationRequest PutBucketIntelligentTieringConfigurationRequest) - { - IRequest request = new DefaultRequest(PutBucketIntelligentTieringConfigurationRequest, "Amazon.S3"); - var intelligentTieringConfiguration = PutBucketIntelligentTieringConfigurationRequest.IntelligentTieringConfiguration; - request.HttpMethod = "PUT"; - - if (string.IsNullOrEmpty(PutBucketIntelligentTieringConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "PutBucketIntelligentTieringConfigurationRequest.BucketName"); - - if (intelligentTieringConfiguration == null) - throw new System.ArgumentException("IntelligentTieringConfiguration is a required property and must be set before making this call.", "PutBucketIntelligentTieringConfigurationRequest.IntelligentTieringConfiguration"); - - if (string.IsNullOrEmpty(intelligentTieringConfiguration.IntelligentTieringId)) - throw new System.ArgumentException("IntelligentTieringId is a required property and must be set before making this call.", "IntelligentTieringConfiguration.IntelligentTieringId"); - - if (string.IsNullOrEmpty(PutBucketIntelligentTieringConfigurationRequest.IntelligentTieringId)) - throw new System.ArgumentException("IntelligentTieringId is a required property and must be set before making this call.", "PutBucketIntelligentTieringConfigurationRequest.IntelligentTieringId"); - - if (!intelligentTieringConfiguration.IsSetStatus()) - throw new System.ArgumentException("Status is a required property and must be set before making this call.", "IntelligentTieringConfiguration.Status"); - - if (!intelligentTieringConfiguration.IsSetTieringList()) - throw new System.ArgumentException("TieringList is a required property and must be set before making this call.", "IntelligentTieringConfiguration.TieringList"); - - if (PutBucketIntelligentTieringConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(PutBucketIntelligentTieringConfigurationRequest.ExpectedBucketOwner)); - - request.ResourcePath = "/"; - - request.AddSubResource("intelligent-tiering"); - - request.AddSubResource("id", PutBucketIntelligentTieringConfigurationRequest.IntelligentTieringId); - - var stringWriter = new XMLEncodedStringWriter(System.Globalization.CultureInfo.InvariantCulture); - using (var xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings() { Encoding = Encoding.UTF8, OmitXmlDeclaration = true, NewLineHandling = NewLineHandling.Entitize})) - { - - if (intelligentTieringConfiguration != null) - { - xmlWriter.WriteStartElement("IntelligentTieringConfiguration", S3Constants.S3RequestXmlNamespace); - if (intelligentTieringConfiguration != null) - { - if (intelligentTieringConfiguration.IsSetIntelligentTieringId()) - { - xmlWriter.WriteElementString("Id", S3Transforms.ToXmlStringValue(intelligentTieringConfiguration.IntelligentTieringId)); - } - - if (intelligentTieringConfiguration.IsSetIntelligentTieringFilter()) - { - xmlWriter.WriteStartElement("Filter"); - var filterPredicate = intelligentTieringConfiguration.IntelligentTieringFilter.IntelligentTieringFilterPredicate; - filterPredicate.Accept(new IntelligentTieringPredicateVisitor(xmlWriter)); - - xmlWriter.WriteEndElement(); - } - - if (intelligentTieringConfiguration.IsSetStatus()) - { - xmlWriter.WriteElementString("Status", S3Transforms.ToXmlStringValue(intelligentTieringConfiguration.Status)); - } + xmlWriter.WriteEndElement(); + } + } - if (intelligentTieringConfiguration.IsSetTieringList()) - { - foreach (var tiering in intelligentTieringConfiguration.Tierings) - { - if (tiering != null) - { - xmlWriter.WriteStartElement("Tiering"); - xmlWriter.WriteElementString("Days", S3Transforms.ToXmlStringValue(tiering.Days.Value)); - xmlWriter.WriteElementString("AccessTier", S3Transforms.ToXmlStringValue(tiering.AccessTier)); - xmlWriter.WriteEndElement(); - } - } - } - } - xmlWriter.WriteEndElement(); - } - } + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketIntelligentTieringConfigurationRequest publicRequest) + { + ChecksumUtils.SetChecksumData(defaultRequest); + } - try - { - var content = stringWriter.ToString(); - request.Content = Encoding.UTF8.GetBytes(content); - request.Headers[HeaderKeys.ContentTypeHeader] = "application/xml"; + partial void PreMarshallCustomization(DefaultRequest defaultRequest, PutBucketIntelligentTieringConfigurationRequest publicRequest) + { + var intelligentTieringConfiguration = publicRequest.IntelligentTieringConfiguration; + if (intelligentTieringConfiguration == null) + throw new System.ArgumentException("IntelligentTieringConfiguration is a required property and must be set before making this call.", "PutBucketIntelligentTieringConfigurationRequest.IntelligentTieringConfiguration"); - ChecksumUtils.SetChecksumData(request); - } - catch (EncoderFallbackException e) - { - throw new AmazonServiceException("Unable to marshall request to XML", e); - } + if (string.IsNullOrEmpty(intelligentTieringConfiguration.IntelligentTieringId)) + throw new System.ArgumentException("IntelligentTieringId is a required property and must be set before making this call.", "IntelligentTieringConfiguration.IntelligentTieringId"); - return request; + if (string.IsNullOrEmpty(publicRequest.IntelligentTieringConfiguration.IntelligentTieringId)) + throw new System.ArgumentException("IntelligentTieringId is a required property and must be set before making this call.", "PutBucketIntelligentTieringConfigurationRequest.IntelligentTieringId"); - } + if (!intelligentTieringConfiguration.IsSetStatus()) + throw new System.ArgumentException("Status is a required property and must be set before making this call.", "IntelligentTieringConfiguration.Status"); - private static PutBucketIntelligentTieringConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static PutBucketIntelligentTieringConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketIntelligentTieringConfigurationRequestMarshaller(); - } - return _instance; - } - } - } + if (!intelligentTieringConfiguration.IsSetTierings()) + throw new System.ArgumentException("Tierings is a required property and must be set before making this call.", "IntelligentTieringConfiguration.TieringList"); + } + } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationResponseUnmarshaller.cs deleted file mode 100644 index 4f7e5d3a9f7b..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,57 +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 Amazon.Runtime; -using Amazon.Runtime.Internal.Transform; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for PutBucketIntelligentTieringConfiguration operation - /// - public class PutBucketIntelligentTieringConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - PutBucketIntelligentTieringConfigurationResponse response = new PutBucketIntelligentTieringConfigurationResponse(); - - return response; - } - - private static PutBucketIntelligentTieringConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static PutBucketIntelligentTieringConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketIntelligentTieringConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketIntelligentTieringConfigurationResponse.cs b/sdk/src/Services/S3/Custom/Model/PutBucketIntelligentTieringConfigurationResponse.cs deleted file mode 100644 index 78c76f79edb9..000000000000 --- a/sdk/src/Services/S3/Custom/Model/PutBucketIntelligentTieringConfigurationResponse.cs +++ /dev/null @@ -1,30 +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 Amazon.Runtime; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Amazon.S3.Model -{ - /// - /// Returns information about the PutBucketIntelligentTieringConfiguration response metadata. - /// The PutBucketIntelligentTieringConfiguration operation has a void result type. - /// - public partial class PutBucketIntelligentTieringConfigurationResponse : AmazonWebServiceResponse - { - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Tiering.cs b/sdk/src/Services/S3/Custom/Model/Tiering.cs deleted file mode 100644 index 0f9d30c6df9f..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Tiering.cs +++ /dev/null @@ -1,67 +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.Text; - -namespace Amazon.S3.Model -{ - /// - /// The S3 Intelligent-Tiering storage class is designed to - /// optimize storage costs by automatically moving data to the most - /// cost-effective storage access tier, without additional operational overhead. - /// - public class Tiering - { - private int? days; - private IntelligentTieringAccessTier accessTier; - - /// - /// The number of consecutive days of no access after which an object - /// will be eligible to be transitioned to the corresponding tier. The minimum number of - /// days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier - /// must be at least 180 days. The maximum can be up to 2 years (730 days). - /// - public int? Days - { - get { return this.days; } - set { this.days = value; } - } - - // Check to see if intelligentTieringDays property is set - internal bool IsSetDays() - { - return this.days.HasValue; - } - - /// - /// S3 Intelligent-Tiering access tier. - /// See - /// Storage class for automatically optimizing frequently and infrequently accessed objects - /// for a list of access tiers in the S3 Intelligent-Tiering storage class. - /// - public IntelligentTieringAccessTier AccessTier - { - get { return this.accessTier; } - set { this.accessTier = value; } - } - - // Check to see if Status property is set - internal bool IsSetAccessTier() - { - return this.accessTier != null; - } - } -} diff --git a/sdk/src/Services/S3/Generated/Model/IntelligentTieringConfiguration.cs b/sdk/src/Services/S3/Generated/Model/IntelligentTieringConfiguration.cs new file mode 100644 index 000000000000..5ca5253913e1 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/IntelligentTieringConfiguration.cs @@ -0,0 +1,130 @@ +/* + * 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 +{ + /// + /// Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. + /// + /// + /// + /// For information about the S3 Intelligent-Tiering storage class, see Storage + /// class for automatically optimizing frequently and infrequently accessed objects. + /// + /// + public partial class IntelligentTieringConfiguration + { + private IntelligentTieringFilter _intelligentTieringFilter; + private string _intelligentTieringId; + private IntelligentTieringStatus _status; + private List _tierings = AWSConfigs.InitializeCollections ? new List() : null; + + /// + /// Gets and sets the property IntelligentTieringFilter. + /// + /// Specifies a bucket filter. The configuration only includes objects that meet the filter's + /// criteria. + /// + /// + public IntelligentTieringFilter IntelligentTieringFilter + { + get { return this._intelligentTieringFilter; } + set { this._intelligentTieringFilter = value; } + } + + // Check to see if IntelligentTieringFilter property is set + internal bool IsSetIntelligentTieringFilter() + { + return this._intelligentTieringFilter != null; + } + + /// + /// Gets and sets the property IntelligentTieringId. + /// + /// The ID used to identify the S3 Intelligent-Tiering configuration. + /// + /// + [AWSProperty(Required=true)] + public string IntelligentTieringId + { + get { return this._intelligentTieringId; } + set { this._intelligentTieringId = value; } + } + + // Check to see if IntelligentTieringId property is set + internal bool IsSetIntelligentTieringId() + { + return this._intelligentTieringId != null; + } + + /// + /// Gets and sets the property Status. + /// + /// Specifies the status of the configuration. + /// + /// + [AWSProperty(Required=true)] + public IntelligentTieringStatus Status + { + get { return this._status; } + set { this._status = value; } + } + + // Check to see if Status property is set + internal bool IsSetStatus() + { + return this._status != null; + } + + /// + /// Gets and sets the property Tierings. + /// + /// Specifies the S3 Intelligent-Tiering storage class tier of the configuration. + /// + /// + /// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned + /// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller + /// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous + /// SDK behavior set the AWSConfigs.InitializeCollections static property to true. + /// + [AWSProperty(Required=true)] + public List Tierings + { + get { return this._tierings; } + set { this._tierings = value; } + } + + // Check to see if Tierings property is set + internal bool IsSetTierings() + { + return this._tierings != null && (this._tierings.Count > 0 || !AWSConfigs.InitializeCollections); + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..75c1d39e90bd --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationRequestMarshaller.cs @@ -0,0 +1,144 @@ +/* + * 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 +{ + /// + /// PutBucketIntelligentTieringConfiguration Request Marshaller + /// + public partial class PutBucketIntelligentTieringConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((PutBucketIntelligentTieringConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(PutBucketIntelligentTieringConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "PUT"; + request.AddSubResource("intelligent-tiering"); + + 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.", "PutBucketIntelligentTieringConfigurationRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.IntelligentTieringId)) + throw new AmazonS3Exception("Request object does not have required field IntelligentTieringId set"); + + if (publicRequest.IsSetIntelligentTieringId()) + request.Parameters.Add("id", StringUtils.FromString(publicRequest.IntelligentTieringId)); + 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.IsSetIntelligentTieringConfiguration()) + { + xmlWriter.WriteStartElement("IntelligentTieringConfiguration", "http://s3.amazonaws.com/doc/2006-03-01/"); + IntelligentTieringFilterCustomMarshall(publicRequest, xmlWriter); + if(publicRequest.IntelligentTieringConfiguration.IsSetIntelligentTieringId()) + xmlWriter.WriteElementString("Id", StringUtils.FromString(publicRequest.IntelligentTieringConfiguration.IntelligentTieringId)); + + if(publicRequest.IntelligentTieringConfiguration.IsSetStatus()) + xmlWriter.WriteElementString("Status", StringUtils.FromString(publicRequest.IntelligentTieringConfiguration.Status)); + + var publicRequestIntelligentTieringConfigurationTierings = publicRequest.IntelligentTieringConfiguration.Tierings; + if (publicRequestIntelligentTieringConfigurationTierings != null && (publicRequestIntelligentTieringConfigurationTierings.Count > 0 || !AWSConfigs.InitializeCollections)) + { + foreach (var publicRequestIntelligentTieringConfigurationTieringsValue in publicRequestIntelligentTieringConfigurationTierings) + { + if (publicRequestIntelligentTieringConfigurationTieringsValue != null) + { + xmlWriter.WriteStartElement("Tiering"); + if(publicRequestIntelligentTieringConfigurationTieringsValue.IsSetAccessTier()) + xmlWriter.WriteElementString("AccessTier", StringUtils.FromString(publicRequestIntelligentTieringConfigurationTieringsValue.AccessTier)); + if(publicRequestIntelligentTieringConfigurationTieringsValue.IsSetDays()) + xmlWriter.WriteElementString("Days", StringUtils.FromInt(publicRequestIntelligentTieringConfigurationTieringsValue.Days.Value)); + 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"; + request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2006-03-01"; + } + catch (EncoderFallbackException e) + { + throw new AmazonServiceException("Unable to marshall request to XML", e); + } + request.UseQueryString = true; + return request; + } + private static PutBucketIntelligentTieringConfigurationRequestMarshaller _instance = new PutBucketIntelligentTieringConfigurationRequestMarshaller(); + + internal static PutBucketIntelligentTieringConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketIntelligentTieringConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketIntelligentTieringConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, PutBucketIntelligentTieringConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..8534dcd628b5 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationResponseUnmarshaller.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 PutBucketIntelligentTieringConfiguration operation + /// + public partial class PutBucketIntelligentTieringConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + PutBucketIntelligentTieringConfigurationResponse response = new PutBucketIntelligentTieringConfigurationResponse(); + + 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, PutBucketIntelligentTieringConfigurationResponse response); + + private static PutBucketIntelligentTieringConfigurationResponseUnmarshaller _instance = new PutBucketIntelligentTieringConfigurationResponseUnmarshaller(); + + internal static PutBucketIntelligentTieringConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketIntelligentTieringConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketIntelligentTieringConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/PutBucketIntelligentTieringConfigurationRequest.cs similarity index 68% rename from sdk/src/Services/S3/Custom/Model/PutBucketIntelligentTieringConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketIntelligentTieringConfigurationRequest.cs index a58af46b87f4..86700e192ff3 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketIntelligentTieringConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketIntelligentTieringConfigurationRequest.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,18 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ -using Amazon.Runtime; + +/* + * 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 PutBucketIntelligentTieringConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -54,8 +64,7 @@ namespace Amazon.S3.Model /// /// /// - /// Operations related to PutBucketIntelligentTieringConfiguration include: - /// + /// Operations related to PutBucketIntelligentTieringConfiguration include: /// ///
  • /// @@ -80,7 +89,7 @@ namespace Amazon.S3.Model /// /// /// - /// PutBucketIntelligentTieringConfiguration has the following special errors: + /// PutBucketIntelligentTieringConfiguration has the following special errors: /// ///
    HTTP 400 Bad Request Error
    /// @@ -102,31 +111,41 @@ namespace Amazon.S3.Model ///
    HTTP 403 Forbidden Error
    /// /// Cause: You are not the owner of the specified bucket, or you do not have the - /// s3:PutIntelligentTieringConfiguration bucket permission to set the configuration + /// s3:PutIntelligentTieringConfiguration bucket permission to set the configuration /// on the bucket. /// - ///
    + /// + /// + /// 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 PutBucketIntelligentTieringConfigurationRequest : AmazonWebServiceRequest { - private string bucketName; - private string expectedBucketOwner; - private string intelligentTieringId; - private IntelligentTieringConfiguration intelligentTieringConfiguration; + private string _bucketName; + private string _expectedBucketOwner; + private IntelligentTieringConfiguration _intelligentTieringConfiguration; + private string _intelligentTieringId; /// - /// The name of the Amazon S3 bucket whose configuration you want to modify or retrieve. + /// Gets and sets the property BucketName. + /// + /// The name of the Amazon S3 bucket whose configuration you want to modify or retrieve. + /// /// + [AWSProperty(Required=true)] public string BucketName { - get { return this.bucketName; } - set { this.bucketName = value; } + get { return this._bucketName; } + set { this._bucketName = value; } } // Check to see if BucketName property is set internal bool IsSetBucketName() { - return this.bucketName != null; + return this._bucketName != null; } /// @@ -139,44 +158,53 @@ internal bool IsSetBucketName() /// public string ExpectedBucketOwner { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } // Check to see if ExpectedBucketOwner property is set internal bool IsSetExpectedBucketOwner() { - return this.expectedBucketOwner != null; + return this._expectedBucketOwner != null; } /// - /// The ID used to identify the S3 Intelligent-Tiering configuration. + /// Gets and sets the property IntelligentTieringConfiguration. + /// + /// Container for S3 Intelligent-Tiering configuration. + /// /// - public string IntelligentTieringId + [AWSProperty(Required=true)] + public IntelligentTieringConfiguration IntelligentTieringConfiguration { - get { return this.intelligentTieringId; } - set { this.intelligentTieringId = value; } + get { return this._intelligentTieringConfiguration; } + set { this._intelligentTieringConfiguration = value; } } - // Check to see if IntelligentTieringId property is set - internal bool IsSetIntelligentTieringId() + // Check to see if IntelligentTieringConfiguration property is set + internal bool IsSetIntelligentTieringConfiguration() { - return this.intelligentTieringId != null; + return this._intelligentTieringConfiguration != null; } /// - /// Container for S3 Intelligent-Tiering configuration. + /// Gets and sets the property IntelligentTieringId. + /// + /// The ID used to identify the S3 Intelligent-Tiering configuration. + /// /// - public IntelligentTieringConfiguration IntelligentTieringConfiguration + [AWSProperty(Required=true)] + public string IntelligentTieringId { - get { return this.intelligentTieringConfiguration; } - set { this.intelligentTieringConfiguration = value; } + get { return this._intelligentTieringId; } + set { this._intelligentTieringId = value; } } - // Check to see if IntelligentTieringConfiguration property is set - internal bool IsIntelligentTieringConfiguration() + // Check to see if IntelligentTieringId property is set + internal bool IsSetIntelligentTieringId() { - return this.intelligentTieringConfiguration != null; + return this._intelligentTieringId != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/PutBucketIntelligentTieringConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/PutBucketIntelligentTieringConfigurationResponse.cs new file mode 100644 index 000000000000..61167053d07f --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/PutBucketIntelligentTieringConfigurationResponse.cs @@ -0,0 +1,39 @@ +/* + * 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 +{ + /// + /// This is the response object from the PutBucketIntelligentTieringConfiguration operation. + /// + public partial class PutBucketIntelligentTieringConfigurationResponse : AmazonWebServiceResponse + { + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Tiering.cs b/sdk/src/Services/S3/Generated/Model/Tiering.cs new file mode 100644 index 000000000000..4fd83d678782 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Tiering.cs @@ -0,0 +1,86 @@ +/* + * 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 +{ + /// + /// The S3 Intelligent-Tiering storage class is designed to optimize storage costs by + /// automatically moving data to the most cost-effective storage access tier, without + /// additional operational overhead. + /// + public partial class Tiering + { + private IntelligentTieringAccessTier _accessTier; + private int? _days; + + /// + /// Gets and sets the property AccessTier. + /// + /// S3 Intelligent-Tiering access tier. See Storage + /// class for automatically optimizing frequently and infrequently accessed objects + /// for a list of access tiers in the S3 Intelligent-Tiering storage class. + /// + /// + [AWSProperty(Required=true)] + public IntelligentTieringAccessTier AccessTier + { + get { return this._accessTier; } + set { this._accessTier = value; } + } + + // Check to see if AccessTier property is set + internal bool IsSetAccessTier() + { + return this._accessTier != null; + } + + /// + /// Gets and sets the property Days. + /// + /// The number of consecutive days of no access after which an object will be eligible + /// to be transitioned to the corresponding tier. The minimum number of days specified + /// for Archive Access tier must be at least 90 days and Deep Archive Access tier must + /// be at least 180 days. The maximum can be up to 2 years (730 days). + /// + /// + [AWSProperty(Required=true)] + public int? Days + { + get { return this._days; } + set { this._days = value; } + } + + // Check to see if Days property is set + internal bool IsSetDays() + { + return this._days.HasValue; + } + + } +} \ No newline at end of file