From 17ee8cf207d4db060be7f4330cd66e46cd791fe4 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Mon, 17 Nov 2025 12:49:16 -0800 Subject: [PATCH 1/5] generate PutBucketIntelligentTieringConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4145, branch: peterrsongg/petesong/phase-3-pr-3/1 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 26 ++- .../Model/IntelligentTieringConfiguration.cs | 93 ----------- ...ntTieringConfigurationRequestMarshaller.cs | 150 ++++-------------- ...ieringConfigurationResponseUnmarshaller.cs | 57 ------- ...IntelligentTieringConfigurationResponse.cs | 30 ---- sdk/src/Services/S3/Custom/Model/Tiering.cs | 67 -------- .../Model/IntelligentTieringConfiguration.cs | 130 +++++++++++++++ ...ntTieringConfigurationRequestMarshaller.cs | 144 +++++++++++++++++ ...ieringConfigurationResponseUnmarshaller.cs | 98 ++++++++++++ ...tIntelligentTieringConfigurationRequest.cs | 96 +++++++---- ...IntelligentTieringConfigurationResponse.cs | 39 +++++ .../Services/S3/Generated/Model/Tiering.cs | 86 ++++++++++ 13 files changed, 614 insertions(+), 404 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/IntelligentTieringConfiguration.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationResponseUnmarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/PutBucketIntelligentTieringConfigurationResponse.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Tiering.cs create mode 100644 sdk/src/Services/S3/Generated/Model/IntelligentTieringConfiguration.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketIntelligentTieringConfigurationResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/PutBucketIntelligentTieringConfigurationRequest.cs (68%) create mode 100644 sdk/src/Services/S3/Generated/Model/PutBucketIntelligentTieringConfigurationResponse.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Tiering.cs 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 From f8ef6223e0154af89ba6660b3e8c7eaad4c16797 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Mon, 17 Nov 2025 17:10:24 -0800 Subject: [PATCH 2/5] Generate GetBucketIntelligentTieringConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4146, branch: peterrsongg/petesong/phase-3-pr-3/2 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 15 +++ ...ntTieringConfigurationRequestMarshaller.cs | 44 +----- ...ieringConfigurationResponseUnmarshaller.cs | 123 ----------------- ...tIntelligentTieringConfigurationRequest.cs | 79 +++++++---- ...IntelligentTieringConfigurationResponse.cs | 36 +++-- ...ntTieringConfigurationRequestMarshaller.cs | 101 ++++++++++++++ ...ieringConfigurationResponseUnmarshaller.cs | 126 ++++++++++++++++++ ...lligentTieringConfigurationUnmarshaller.cs | 80 ++++++----- .../TieringUnmarshaller.cs | 75 ++++++----- 10 files changed, 411 insertions(+), 270 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketIntelligentTieringConfigurationRequest.cs (66%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketIntelligentTieringConfigurationResponse.cs (54%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/IntelligentTieringConfigurationUnmarshaller.cs (50%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/TieringUnmarshaller.cs (54%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 917df042aa62..0b34f2a82585 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -549,7 +549,7 @@ public List S3AllowListOperations // phase 3 (including those moved from phase 1) new Operation(this, "CreateSession", DocumentRoot[OperationsKey]["CreateSession"]), new Operation(this, "GetBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["GetBucketAnalyticsConfiguration"]), - //new Operation(this, "GetBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["GetBucketIntelligentTieringConfiguration"]), + new Operation(this, "GetBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["GetBucketIntelligentTieringConfiguration"]), //new Operation(this, "GetBucketInventoryConfiguration", DocumentRoot[OperationsKey]["GetBucketInventoryConfiguration"]), //new Operation(this, "GetBucketLogging", DocumentRoot[OperationsKey]["GetBucketLogging"]), new Operation(this, "GetBucketMetricsConfiguration", DocumentRoot[OperationsKey]["GetBucketMetricsConfiguration"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index faecb8a73e07..78d1918f216a 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1028,6 +1028,21 @@ "injectXmlMarshallCode": ["IntelligentTieringFilterCustomMarshall(publicRequest, xmlWriter);"] } } + ], + "predicateListUnmarshallers": [ + { + "IntelligentTieringFilter" :{ + "predicateListUnmarshallerName" : "IntelligentTieringPredicateListFilterUnmarshaller", + "filterPredicateName": "IntelligentTieringFilterPredicate" + } + } + ] + }, + "GetBucketIntelligentTieringConfigurationRequest":{ + "modify":[ + { + "Id" : {"emitPropertyName": "IntelligentTieringId"} + } ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationRequestMarshaller.cs index 76ad48826a85..0590f6846535 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationRequestMarshaller.cs @@ -28,49 +28,11 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Get InventoryConfiguration Request Marshaller /// - public class GetBucketIntelligentTieringConfigurationRequestMarshaller : IMarshaller, IMarshaller + public partial class GetBucketIntelligentTieringConfigurationRequestMarshaller : IMarshaller, IMarshaller { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketIntelligentTieringConfigurationRequest publicRequest) { - return this.Marshall((GetBucketIntelligentTieringConfigurationRequest)input); - } - - public IRequest Marshall(GetBucketIntelligentTieringConfigurationRequest getBucketIntelligentTieringConfigurationRequest) - { - IRequest request = new DefaultRequest(getBucketIntelligentTieringConfigurationRequest, "Amazon.S3"); - - request.Suppress404Exceptions = true; - request.HttpMethod = "GET"; - - if (string.IsNullOrEmpty(getBucketIntelligentTieringConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetBucketInventoryConfigurationRequest.BucketName"); - - if (getBucketIntelligentTieringConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getBucketIntelligentTieringConfigurationRequest.ExpectedBucketOwner)); - - request.ResourcePath = "/"; - request.AddSubResource("intelligent-tiering"); - request.AddSubResource("id", getBucketIntelligentTieringConfigurationRequest.IntelligentTieringId); - request.UseQueryString = true; - - return request; - } - - private static GetBucketIntelligentTieringConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static GetBucketIntelligentTieringConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketIntelligentTieringConfigurationRequestMarshaller(); - } - return _instance; - } + defaultRequest.Suppress404Exceptions = true; } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationResponseUnmarshaller.cs deleted file mode 100644 index 663cb976ac31..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,123 +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 Amazon.S3.Model.Internal.MarshallTransformations; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for GetBucketIntelligentTieringConfiguration operation - /// - public class GetBucketIntelligentTieringConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - GetBucketIntelligentTieringConfigurationResponse response = new GetBucketIntelligentTieringConfigurationResponse(); - - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context, response); - continue; - } - } - - return response; - } - - private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketIntelligentTieringConfigurationResponse response) - { - - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - response.IntelligentTieringConfiguration = new IntelligentTieringConfiguration(); - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - if (context.TestExpression("Filter", targetDepth)) - { - response.IntelligentTieringConfiguration.IntelligentTieringFilter = new IntelligentTieringFilter() - { - IntelligentTieringFilterPredicate = (IntelligentTieringPredicateListFilterUnmarshaller.Instance.Unmarshall(context))[0] - }; - continue; - } - - if (context.TestExpression("Id", targetDepth)) - { - response.IntelligentTieringConfiguration.IntelligentTieringId = StringUnmarshaller.Instance.Unmarshall(context); - continue; - } - - if (context.TestExpression("Status", targetDepth)) - { - response.IntelligentTieringConfiguration.Status = StringUnmarshaller.Instance.Unmarshall(context); - continue; - } - - if (context.TestExpression("Tiering", targetDepth)) - { - if (response.IntelligentTieringConfiguration.Tierings == null) - { - response.IntelligentTieringConfiguration.Tierings = new List(); - } - response.IntelligentTieringConfiguration.Tierings.Add(TieringUnmarshaller.Instance.Unmarshall(context)); - continue; - } - - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return; - } - } - - return; - } - - private static GetBucketIntelligentTieringConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static GetBucketIntelligentTieringConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketIntelligentTieringConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketIntelligentTieringConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/GetBucketIntelligentTieringConfigurationRequest.cs similarity index 66% rename from sdk/src/Services/S3/Custom/Model/GetBucketIntelligentTieringConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketIntelligentTieringConfigurationRequest.cs index 82a8d961ab7a..b7b5b96bbfe8 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketIntelligentTieringConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketIntelligentTieringConfigurationRequest.cs @@ -1,29 +1,39 @@ -/* - *Copyright Amazon.com, Inc.or its affiliates. All Rights Reserved. +/* + * 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. + * 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 + * + * 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; + +/* + * 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 GetBucketIntelligentTieringConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -53,8 +63,7 @@ namespace Amazon.S3.Model /// /// /// - /// Operations related to GetBucketIntelligentTieringConfiguration include: - /// + /// Operations related to GetBucketIntelligentTieringConfiguration include: /// /// + /// + /// + /// 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 GetBucketIntelligentTieringConfigurationRequest : AmazonWebServiceRequest - { - - private string bucketName; - private string expectedBucketOwner; - private string intelligentTieringId; + { + private string _bucketName; + private string _expectedBucketOwner; + 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; } /// @@ -105,29 +123,34 @@ 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 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; } + { + get { return this._intelligentTieringId; } + set { this._intelligentTieringId = value; } } // Check to see if IntelligentTieringId property is set internal bool IsSetIntelligentTieringId() { - return !(string.IsNullOrEmpty(this.intelligentTieringId)); + return this._intelligentTieringId != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketIntelligentTieringConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/GetBucketIntelligentTieringConfigurationResponse.cs similarity index 54% rename from sdk/src/Services/S3/Custom/Model/GetBucketIntelligentTieringConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketIntelligentTieringConfigurationResponse.cs index d0c6de60f432..eba495c8dc41 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketIntelligentTieringConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketIntelligentTieringConfigurationResponse.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,33 +12,47 @@ * 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 { /// - /// Response object for the GetBucketIntelligentTieringConfiguration operation. + /// This is the response object from the GetBucketIntelligentTieringConfiguration operation. /// public partial class GetBucketIntelligentTieringConfigurationResponse : AmazonWebServiceResponse - { - IntelligentTieringConfiguration intelligentTieringConfiguration; + { + private IntelligentTieringConfiguration _intelligentTieringConfiguration; /// - /// Container for S3 Intelligent-Tiering configuration. + /// Gets and sets the property IntelligentTieringConfiguration. + /// + /// Container for S3 Intelligent-Tiering configuration. + /// /// public IntelligentTieringConfiguration IntelligentTieringConfiguration { - get { return this.intelligentTieringConfiguration; } - set { this.intelligentTieringConfiguration = value; } + get { return this._intelligentTieringConfiguration; } + set { this._intelligentTieringConfiguration = value; } } - // Check to see if InventoryConfiguration property is set + // Check to see if IntelligentTieringConfiguration property is set internal bool IsSetIntelligentTieringConfiguration() { - return this.intelligentTieringConfiguration != null; + return this._intelligentTieringConfiguration != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..dd4cd5d3f2c9 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationRequestMarshaller.cs @@ -0,0 +1,101 @@ +/* + * 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 +{ + /// + /// GetBucketIntelligentTieringConfiguration Request Marshaller + /// + public partial class GetBucketIntelligentTieringConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((GetBucketIntelligentTieringConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(GetBucketIntelligentTieringConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "GET"; + 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.", "GetBucketIntelligentTieringConfigurationRequest.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 = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static GetBucketIntelligentTieringConfigurationRequestMarshaller _instance = new GetBucketIntelligentTieringConfigurationRequestMarshaller(); + + internal static GetBucketIntelligentTieringConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketIntelligentTieringConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetBucketIntelligentTieringConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketIntelligentTieringConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..f24155ad6c43 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketIntelligentTieringConfigurationResponseUnmarshaller.cs @@ -0,0 +1,126 @@ +/* + * 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 GetBucketIntelligentTieringConfiguration operation + /// + public partial class GetBucketIntelligentTieringConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + GetBucketIntelligentTieringConfigurationResponse response = new GetBucketIntelligentTieringConfigurationResponse(); + UnmarshallResult(context,response); + + PostUnmarshallCustomization(context, response); + return response; + } + + private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketIntelligentTieringConfigurationResponse response) + { + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + if (context.IsEmptyResponse) + { + return; + } + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + if (context.TestExpression("IntelligentTieringConfiguration", targetDepth)) + { + var unmarshaller = IntelligentTieringConfigurationUnmarshaller.Instance; + response.IntelligentTieringConfiguration = unmarshaller.Unmarshall(context); + continue; + } + } + else if (context.IsEndElement && context.CurrentDepth < originalDepth) + { + return; + } + } + return; + } + + + /// + /// 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, GetBucketIntelligentTieringConfigurationResponse response); + + private static GetBucketIntelligentTieringConfigurationResponseUnmarshaller _instance = new GetBucketIntelligentTieringConfigurationResponseUnmarshaller(); + + internal static GetBucketIntelligentTieringConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketIntelligentTieringConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/IntelligentTieringConfigurationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/IntelligentTieringConfigurationUnmarshaller.cs similarity index 50% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/IntelligentTieringConfigurationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/IntelligentTieringConfigurationUnmarshaller.cs index 58fc880dc9f8..212a8065eaa8 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/IntelligentTieringConfigurationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/IntelligentTieringConfigurationUnmarshaller.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,91 +12,103 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ -using Amazon.Runtime.Internal.Transform; + +/* + * 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 { /// - /// Unmarshaller for IntelligentTieringConfiguration - /// - public class IntelligentTieringConfigurationUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for IntelligentTieringConfiguration Object + /// + public partial class IntelligentTieringConfigurationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public IntelligentTieringConfiguration Unmarshall(XmlUnmarshallerContext context) { - IntelligentTieringConfiguration response = new IntelligentTieringConfiguration(); + IntelligentTieringConfiguration unmarshalledObject = new IntelligentTieringConfiguration(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - + + if (context.IsStartOfDocument) + targetDepth += 2; + while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Filter", targetDepth)) { - response.IntelligentTieringFilter = new IntelligentTieringFilter() - { - IntelligentTieringFilterPredicate = (IntelligentTieringPredicateListFilterUnmarshaller.Instance.Unmarshall(context))[0] - }; + var predicateList = IntelligentTieringPredicateListFilterUnmarshaller.Instance.Unmarshall(context); + unmarshalledObject.IntelligentTieringFilter = new IntelligentTieringFilter(); + unmarshalledObject.IntelligentTieringFilter.IntelligentTieringFilterPredicate = predicateList[0]; continue; } if (context.TestExpression("Id", targetDepth)) { - response.IntelligentTieringId = StringUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.IntelligentTieringId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Status", targetDepth)) { - response.Status = StringUnmarshaller.Instance.Unmarshall(context); + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.Status = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("Tiering", targetDepth)) { - if (response.Tierings == null) + if (unmarshalledObject.Tierings == null) { - response.Tierings = new List(); + unmarshalledObject.Tierings = new List(); } - response.Tierings.Add(TieringUnmarshaller.Instance.Unmarshall(context)); + var unmarshaller = TieringUnmarshaller.Instance; + unmarshalledObject.Tierings.Add(unmarshaller.Unmarshall(context)); continue; } + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return response; + return unmarshalledObject; } - } - - return response; + } + return unmarshalledObject; } - private static IntelligentTieringConfigurationUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, IntelligentTieringConfiguration unmarshalledObject, int targetDepth); + + private static IntelligentTieringConfigurationUnmarshaller _instance = new IntelligentTieringConfigurationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static IntelligentTieringConfigurationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new IntelligentTieringConfigurationUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/TieringUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/TieringUnmarshaller.cs similarity index 54% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/TieringUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/TieringUnmarshaller.cs index 4c4e5bbf0e21..e4ecaa9591a2 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/TieringUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/TieringUnmarshaller.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"). @@ -13,74 +13,85 @@ * permissions and limitations under the License. */ -using Amazon.Runtime.Internal.Transform; +/* + * 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.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 { - /// - /// Tiering Unmarshaller - /// - public class TieringUnmarshaller : IXmlUnmarshaller - { + /// + /// Response Unmarshaller for Tiering Object + /// + public partial class TieringUnmarshaller : IXmlUnmarshaller + { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public Tiering Unmarshall(XmlUnmarshallerContext context) { - Tiering tiering = new Tiering(); + Tiering unmarshalledObject = new Tiering(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - + + if (context.IsStartOfDocument) + targetDepth += 2; + while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { - if (context.TestExpression("Days", targetDepth)) + if (context.TestExpression("AccessTier", targetDepth)) { - tiering.Days = IntUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.AccessTier = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("AccessTier", targetDepth)) + if (context.TestExpression("Days", targetDepth)) { - tiering.AccessTier = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = NullableIntUnmarshaller.Instance; + unmarshalledObject.Days = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return tiering; + return unmarshalledObject; } - } - - return tiering; + } + return unmarshalledObject; } - private static TieringUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, Tiering unmarshalledObject, int targetDepth); + + private static TieringUnmarshaller _instance = new TieringUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static TieringUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new TieringUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file From 43818b16293f9402c0a3ae09d52ff74b24828ffa Mon Sep 17 00:00:00 2001 From: Peter Song Date: Mon, 17 Nov 2025 22:13:59 -0800 Subject: [PATCH 3/5] Generate ListBucketIntelligentTieringConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4147, branch: peterrsongg/petesong/phase-3-pr-3/3 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 25 ++++ ...tTieringConfigurationsRequestMarshaller.cs | 79 ----------- ...ntelligentTieringConfigurationsResponse.cs | 99 -------------- ...tTieringConfigurationsRequestMarshaller.cs | 99 ++++++++++++++ ...eringConfigurationsResponseUnmarshaller.cs | 114 ++++++++++------ ...IntelligentTieringConfigurationsRequest.cs | 86 +++++++----- ...ntelligentTieringConfigurationsResponse.cs | 125 ++++++++++++++++++ 8 files changed, 379 insertions(+), 250 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/ListBucketIntelligentTieringConfigurationsResponse.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsRequestMarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsResponseUnmarshaller.cs (52%) rename sdk/src/Services/S3/{Custom => Generated}/Model/ListBucketIntelligentTieringConfigurationsRequest.cs (70%) create mode 100644 sdk/src/Services/S3/Generated/Model/ListBucketIntelligentTieringConfigurationsResponse.cs diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 0b34f2a82585..b4a0ad5de5c8 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -556,7 +556,7 @@ public List S3AllowListOperations //new Operation(this, "GetBucketVersioning", DocumentRoot[OperationsKey]["GetBucketVersioning"]), //new Operation(this, "GetBucketWebsite", DocumentRoot[OperationsKey]["GetBucketWebsite"]), new Operation(this, "ListBucketAnalyticsConfigurations", DocumentRoot[OperationsKey]["ListBucketAnalyticsConfigurations"]), - //new Operation(this, "ListBucketIntelligentTieringConfigurations", DocumentRoot[OperationsKey]["ListBucketIntelligentTieringConfigurations"]), + new Operation(this, "ListBucketIntelligentTieringConfigurations", DocumentRoot[OperationsKey]["ListBucketIntelligentTieringConfigurations"]), //new Operation(this, "ListBucketInventoryConfigurations", DocumentRoot[OperationsKey]["ListBucketInventoryConfigurations"]), new Operation(this, "ListBucketMetricsConfigurations", DocumentRoot[OperationsKey]["ListBucketMetricsConfigurations"]), //new Operation(this, "PutBucketAccelerateConfiguration", DocumentRoot[OperationsKey]["PutBucketAccelerateConfiguration"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 78d1918f216a..9693ee2d6a36 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1044,6 +1044,31 @@ "Id" : {"emitPropertyName": "IntelligentTieringId"} } ] + }, + "ListBucketIntelligentTieringConfigurationsRequest":{ + "modify":[ + { + "ContinuationToken":{ + "injectXmlIsSet":[ + "return !string.IsNullOrEmpty(this._continuationToken);" + ] + } + } + ] + }, + "ListBucketIntelligentTieringConfigurationsOutput":{ + "modify":[ + { + "ContinuationToken":{ + "injectXmlIsSet":[ "return !string.IsNullOrEmpty(this._continuationToken);"] + } + }, + { + "NextContinuationToken":{ + "injectXmlIsSet":["return !string.IsNullOrEmpty(this._nextContinuationToken);"] + } + } + ] } }, "operationModifiers": { diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsRequestMarshaller.cs deleted file mode 100644 index 60447e8fe01f..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsRequestMarshaller.cs +++ /dev/null @@ -1,79 +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.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.S3.Util; -using System; -using System.Collections.Generic; -using System.Text; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Request Marshaller for ListBucketIntelligentTieringConfigurations - /// - - public class ListBucketIntelligentTieringConfigurationsRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((ListBucketIntelligentTieringConfigurationsRequest)input); - } - - public IRequest Marshall(ListBucketIntelligentTieringConfigurationsRequest listBucketIntelligentTieringConfigurationsRequest) - { - IRequest request = new DefaultRequest(listBucketIntelligentTieringConfigurationsRequest, "Amazon.S3"); - - request.HttpMethod = "GET"; - - if (string.IsNullOrEmpty(listBucketIntelligentTieringConfigurationsRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "listBucketIntelligentTieringConfigurationsRequest.BucketName"); - - if (listBucketIntelligentTieringConfigurationsRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(listBucketIntelligentTieringConfigurationsRequest.ExpectedBucketOwner)); - - request.ResourcePath = "/"; - request.AddSubResource("intelligent-tiering"); - if (listBucketIntelligentTieringConfigurationsRequest.IsSetContinuationToken()) - { - request.AddSubResource("continuation-token", listBucketIntelligentTieringConfigurationsRequest.ContinuationToken.ToString()); - } - - request.UseQueryString = true; - - return request; - } - - private static ListBucketIntelligentTieringConfigurationsRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static ListBucketIntelligentTieringConfigurationsRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new ListBucketIntelligentTieringConfigurationsRequestMarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/ListBucketIntelligentTieringConfigurationsResponse.cs b/sdk/src/Services/S3/Custom/Model/ListBucketIntelligentTieringConfigurationsResponse.cs deleted file mode 100644 index cf3f53b5f458..000000000000 --- a/sdk/src/Services/S3/Custom/Model/ListBucketIntelligentTieringConfigurationsResponse.cs +++ /dev/null @@ -1,99 +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 -{ - /// - /// Response for the ListBucketIntelligentTieringConfigurations operation. - /// - public partial class ListBucketIntelligentTieringConfigurationsResponse : AmazonWebServiceResponse - { - private string continuationToken; - private List intelligentTieringConfigurationList = AWSConfigs.InitializeCollections ? new List() : null; - private bool? isTruncated; - private string nextContinuationToken; - - /// - /// The ContinuationToken that represents a placeholder from where this request should begin. - /// - public string ContinuationToken - { - get { return this.continuationToken; } - set { this.continuationToken = value; } - } - - // Check to see if Token property is set - internal bool IsSetToken() - { - return !(string.IsNullOrEmpty(this.continuationToken)); - } - - /// - /// The list of S3 Intelligent-Tiering configurations for a bucket. - /// - public List IntelligentTieringConfigurationList - { - get { return this.intelligentTieringConfigurationList; } - set { this.intelligentTieringConfigurationList = value; } - } - - /// - /// Check to see if IntelligentTieringConfiguration property is set - /// - public bool IsSetIntelligentTieringConfigurationList() - { - return this.intelligentTieringConfigurationList != null && (this.intelligentTieringConfigurationList.Count > 0 || !AWSConfigs.InitializeCollections); - } - - /// - /// Indicates whether the returned list of analytics configurations is complete. - /// A value of true indicates that the list is not complete and the - /// NextContinuationToken will be provided for a subsequent request. - /// - public bool? IsTruncated - { - get { return this.isTruncated; } - set { this.isTruncated = value; } - } - - // Check to see if IsTruncated property is set - internal bool IsSetIsTruncated() - { - return this.isTruncated.HasValue; - } - - /// - /// The marker used to continue this inventory configuration listing. - /// Use the NextContinuationToken from this response to - /// continue the listing in a subsequent request. - /// The continuation token is an opaque value that Amazon S3 understands. - /// - public string NextContinuationToken - { - get { return this.nextContinuationToken; } - set { this.nextContinuationToken = value; } - } - - // Check to see if NextToken property is set - internal bool IsSetNextToken() - { - return !(string.IsNullOrEmpty(this.nextContinuationToken)); - } - } -} diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsRequestMarshaller.cs new file mode 100644 index 000000000000..8eb56c543d99 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsRequestMarshaller.cs @@ -0,0 +1,99 @@ +/* + * 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 +{ + /// + /// ListBucketIntelligentTieringConfigurations Request Marshaller + /// + public partial class ListBucketIntelligentTieringConfigurationsRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((ListBucketIntelligentTieringConfigurationsRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(ListBucketIntelligentTieringConfigurationsRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "GET"; + 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.", "ListBucketIntelligentTieringConfigurationsRequest.BucketName"); + + if (publicRequest.IsSetContinuationToken()) + request.Parameters.Add("continuation-token", StringUtils.FromString(publicRequest.ContinuationToken)); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static ListBucketIntelligentTieringConfigurationsRequestMarshaller _instance = new ListBucketIntelligentTieringConfigurationsRequestMarshaller(); + + internal static ListBucketIntelligentTieringConfigurationsRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static ListBucketIntelligentTieringConfigurationsRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, ListBucketIntelligentTieringConfigurationsRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, ListBucketIntelligentTieringConfigurationsRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsResponseUnmarshaller.cs similarity index 52% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsResponseUnmarshaller.cs index dcf6a432ad16..9e7991a752b3 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketIntelligentTieringConfigurationsResponseUnmarshaller.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"). @@ -13,57 +13,63 @@ * permissions and limitations under the License. */ -using Amazon.Runtime; -using Amazon.Runtime.Internal.Transform; +/* + * 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 ListBucketIntelligentTieringConfiguration operation - /// - public class ListBucketIntelligentTieringConfigurationsResponseUnmarshaller : S3ReponseUnmarshaller - { + /// + /// Response Unmarshaller for ListBucketIntelligentTieringConfigurations operation + /// + public partial class ListBucketIntelligentTieringConfigurationsResponseUnmarshaller : S3ReponseUnmarshaller + { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListBucketIntelligentTieringConfigurationsResponse response = new ListBucketIntelligentTieringConfigurationsResponse(); - - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context, response); - continue; - } - } - + UnmarshallResult(context,response); + + PostUnmarshallCustomization(context, response); return response; - } + } private static void UnmarshallResult(XmlUnmarshallerContext context, ListBucketIntelligentTieringConfigurationsResponse response) { - int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - + if (context.IsStartOfDocument) + targetDepth += 1; + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("ContinuationToken", targetDepth)) { - response.ContinuationToken = StringUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + response.ContinuationToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IntelligentTieringConfiguration", targetDepth)) @@ -72,19 +78,20 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, ListBucketI { response.IntelligentTieringConfigurationList = new List(); } - response.IntelligentTieringConfigurationList.Add(IntelligentTieringConfigurationUnmarshaller.Instance.Unmarshall(context)); + var unmarshaller = IntelligentTieringConfigurationUnmarshaller.Instance; + response.IntelligentTieringConfigurationList.Add(unmarshaller.Unmarshall(context)); continue; } if (context.TestExpression("IsTruncated", targetDepth)) { - response.IsTruncated = BoolUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = NullableBoolUnmarshaller.Instance; + response.IsTruncated = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextContinuationToken", targetDepth)) { - response.NextContinuationToken = StringUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + response.NextContinuationToken = unmarshaller.Unmarshall(context); continue; } } @@ -93,24 +100,51 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, ListBucketI return; } } + return; + } + + + /// + /// 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); } - private static ListBucketIntelligentTieringConfigurationsResponseUnmarshaller _instance = new ListBucketIntelligentTieringConfigurationsResponseUnmarshaller(); + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, ListBucketIntelligentTieringConfigurationsResponse response); + + private static ListBucketIntelligentTieringConfigurationsResponseUnmarshaller _instance = new ListBucketIntelligentTieringConfigurationsResponseUnmarshaller(); + + internal static ListBucketIntelligentTieringConfigurationsResponseUnmarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static ListBucketIntelligentTieringConfigurationsResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new ListBucketIntelligentTieringConfigurationsResponseUnmarshaller(); - } return _instance; } } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/ListBucketIntelligentTieringConfigurationsRequest.cs b/sdk/src/Services/S3/Generated/Model/ListBucketIntelligentTieringConfigurationsRequest.cs similarity index 70% rename from sdk/src/Services/S3/Custom/Model/ListBucketIntelligentTieringConfigurationsRequest.cs rename to sdk/src/Services/S3/Generated/Model/ListBucketIntelligentTieringConfigurationsRequest.cs index 447207a1595d..011449b42efb 100644 --- a/sdk/src/Services/S3/Custom/Model/ListBucketIntelligentTieringConfigurationsRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/ListBucketIntelligentTieringConfigurationsRequest.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 ListBucketIntelligentTieringConfigurations operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -53,8 +63,7 @@ namespace Amazon.S3.Model /// /// /// - /// Operations related to ListBucketIntelligentTieringConfigurations include: - /// + /// Operations related to ListBucketIntelligentTieringConfigurations include: /// /// + /// + /// + /// 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 ListBucketIntelligentTieringConfigurationsRequest : AmazonWebServiceRequest { - private string bucketName; - private string expectedBucketOwner; - private string token; + private string _bucketName; + private string _continuationToken; + private string _expectedBucketOwner; /// - /// 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 !(string.IsNullOrEmpty(this.bucketName)); + return this._bucketName != null; } /// - /// Gets and sets the property ExpectedBucketOwner. + /// Gets and sets the property ContinuationToken. /// - /// 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). + /// The ContinuationToken that represents a placeholder from where this request + /// should begin. /// /// - public string ExpectedBucketOwner + public string ContinuationToken { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._continuationToken; } + set { this._continuationToken = value; } } - // Check to see if ExpectedBucketOwner property is set - internal bool IsSetExpectedBucketOwner() + // Check to see if ContinuationToken property is set + internal bool IsSetContinuationToken() { - return this.expectedBucketOwner != null; + return !string.IsNullOrEmpty(this._continuationToken); } /// - /// The ContinuationToken that represents a placeholder from where this request should begin. + /// 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 ContinuationToken + public string ExpectedBucketOwner { - get { return this.token; } - set { this.token = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - // Check to see if ContinuationToken property is set - internal bool IsSetContinuationToken() + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() { - return !(string.IsNullOrEmpty(this.ContinuationToken)); + return this._expectedBucketOwner != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/ListBucketIntelligentTieringConfigurationsResponse.cs b/sdk/src/Services/S3/Generated/Model/ListBucketIntelligentTieringConfigurationsResponse.cs new file mode 100644 index 000000000000..83ff6f983dfd --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/ListBucketIntelligentTieringConfigurationsResponse.cs @@ -0,0 +1,125 @@ +/* + * 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 ListBucketIntelligentTieringConfigurations operation. + /// + public partial class ListBucketIntelligentTieringConfigurationsResponse : AmazonWebServiceResponse + { + private string _continuationToken; + private List _intelligentTieringConfigurationList = AWSConfigs.InitializeCollections ? new List() : null; + private bool? _isTruncated; + private string _nextContinuationToken; + + /// + /// Gets and sets the property ContinuationToken. + /// + /// The ContinuationToken that represents a placeholder from where this request + /// should begin. + /// + /// + public string ContinuationToken + { + get { return this._continuationToken; } + set { this._continuationToken = value; } + } + + // Check to see if ContinuationToken property is set + internal bool IsSetContinuationToken() + { + return !string.IsNullOrEmpty(this._continuationToken); + } + + /// + /// Gets and sets the property IntelligentTieringConfigurationList. + /// + /// The list of S3 Intelligent-Tiering configurations for a bucket. + /// + /// + /// 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. + /// + public List IntelligentTieringConfigurationList + { + get { return this._intelligentTieringConfigurationList; } + set { this._intelligentTieringConfigurationList = value; } + } + + // Check to see if IntelligentTieringConfigurationList property is set + internal bool IsSetIntelligentTieringConfigurationList() + { + return this._intelligentTieringConfigurationList != null && (this._intelligentTieringConfigurationList.Count > 0 || !AWSConfigs.InitializeCollections); + } + + /// + /// Gets and sets the property IsTruncated. + /// + /// Indicates whether the returned list of analytics configurations is complete. A value + /// of true indicates that the list is not complete and the NextContinuationToken + /// will be provided for a subsequent request. + /// + /// + public bool? IsTruncated + { + get { return this._isTruncated; } + set { this._isTruncated = value; } + } + + // Check to see if IsTruncated property is set + internal bool IsSetIsTruncated() + { + return this._isTruncated.HasValue; + } + + /// + /// Gets and sets the property NextContinuationToken. + /// + /// The marker used to continue this inventory configuration listing. Use the NextContinuationToken + /// from this response to continue the listing in a subsequent request. The continuation + /// token is an opaque value that Amazon S3 understands. + /// + /// + public string NextContinuationToken + { + get { return this._nextContinuationToken; } + set { this._nextContinuationToken = value; } + } + + // Check to see if NextContinuationToken property is set + internal bool IsSetNextContinuationToken() + { + return !string.IsNullOrEmpty(this._nextContinuationToken); + } + + } +} \ No newline at end of file From 367749aa163d323d9235a6999faa9444f9a1a442 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Mon, 17 Nov 2025 22:40:21 -0800 Subject: [PATCH 4/5] Generate DeleteBucketIntelligentTiering stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4148, branch: peterrsongg/petesong/phase-3-pr-3/4 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 7 ++ ...IntelligentTieringConfigurationResponse.cs | 27 ----- ...ntTieringConfigurationRequestMarshaller.cs | 74 ------------- ...ieringConfigurationResponseUnmarshaller.cs | 57 ---------- ...tIntelligentTieringConfigurationRequest.cs | 80 +++++++++----- ...IntelligentTieringConfigurationResponse.cs | 39 +++++++ ...ntTieringConfigurationRequestMarshaller.cs | 101 ++++++++++++++++++ ...ieringConfigurationResponseUnmarshaller.cs | 98 +++++++++++++++++ 9 files changed, 301 insertions(+), 184 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/DeleteBucketIntelligentTieringConfigurationResponse.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/DeleteBucketIntelligentTieringConfigurationRequest.cs (65%) create mode 100644 sdk/src/Services/S3/Generated/Model/DeleteBucketIntelligentTieringConfigurationResponse.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller.cs diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index b4a0ad5de5c8..eec1af6036cc 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -568,7 +568,7 @@ public List S3AllowListOperations new Operation(this, "PutBucketMetricsConfiguration", DocumentRoot[OperationsKey]["PutBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketMetricsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketAnalyticsConfiguration"]), - //new Operation(this, "DeleteBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["DeleteBucketIntelligentTieringConfiguration"]), + new Operation(this, "DeleteBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["DeleteBucketIntelligentTieringConfiguration"]), //new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), }; diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 9693ee2d6a36..6dc8337d042c 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1069,6 +1069,13 @@ } } ] + }, + "DeleteBucketIntelligentTieringConfigurationRequest":{ + "modify":[ + { + "Id":{"emitPropertyName": "IntelligentTieringId"} + } + ] } }, "operationModifiers": { diff --git a/sdk/src/Services/S3/Custom/Model/DeleteBucketIntelligentTieringConfigurationResponse.cs b/sdk/src/Services/S3/Custom/Model/DeleteBucketIntelligentTieringConfigurationResponse.cs deleted file mode 100644 index 58a73dc76241..000000000000 --- a/sdk/src/Services/S3/Custom/Model/DeleteBucketIntelligentTieringConfigurationResponse.cs +++ /dev/null @@ -1,27 +0,0 @@ -/*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 DeleteBucketIntelligentTieringConfiguration response metadata. - /// The DeleteBucketMetricsConfiguration operation has a void result type. - /// - public class DeleteBucketIntelligentTieringConfigurationResponse : AmazonWebServiceResponse - { - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationRequestMarshaller.cs deleted file mode 100644 index e9eadea79f82..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationRequestMarshaller.cs +++ /dev/null @@ -1,74 +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.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.S3.Util; -using System; -using System.Collections.Generic; -using System.Text; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Delete Bucket IntelligentTieringConfiguration Request Marshaller - /// - public class DeleteBucketIntelligentTieringConfigurationRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((DeleteBucketIntelligentTieringConfigurationRequest)input); - } - - public IRequest Marshall(DeleteBucketIntelligentTieringConfigurationRequest deleteBucketIntelligentTieringConfigurationRequest) - { - IRequest request = new DefaultRequest(deleteBucketIntelligentTieringConfigurationRequest, "Amazon.S3"); - - request.HttpMethod = "DELETE"; - - if (string.IsNullOrEmpty(deleteBucketIntelligentTieringConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "deleteBucketIntelligentTieringConfigurationRequest.BucketName"); - - if (deleteBucketIntelligentTieringConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(deleteBucketIntelligentTieringConfigurationRequest.ExpectedBucketOwner)); - - request.ResourcePath = "/"; - request.AddSubResource("intelligent-tiering"); - request.AddSubResource("id", deleteBucketIntelligentTieringConfigurationRequest.IntelligentTieringId); - request.UseQueryString = true; - - return request; - } - - private static DeleteBucketIntelligentTieringConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static DeleteBucketIntelligentTieringConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new DeleteBucketIntelligentTieringConfigurationRequestMarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller.cs deleted file mode 100644 index f8af8293437c..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller.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 DeleteBucketIntelligentTiering operation - /// - public class DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - DeleteBucketIntelligentTieringConfigurationResponse response = new DeleteBucketIntelligentTieringConfigurationResponse(); - - return response; - } - - private static DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/DeleteBucketIntelligentTieringConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/DeleteBucketIntelligentTieringConfigurationRequest.cs similarity index 65% rename from sdk/src/Services/S3/Custom/Model/DeleteBucketIntelligentTieringConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/DeleteBucketIntelligentTieringConfigurationRequest.cs index fd1b1a290c76..eb5f694922e7 100644 --- a/sdk/src/Services/S3/Custom/Model/DeleteBucketIntelligentTieringConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/DeleteBucketIntelligentTieringConfigurationRequest.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,33 @@ * 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 DeleteBucketIntelligentTieringConfiguration operation. + /// + /// + /// This operation is not supported for directory buckets. + /// + /// + /// /// Deletes the S3 Intelligent-Tiering configuration from the specified bucket. - /// + /// /// /// /// The S3 Intelligent-Tiering storage class is designed to optimize storage costs by @@ -48,7 +63,7 @@ namespace Amazon.S3.Model /// /// /// - /// Operations related to DeleteBucketIntelligentTieringConfiguration include: + /// Operations related to DeleteBucketIntelligentTieringConfiguration include: /// /// /// + /// + /// + /// 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 DeleteBucketIntelligentTieringConfigurationRequest : AmazonWebServiceRequest - { - private string bucketName; - private string expectedBucketOwner; - private string intelligentTieiringId; + public partial class DeleteBucketIntelligentTieringConfigurationRequest : AmazonWebServiceRequest + { + private string _bucketName; + private string _expectedBucketOwner; + 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 !(string.IsNullOrEmpty(this.bucketName)); + return this._bucketName != null; } /// @@ -99,29 +124,34 @@ 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 IntelligentTieringId. + /// + /// The ID used to identify the S3 Intelligent-Tiering configuration. + /// /// + [AWSProperty(Required=true)] public string IntelligentTieringId { - get { return this.intelligentTieiringId; } - set { this.intelligentTieiringId = value; } + get { return this._intelligentTieringId; } + set { this._intelligentTieringId = value; } } - // Check to see if IntelligentTieiringId property is set - internal bool IsSetIntelligentTieiringId() + // Check to see if IntelligentTieringId property is set + internal bool IsSetIntelligentTieringId() { - return !(string.IsNullOrEmpty(this.IntelligentTieringId)); + return this._intelligentTieringId != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/DeleteBucketIntelligentTieringConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/DeleteBucketIntelligentTieringConfigurationResponse.cs new file mode 100644 index 000000000000..eb270e6f71c2 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/DeleteBucketIntelligentTieringConfigurationResponse.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 DeleteBucketIntelligentTieringConfiguration operation. + /// + public partial class DeleteBucketIntelligentTieringConfigurationResponse : AmazonWebServiceResponse + { + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..de8ea636d51d --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationRequestMarshaller.cs @@ -0,0 +1,101 @@ +/* + * 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 +{ + /// + /// DeleteBucketIntelligentTieringConfiguration Request Marshaller + /// + public partial class DeleteBucketIntelligentTieringConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((DeleteBucketIntelligentTieringConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(DeleteBucketIntelligentTieringConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "DELETE"; + 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.", "DeleteBucketIntelligentTieringConfigurationRequest.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 = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static DeleteBucketIntelligentTieringConfigurationRequestMarshaller _instance = new DeleteBucketIntelligentTieringConfigurationRequestMarshaller(); + + internal static DeleteBucketIntelligentTieringConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static DeleteBucketIntelligentTieringConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketIntelligentTieringConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketIntelligentTieringConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..fcb9700cbf91 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller.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 DeleteBucketIntelligentTieringConfiguration operation + /// + public partial class DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + DeleteBucketIntelligentTieringConfigurationResponse response = new DeleteBucketIntelligentTieringConfigurationResponse(); + + 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, DeleteBucketIntelligentTieringConfigurationResponse response); + + private static DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller _instance = new DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller(); + + internal static DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static DeleteBucketIntelligentTieringConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file From 663b3995c205822b5ac8a6c96c79823a35ed47ce Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 19 Nov 2025 23:51:31 -0800 Subject: [PATCH 5/5] add shapes to S3NeedsCustomUpdate and add devconfig stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4149, branch: peterrsongg/petesong/phase-3-pr-3/5 --- .../0c5568ff-1b20-4cd6-a5cf-2e676424569a.json | 11 +++++++++++ .../ServiceClientGeneratorLib/GeneratorDriver.cs | 9 +++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 generator/.DevConfigs/0c5568ff-1b20-4cd6-a5cf-2e676424569a.json diff --git a/generator/.DevConfigs/0c5568ff-1b20-4cd6-a5cf-2e676424569a.json b/generator/.DevConfigs/0c5568ff-1b20-4cd6-a5cf-2e676424569a.json new file mode 100644 index 000000000000..6a45432313ac --- /dev/null +++ b/generator/.DevConfigs/0c5568ff-1b20-4cd6-a5cf-2e676424569a.json @@ -0,0 +1,11 @@ +{ + "services": [ + { + "serviceName": "S3", + "type": "patch", + "changeLogMessages": [ + "Generate 4 more S3 operations" + ] + } + ] +} \ No newline at end of file diff --git a/generator/ServiceClientGeneratorLib/GeneratorDriver.cs b/generator/ServiceClientGeneratorLib/GeneratorDriver.cs index 35d7941ddbda..a34e5cc985b2 100644 --- a/generator/ServiceClientGeneratorLib/GeneratorDriver.cs +++ b/generator/ServiceClientGeneratorLib/GeneratorDriver.cs @@ -1719,8 +1719,13 @@ private void S3NeedsCustomUpdate(Shape shape) // a dictionary of shape name to number of members that shape has var customUpdateShapes = new Dictionary { - {"LifecycleFilter", 5 }, - {"MetricsFilter", 4 } + { "LifecycleFilter", 5 }, + { "MetricsFilter", 4 }, + { "AnalyticsFilter", 3 }, + { "IntelligentTieringFilter", 3 }, + { "MetricsAndOperator", 3 }, + { "AnalyticsAndOperator", 2 }, + { "IntelligentTieringAndOperator", 2} }; if (customUpdateShapes.TryGetValue(shape.Name, out int membersCount)) {