From 4ce1e050a3c383eea65de3d84d0340a4d5dddb2e Mon Sep 17 00:00:00 2001 From: Peter Song Date: Fri, 21 Nov 2025 12:50:29 -0800 Subject: [PATCH 01/11] Generate PutBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4154, branch: peterrsongg/petesong/phase-3-pr4-3/1 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 58 +++++- ...InventoryConfigurationRequestMarshaller.cs | 164 +-------------- ...entoryConfigurationResponseUnmarshaller.cs | 63 ------ .../S3/Custom/Model/InventoryConfiguration.cs | 155 -------------- .../Model/InventoryS3BucketDestination.cs | 113 ----------- ...InventoryConfigurationRequestMarshaller.cs | 183 +++++++++++++++++ ...entoryConfigurationResponseUnmarshaller.cs | 98 +++++++++ .../Generated/Model/InventoryConfiguration.cs | 189 ++++++++++++++++++ .../Model/InventoryDestination.cs | 37 ++-- .../Model/InventoryEncryption.cs | 53 +++-- .../Model/InventoryS3BucketDestination.cs | 144 +++++++++++++ .../Model/InventorySchedule.cs | 28 ++- .../PutBucketInventoryConfigurationRequest.cs | 110 ++++++---- ...PutBucketInventoryConfigurationResponse.cs | 14 +- .../S3/{Custom => Generated}/Model/SSEKMS.cs | 29 ++- .../S3/{Custom => Generated}/Model/SSES3.cs | 17 +- 17 files changed, 867 insertions(+), 590 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/InventoryConfiguration.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/InventoryS3BucketDestination.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/InventoryConfiguration.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/InventoryDestination.cs (52%) rename sdk/src/Services/S3/{Custom => Generated}/Model/InventoryEncryption.cs (54%) create mode 100644 sdk/src/Services/S3/Generated/Model/InventoryS3BucketDestination.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/InventorySchedule.cs (60%) rename sdk/src/Services/S3/{Custom => Generated}/Model/PutBucketInventoryConfigurationRequest.cs (71%) rename sdk/src/Services/S3/{Custom => Generated}/Model/PutBucketInventoryConfigurationResponse.cs (73%) rename sdk/src/Services/S3/{Custom => Generated}/Model/SSEKMS.cs (60%) rename sdk/src/Services/S3/{Custom => Generated}/Model/SSES3.cs (69%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 2cfa398745f6..06674aeb4b86 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -566,7 +566,7 @@ public List S3AllowListOperations //new Operation(this, "SelectObjectContent", DocumentRoot[OperationsKey]["SelectObjectContent"]), new Operation(this, "PutBucketAnalyticsConfiguration" , DocumentRoot[OperationsKey]["PutBucketAnalyticsConfiguration"]), new Operation(this, "PutBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["PutBucketIntelligentTieringConfiguration"]), - //new Operation(this, "PutBucketInventoryConfiguration", DocumentRoot[OperationsKey]["PutBucketInventoryConfiguration"]), + new Operation(this, "PutBucketInventoryConfiguration", DocumentRoot[OperationsKey]["PutBucketInventoryConfiguration"]), new Operation(this, "PutBucketMetricsConfiguration", DocumentRoot[OperationsKey]["PutBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketMetricsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketAnalyticsConfiguration"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 6dc8337d042c..9d308e46e263 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1076,7 +1076,59 @@ "Id":{"emitPropertyName": "IntelligentTieringId"} } ] + }, + "PutBucketInventoryConfigurationRequest":{ + "modify":[ + { + "Id" :{"emitPropertyName":"InventoryId"} + }, + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] + }, + "InventoryConfiguration":{ + "modify":[ + { + "Filter":{"emitPropertyName":"InventoryFilter"} + }, + { + "Id":{"emitPropertyName":"InventoryId"} + }, + { + "InventoryId":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._inventoryId);"]} + }, + { + "OptionalFields":{"emitPropertyName": "InventoryOptionalFields"} + }, + { + "InventoryFilter":{"injectXmlMarshallCode":["InventoryFilterCustomMarshall(publicRequest, xmlWriter);"]} + }, + { + "IsEnabled":{"injectXmlMarshallCode":["xmlWriter.WriteElementString(\"IsEnabled\", StringUtils.FromBool(publicRequest.InventoryConfiguration.IsEnabled.GetValueOrDefault()));"]} + } + ] + }, + "InventoryS3BucketDestination":{ + "modify":[ + { + "AccountId":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._accountId);"]} + }, + { + "BucketName":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._bucketName);"]} + }, + { + "Encryption":{"emitPropertyName": "InventoryEncryption"} + }, + { + "Prefix":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._prefix);"]} + }, + { + "Format":{"emitPropertyName":"InventoryFormat"} + } + ] } + }, "operationModifiers": { "CreateBucket": { @@ -1221,7 +1273,8 @@ } }, "overrideTreatEnumsAsString":{ - "ObjectAttributesList": false + "ObjectAttributesList": false, + "InventoryOptionalFields": false }, "dataTypeSwap":{ "ListPartsRequest":{ @@ -1452,6 +1505,7 @@ "AnalyticsFilter", "AnalyticsAndOperator", "IntelligentTieringFilter", - "IntelligentTieringAndOperator" + "IntelligentTieringAndOperator", + "InventoryFilter" ] } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs index e4810ed3fee5..faa35aac061e 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs @@ -32,166 +32,22 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Request Marshaller for PutInventoryConfiguration operation /// - public class PutBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller + public partial class PutBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketInventoryConfigurationRequest publicRequest) { - return this.Marshall((PutBucketInventoryConfigurationRequest)input); + ChecksumUtils.SetChecksumData(defaultRequest); } - public IRequest Marshall(PutBucketInventoryConfigurationRequest putBucketInventoryConfigurationRequest) - { - IRequest request = new DefaultRequest(putBucketInventoryConfigurationRequest, "Amazon.S3"); - - request.HttpMethod = "PUT"; - - if (putBucketInventoryConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(putBucketInventoryConfigurationRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(putBucketInventoryConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "PutBucketInventoryConfigurationRequest.BucketName"); - - request.ResourcePath = "/"; - - request.AddSubResource("inventory"); - - if (putBucketInventoryConfigurationRequest.IsSetInventoryId()) - { - request.AddSubResource("id", S3Transforms.ToStringValue(putBucketInventoryConfigurationRequest.InventoryId)); - } - - 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 (putBucketInventoryConfigurationRequest.IsSetInventoryConfiguration()) - { - var inventoryConfiguration = putBucketInventoryConfigurationRequest.InventoryConfiguration; - xmlWriter.WriteStartElement("InventoryConfiguration", S3Constants.S3RequestXmlNamespace); - if (inventoryConfiguration != null) - { - if (inventoryConfiguration.IsSetDestination()) - { - InventoryDestination inventoryDestination = inventoryConfiguration.Destination; - xmlWriter.WriteStartElement("Destination"); - if (inventoryDestination.isSetS3BucketDestination()) - { - InventoryS3BucketDestination inventoryS3BucketDestination = inventoryDestination.S3BucketDestination; - xmlWriter.WriteStartElement("S3BucketDestination"); - if (inventoryS3BucketDestination.IsSetAccountId()) - { - xmlWriter.WriteElementString("AccountId", S3Transforms.ToXmlStringValue(inventoryS3BucketDestination.AccountId)); - } - if (inventoryS3BucketDestination.IsSetBucketName()) - { - xmlWriter.WriteElementString("Bucket", S3Transforms.ToXmlStringValue(inventoryS3BucketDestination.BucketName)); - } - if (inventoryS3BucketDestination.IsSetInventoryFormat()) - { - xmlWriter.WriteElementString("Format", S3Transforms.ToXmlStringValue(inventoryS3BucketDestination.InventoryFormat)); - } - if (inventoryS3BucketDestination.IsSetPrefix()) - { - xmlWriter.WriteElementString("Prefix", S3Transforms.ToXmlStringValue(inventoryS3BucketDestination.Prefix)); - } - if (inventoryS3BucketDestination.IsSetInventoryEncryption()) - { - xmlWriter.WriteStartElement("Encryption"); - var inventoryEncryption = inventoryS3BucketDestination.InventoryEncryption; - if (inventoryEncryption.IsSetSSEKMS()) - { - xmlWriter.WriteStartElement("SSE-KMS"); - if (inventoryEncryption.SSEKMS.IsSetKeyId()) - { - xmlWriter.WriteElementString("KeyId", S3Transforms.ToXmlStringValue(inventoryEncryption.SSEKMS.KeyId)); - } - xmlWriter.WriteEndElement(); - } - if (inventoryEncryption.IsSetSSES3()) - { - xmlWriter.WriteStartElement("SSE-S3"); - xmlWriter.WriteEndElement(); - } - xmlWriter.WriteEndElement(); - } - xmlWriter.WriteEndElement(); - } - xmlWriter.WriteEndElement(); - } - - xmlWriter.WriteElementString("IsEnabled", S3Transforms.ToXmlStringValue(inventoryConfiguration.IsEnabled.GetValueOrDefault())); - - if (inventoryConfiguration.IsSetInventoryFilter()) - { - xmlWriter.WriteStartElement("Filter"); - var predicate = inventoryConfiguration.InventoryFilter.InventoryFilterPredicate; - predicate.Accept(new InventoryPredicateVisitor(xmlWriter)); - xmlWriter.WriteEndElement(); - } - - if(inventoryConfiguration.IsSetInventoryId()) - { - xmlWriter.WriteElementString("Id", S3Transforms.ToXmlStringValue(inventoryConfiguration.InventoryId)); - } - - if(inventoryConfiguration.IsSetIncludedObjectVersions()) - { - xmlWriter.WriteElementString("IncludedObjectVersions", S3Transforms.ToXmlStringValue(inventoryConfiguration.IncludedObjectVersions)); - } - - if (inventoryConfiguration.IsSetInventoryOptionalFields()) - { - xmlWriter.WriteStartElement("OptionalFields"); - foreach (var inventoryOptionalField in inventoryConfiguration.InventoryOptionalFields) - { - xmlWriter.WriteElementString("Field", S3Transforms.ToXmlStringValue(inventoryOptionalField)); - } - xmlWriter.WriteEndElement(); - } - - if(inventoryConfiguration.IsSetSchedule()) - { - xmlWriter.WriteStartElement("Schedule"); - var inventorySchedule = inventoryConfiguration.Schedule; - if (inventorySchedule.IsFrequency()) - { - xmlWriter.WriteElementString("Frequency", S3Transforms.ToXmlStringValue(inventorySchedule.Frequency)); - } - xmlWriter.WriteEndElement(); - } - } - xmlWriter.WriteEndElement(); - } - } - - try - { - var content = stringWriter.ToString(); - request.Content = Encoding.UTF8.GetBytes(content); - request.Headers[HeaderKeys.ContentTypeHeader] = "application/xml"; - - ChecksumUtils.SetChecksumData(request); - } - catch (EncoderFallbackException e) - { - throw new AmazonServiceException("Unable to marshall request to XML", e); - } - - return request; - } - - private static PutBucketInventoryConfigurationRequestMarshaller _instance; - /// - /// Singleton for marshaller - /// - public static PutBucketInventoryConfigurationRequestMarshaller Instance + void InventoryFilterCustomMarshall(PutBucketInventoryConfigurationRequest publicRequest, XmlWriter xmlWriter) { - get + var inventoryConfiguration = publicRequest.InventoryConfiguration; + if (inventoryConfiguration.IsSetInventoryFilter()) { - if (_instance == null) - { - _instance = new PutBucketInventoryConfigurationRequestMarshaller(); - } - return _instance; + xmlWriter.WriteStartElement("Filter"); + var predicate = inventoryConfiguration.InventoryFilter.InventoryFilterPredicate; + predicate.Accept(new InventoryPredicateVisitor(xmlWriter)); + xmlWriter.WriteEndElement(); } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs deleted file mode 100644 index 90a8b29c087d..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,63 +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.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for PutBucketWebsite operation - /// - public class PutBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - PutBucketInventoryConfigurationResponse response = new PutBucketInventoryConfigurationResponse(); - - - return response; - } - - private static PutBucketInventoryConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static PutBucketInventoryConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketInventoryConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - - } -} - - diff --git a/sdk/src/Services/S3/Custom/Model/InventoryConfiguration.cs b/sdk/src/Services/S3/Custom/Model/InventoryConfiguration.cs deleted file mode 100644 index 7ed4cbd64964..000000000000 --- a/sdk/src/Services/S3/Custom/Model/InventoryConfiguration.cs +++ /dev/null @@ -1,155 +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.Xml.Serialization; -using System.Text; -using System.IO; - - -namespace Amazon.S3.Model -{ - /// - /// Specifies the inventory configuration for an Amazon S3 bucket. For more information, - /// see GET - /// Bucket inventory in the Amazon S3 API Reference. - /// - public class InventoryConfiguration - { - private InventoryDestination inventoryDestination; - private InventoryFilter inventoryFilter; - private string inventoryId; - private bool? isEnabled; - private InventoryIncludedObjectVersions inventoryIncludedObjectVersions; - private List inventoryOptionalFields = AWSConfigs.InitializeCollections ? new List() : null; - private InventorySchedule inventorySchedule; - - /// - /// Gets and sets the property Destination. - /// - /// Contains information about where to publish the inventory results. - /// - /// - public InventoryDestination Destination - { - get { return this.inventoryDestination; } - set { this.inventoryDestination = value; } - } - - // Check to see if Destination property is set - internal bool IsSetDestination() - { - return this.inventoryDestination != null; - } - - /// - /// Specifies an inventory filter. The inventory only includes objects that meet the filter's criteria. - /// - public InventoryFilter InventoryFilter - { - get { return this.inventoryFilter; } - set { this.inventoryFilter = value; } - } - - // Check to see if InventoryFilter property is set - internal bool IsSetInventoryFilter() - { - return this.inventoryFilter != null; - } - - /// - /// The ID used to identify the inventory configuration. - /// - public string InventoryId - { - get { return this.inventoryId; } - set { this.inventoryId = value; } - } - - // Check to see if InventoryId property is set - internal bool IsSetInventoryId() - { - return !(string.IsNullOrEmpty(this.inventoryId)); - } - - /// - /// Gets and sets the property IncludedObjectVersions. - /// - /// Object versions to include in the inventory list. If set to All, the - /// list includes all the object versions, which adds the version-related fields VersionId, - /// IsLatest, and DeleteMarker to the list. If set to Current, - /// the list does not contain these version-related fields. - /// - /// - public InventoryIncludedObjectVersions IncludedObjectVersions - { - get { return this.inventoryIncludedObjectVersions; } - set { this.inventoryIncludedObjectVersions = value; } - } - - // Check to see if IncludedObjectVersions property is set - internal bool IsSetIncludedObjectVersions() - { - return this.inventoryIncludedObjectVersions != null; - } - - /// - /// Gets and sets the property IsEnabled. - /// - /// Specifies whether the inventory is enabled or disabled. If set to True, - /// an inventory list is generated. If set to False, no inventory list is - /// generated. - /// - /// - public bool? IsEnabled - { - get { return this.isEnabled; } - set { this.isEnabled = value; } - } - - /// - /// Contains the optional fields that are included in the inventory results. - /// - public List InventoryOptionalFields - { - get { return this.inventoryOptionalFields; } - set { this.inventoryOptionalFields = value; } - } - - // Check to see if InventoryOptionalFields property is set - internal bool IsSetInventoryOptionalFields() - { - return this.inventoryOptionalFields != null && (this.inventoryOptionalFields.Count > 0 || !AWSConfigs.InitializeCollections); - } - - /// - /// Gets and sets the property Schedule. - /// - /// Specifies the schedule for generating inventory results. - /// - /// - public InventorySchedule Schedule - { - get { return this.inventorySchedule; } - set { this.inventorySchedule = value; } - } - - // Check to see if Schedule property is set - internal bool IsSetSchedule() - { - return this.inventorySchedule != null; - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/InventoryS3BucketDestination.cs b/sdk/src/Services/S3/Custom/Model/InventoryS3BucketDestination.cs deleted file mode 100644 index 1f13f571d80b..000000000000 --- a/sdk/src/Services/S3/Custom/Model/InventoryS3BucketDestination.cs +++ /dev/null @@ -1,113 +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.Xml.Serialization; -using System.Text; -using System.IO; - - -namespace Amazon.S3.Model -{ - /// - /// The InventoryS3BucketDestination contains information where the inventory results will be saved in S3. - /// - public class InventoryS3BucketDestination - { - private string accountId; - private string bucketName; - private string prefix; - private InventoryFormat inventoryFormat; - private InventoryEncryption inventoryEncryption; - /// - /// The ID of the account that owns the destination bucket. - /// - public string AccountId - { - get { return this.accountId; } - set { this.accountId = value; } - } - - /// - /// Check to see if AccountId property is set - /// - /// - public bool IsSetAccountId() - { - return !(string.IsNullOrEmpty(this.accountId)); - } - - /// - /// The Amazon resource name (ARN) of the bucket where inventory results will be published. - /// - public string BucketName - { - get { return this.bucketName; } - set { this.bucketName = value; } - } - - // Check to see if BucketName property is set - internal bool IsSetBucketName() - { - return !(string.IsNullOrEmpty(this.bucketName)); - } - /// - /// The prefix that is prepended to all inventory results. - /// - public string Prefix - { - get { return this.prefix; } - set { this.prefix = value; } - } - - - // Check to see if Prefix property is set - internal bool IsSetPrefix() - { - return !(string.IsNullOrEmpty(this.prefix)); - } - - /// - /// Specifies the output format of the inventory results. - /// - public InventoryFormat InventoryFormat - { - get { return this.inventoryFormat; } - set { this.inventoryFormat = value; } - } - - // Check to see if InventoryFormat property is set - internal bool IsSetInventoryFormat() - { - return this.inventoryFormat != null; - } - - /// - /// Contains the type of server-side encryption used to encrypt the inventory results. - /// - public InventoryEncryption InventoryEncryption - { - get { return this.inventoryEncryption; } - set { this.inventoryEncryption = value; } - } - - // Check to see if InventoryEncryption property is set - internal bool IsSetInventoryEncryption() - { - return this.inventoryEncryption != null; - } - - } -} diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..ebc864c67a80 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs @@ -0,0 +1,183 @@ +/* + * 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 +{ + /// + /// PutBucketInventoryConfiguration Request Marshaller + /// + public partial class PutBucketInventoryConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((PutBucketInventoryConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(PutBucketInventoryConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "PUT"; + request.AddSubResource("inventory"); + + 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.", "PutBucketInventoryConfigurationRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.InventoryId)) + throw new AmazonS3Exception("Request object does not have required field InventoryId set"); + + if (publicRequest.IsSetInventoryId()) + request.Parameters.Add("id", StringUtils.FromString(publicRequest.InventoryId)); + 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.IsSetInventoryConfiguration()) + { + xmlWriter.WriteStartElement("InventoryConfiguration", "http://s3.amazonaws.com/doc/2006-03-01/"); + if (publicRequest.InventoryConfiguration.Destination != null) + { + xmlWriter.WriteStartElement("Destination"); + if (publicRequest.InventoryConfiguration.Destination.S3BucketDestination != null) + { + xmlWriter.WriteStartElement("S3BucketDestination"); + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.IsSetAccountId()) + xmlWriter.WriteElementString("AccountId", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.AccountId)); + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.IsSetBucketName()) + xmlWriter.WriteElementString("Bucket", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.BucketName)); + if (publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption != null) + { + xmlWriter.WriteStartElement("Encryption"); + if (publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption.SSEKMS != null) + { + xmlWriter.WriteStartElement("SSE-KMS"); + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption.SSEKMS.IsSetKeyId()) + xmlWriter.WriteElementString("KeyId", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption.SSEKMS.KeyId)); + xmlWriter.WriteEndElement(); + } + if (publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption.SSES3 != null) + { + xmlWriter.WriteStartElement("SSE-S3"); + xmlWriter.WriteEndElement(); + } + xmlWriter.WriteEndElement(); + } + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.IsSetInventoryFormat()) + xmlWriter.WriteElementString("Format", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryFormat)); + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.IsSetPrefix()) + xmlWriter.WriteElementString("Prefix", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.Prefix)); + xmlWriter.WriteEndElement(); + } + xmlWriter.WriteEndElement(); + } + if(publicRequest.InventoryConfiguration.IsSetIncludedObjectVersions()) + xmlWriter.WriteElementString("IncludedObjectVersions", StringUtils.FromString(publicRequest.InventoryConfiguration.IncludedObjectVersions)); + + InventoryFilterCustomMarshall(publicRequest, xmlWriter); + if(publicRequest.InventoryConfiguration.IsSetInventoryId()) + xmlWriter.WriteElementString("Id", StringUtils.FromString(publicRequest.InventoryConfiguration.InventoryId)); + + var publicRequestInventoryConfigurationInventoryOptionalFields = publicRequest.InventoryConfiguration.InventoryOptionalFields; + if (publicRequestInventoryConfigurationInventoryOptionalFields != null && (publicRequestInventoryConfigurationInventoryOptionalFields.Count > 0 || !AWSConfigs.InitializeCollections)) + { + xmlWriter.WriteStartElement("OptionalFields"); + foreach (var publicRequestInventoryConfigurationInventoryOptionalFieldsValue in publicRequestInventoryConfigurationInventoryOptionalFields) + { + xmlWriter.WriteStartElement("Field"); + xmlWriter.WriteValue(publicRequestInventoryConfigurationInventoryOptionalFieldsValue); + xmlWriter.WriteEndElement(); + } + xmlWriter.WriteEndElement(); + } + xmlWriter.WriteElementString("IsEnabled", StringUtils.FromBool(publicRequest.InventoryConfiguration.IsEnabled.GetValueOrDefault())); + if (publicRequest.InventoryConfiguration.Schedule != null) + { + xmlWriter.WriteStartElement("Schedule"); + if(publicRequest.InventoryConfiguration.Schedule.IsSetFrequency()) + xmlWriter.WriteElementString("Frequency", StringUtils.FromString(publicRequest.InventoryConfiguration.Schedule.Frequency)); + 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 PutBucketInventoryConfigurationRequestMarshaller _instance = new PutBucketInventoryConfigurationRequestMarshaller(); + + internal static PutBucketInventoryConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketInventoryConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketInventoryConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, PutBucketInventoryConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..ffc4357b83b3 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.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 PutBucketInventoryConfiguration operation + /// + public partial class PutBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + PutBucketInventoryConfigurationResponse response = new PutBucketInventoryConfigurationResponse(); + + 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, PutBucketInventoryConfigurationResponse response); + + private static PutBucketInventoryConfigurationResponseUnmarshaller _instance = new PutBucketInventoryConfigurationResponseUnmarshaller(); + + internal static PutBucketInventoryConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketInventoryConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/InventoryConfiguration.cs b/sdk/src/Services/S3/Generated/Model/InventoryConfiguration.cs new file mode 100644 index 000000000000..a148486ec4a1 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/InventoryConfiguration.cs @@ -0,0 +1,189 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Specifies the S3 Inventory configuration for an Amazon S3 bucket. For more information, + /// see GET + /// Bucket inventory in the Amazon S3 API Reference. + /// + public partial class InventoryConfiguration + { + private InventoryDestination _destination; + private InventoryIncludedObjectVersions _includedObjectVersions; + private InventoryFilter _inventoryFilter; + private string _inventoryId; + private List _inventoryOptionalFields = AWSConfigs.InitializeCollections ? new List() : null; + private bool? _isEnabled; + private InventorySchedule _schedule; + + /// + /// Gets and sets the property Destination. + /// + /// Contains information about where to publish the inventory results. + /// + /// + [AWSProperty(Required=true)] + public InventoryDestination Destination + { + get { return this._destination; } + set { this._destination = value; } + } + + // Check to see if Destination property is set + internal bool IsSetDestination() + { + return this._destination != null; + } + + /// + /// Gets and sets the property IncludedObjectVersions. + /// + /// Object versions to include in the inventory list. If set to All, the list includes + /// all the object versions, which adds the version-related fields VersionId, IsLatest, + /// and DeleteMarker to the list. If set to Current, the list does not contain + /// these version-related fields. + /// + /// + [AWSProperty(Required=true)] + public InventoryIncludedObjectVersions IncludedObjectVersions + { + get { return this._includedObjectVersions; } + set { this._includedObjectVersions = value; } + } + + // Check to see if IncludedObjectVersions property is set + internal bool IsSetIncludedObjectVersions() + { + return this._includedObjectVersions != null; + } + + /// + /// Gets and sets the property InventoryFilter. + /// + /// Specifies an inventory filter. The inventory only includes objects that meet the filter's + /// criteria. + /// + /// + public InventoryFilter InventoryFilter + { + get { return this._inventoryFilter; } + set { this._inventoryFilter = value; } + } + + // Check to see if InventoryFilter property is set + internal bool IsSetInventoryFilter() + { + return this._inventoryFilter != null; + } + + /// + /// Gets and sets the property InventoryId. + /// + /// The ID used to identify the inventory configuration. + /// + /// + [AWSProperty(Required=true)] + public string InventoryId + { + get { return this._inventoryId; } + set { this._inventoryId = value; } + } + + // Check to see if InventoryId property is set + internal bool IsSetInventoryId() + { + return !String.IsNullOrEmpty(this._inventoryId); + } + + /// + /// Gets and sets the property InventoryOptionalFields. + /// + /// Contains the optional fields that are included in the inventory results. + /// + /// + /// 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 InventoryOptionalFields + { + get { return this._inventoryOptionalFields; } + set { this._inventoryOptionalFields = value; } + } + + // Check to see if InventoryOptionalFields property is set + internal bool IsSetInventoryOptionalFields() + { + return this._inventoryOptionalFields != null && (this._inventoryOptionalFields.Count > 0 || !AWSConfigs.InitializeCollections); + } + + /// + /// Gets and sets the property IsEnabled. + /// + /// Specifies whether the inventory is enabled or disabled. If set to True, an + /// inventory list is generated. If set to False, no inventory list is generated. + /// + /// + [AWSProperty(Required=true)] + public bool? IsEnabled + { + get { return this._isEnabled; } + set { this._isEnabled = value; } + } + + // Check to see if IsEnabled property is set + internal bool IsSetIsEnabled() + { + return this._isEnabled.HasValue; + } + + /// + /// Gets and sets the property Schedule. + /// + /// Specifies the schedule for generating inventory results. + /// + /// + [AWSProperty(Required=true)] + public InventorySchedule Schedule + { + get { return this._schedule; } + set { this._schedule = value; } + } + + // Check to see if Schedule property is set + internal bool IsSetSchedule() + { + return this._schedule != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/InventoryDestination.cs b/sdk/src/Services/S3/Generated/Model/InventoryDestination.cs similarity index 52% rename from sdk/src/Services/S3/Custom/Model/InventoryDestination.cs rename to sdk/src/Services/S3/Generated/Model/InventoryDestination.cs index 54ec52c9b15c..169b309a6828 100644 --- a/sdk/src/Services/S3/Custom/Model/InventoryDestination.cs +++ b/sdk/src/Services/S3/Generated/Model/InventoryDestination.cs @@ -12,38 +12,49 @@ * 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 { /// - /// Class for InventoryDestination + /// Specifies the S3 Inventory configuration for an Amazon S3 bucket. /// - public class InventoryDestination + public partial class InventoryDestination { - private InventoryS3BucketDestination inventoryS3BucketDestination; + private InventoryS3BucketDestination _s3BucketDestination; /// - /// Contains the bucket name, file format, bucket owner (optional), and prefix (optional) where inventory results are published. + /// Gets and sets the property S3BucketDestination. + /// + /// Contains the bucket name, file format, bucket owner (optional), and prefix (optional) + /// where inventory results are published. + /// /// + [AWSProperty(Required=true)] public InventoryS3BucketDestination S3BucketDestination { - get { return this.inventoryS3BucketDestination; } - set { this.inventoryS3BucketDestination = value; } + get { return this._s3BucketDestination; } + set { this._s3BucketDestination = value; } } - /// - /// Check to see if S3BucketDestination property is set - /// - /// - public bool isSetS3BucketDestination() + // Check to see if S3BucketDestination property is set + internal bool IsSetS3BucketDestination() { - return this.inventoryS3BucketDestination != null; + return this._s3BucketDestination != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/InventoryEncryption.cs b/sdk/src/Services/S3/Generated/Model/InventoryEncryption.cs similarity index 54% rename from sdk/src/Services/S3/Custom/Model/InventoryEncryption.cs rename to sdk/src/Services/S3/Generated/Model/InventoryEncryption.cs index 716786682e8d..e580c2f9146f 100644 --- a/sdk/src/Services/S3/Custom/Model/InventoryEncryption.cs +++ b/sdk/src/Services/S3/Generated/Model/InventoryEncryption.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,52 +13,65 @@ * 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 { /// - /// InventoryEncryption class + /// Contains the type of server-side encryption used to encrypt the S3 Inventory results. /// - public class InventoryEncryption + public partial class InventoryEncryption { - private SSES3 sSES3; - private SSEKMS sSEKms; + private SSEKMS _ssekms; + private SSES3 _sses3; /// - /// Specifies the use of SSE-S3 to encrypt delievered Inventory reports. + /// Gets and sets the property SSEKMS. + /// + /// Specifies the use of SSE-KMS to encrypt delivered inventory reports. + /// /// - public SSES3 SSES3 + public SSEKMS SSEKMS { - get { return this.sSES3; } - set { this.sSES3 = value; } + get { return this._ssekms; } + set { this._ssekms = value; } } - // Check to see if SSES3 property is set - internal bool IsSetSSES3() + // Check to see if SSEKMS property is set + internal bool IsSetSSEKMS() { - return this.sSES3 != null; + return this._ssekms != null; } /// - /// Specifies the use of SSE-KMS to encrypt delievered Inventory reports. + /// Gets and sets the property SSES3. + /// + /// Specifies the use of SSE-S3 to encrypt delivered inventory reports. + /// /// - public SSEKMS SSEKMS + public SSES3 SSES3 { - get { return this.sSEKms; } - set { this.sSEKms = value; } + get { return this._sses3; } + set { this._sses3 = value; } } - // Check to see if SSEKMS property is set - internal bool IsSetSSEKMS() + // Check to see if SSES3 property is set + internal bool IsSetSSES3() { - return this.sSEKms != null; + return this._sses3 != null; } - } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/InventoryS3BucketDestination.cs b/sdk/src/Services/S3/Generated/Model/InventoryS3BucketDestination.cs new file mode 100644 index 000000000000..9997bfda1cbd --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/InventoryS3BucketDestination.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.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 +{ + /// + /// Contains the bucket name, file format, bucket owner (optional), and prefix (optional) + /// where S3 Inventory results are published. + /// + public partial class InventoryS3BucketDestination + { + private string _accountId; + private string _bucketName; + private InventoryEncryption _inventoryEncryption; + private InventoryFormat _inventoryFormat; + private string _prefix; + + /// + /// Gets and sets the property AccountId. + /// + /// The account ID that owns the destination S3 bucket. If no account ID is provided, + /// the owner is not validated before exporting data. + /// + /// + /// + /// Although this value is optional, we strongly recommend that you set it to help prevent + /// problems if the destination bucket ownership changes. + /// + /// + /// + public string AccountId + { + get { return this._accountId; } + set { this._accountId = value; } + } + + // Check to see if AccountId property is set + internal bool IsSetAccountId() + { + return !String.IsNullOrEmpty(this._accountId); + } + + /// + /// Gets and sets the property BucketName. + /// + /// The Amazon Resource Name (ARN) of the bucket where inventory results will be published. + /// + /// + [AWSProperty(Required=true)] + public string BucketName + { + get { return this._bucketName; } + set { this._bucketName = value; } + } + + // Check to see if BucketName property is set + internal bool IsSetBucketName() + { + return !String.IsNullOrEmpty(this._bucketName); + } + + /// + /// Gets and sets the property InventoryEncryption. + /// + /// Contains the type of server-side encryption used to encrypt the inventory results. + /// + /// + public InventoryEncryption InventoryEncryption + { + get { return this._inventoryEncryption; } + set { this._inventoryEncryption = value; } + } + + // Check to see if InventoryEncryption property is set + internal bool IsSetInventoryEncryption() + { + return this._inventoryEncryption != null; + } + + /// + /// Gets and sets the property InventoryFormat. + /// + /// Specifies the output format of the inventory results. + /// + /// + [AWSProperty(Required=true)] + public InventoryFormat InventoryFormat + { + get { return this._inventoryFormat; } + set { this._inventoryFormat = value; } + } + + // Check to see if InventoryFormat property is set + internal bool IsSetInventoryFormat() + { + return this._inventoryFormat != null; + } + + /// + /// Gets and sets the property Prefix. + /// + /// The prefix that is prepended to all inventory results. + /// + /// + public string Prefix + { + get { return this._prefix; } + set { this._prefix = value; } + } + + // Check to see if Prefix property is set + internal bool IsSetPrefix() + { + return !String.IsNullOrEmpty(this._prefix); + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/InventorySchedule.cs b/sdk/src/Services/S3/Generated/Model/InventorySchedule.cs similarity index 60% rename from sdk/src/Services/S3/Custom/Model/InventorySchedule.cs rename to sdk/src/Services/S3/Generated/Model/InventorySchedule.cs index 10fd782bb2ff..02c99e200455 100644 --- a/sdk/src/Services/S3/Custom/Model/InventorySchedule.cs +++ b/sdk/src/Services/S3/Generated/Model/InventorySchedule.cs @@ -12,36 +12,48 @@ * 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 { /// - /// Class for InventorySchedule + /// Specifies the schedule for generating S3 Inventory results. /// - public class InventorySchedule + public partial class InventorySchedule { - private InventoryFrequency inventoryFrequency; + private InventoryFrequency _frequency; /// + /// Gets and sets the property Frequency. + /// /// Specifies how frequently inventory results are produced. + /// /// + [AWSProperty(Required=true)] public InventoryFrequency Frequency { - get { return this.inventoryFrequency; } - set { this.inventoryFrequency = value; } + get { return this._frequency; } + set { this._frequency = value; } } // Check to see if Frequency property is set - internal bool IsFrequency() + internal bool IsSetFrequency() { - return this.inventoryFrequency != null; + return this._frequency != null; } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationRequest.cs similarity index 71% rename from sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationRequest.cs index d326a75834a8..dcd65ec7d50e 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationRequest.cs @@ -12,26 +12,34 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// /// Container for the parameters to the PutBucketInventoryConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// - /// This implementation of the PUT action adds an inventory configuration - /// (identified by the inventory ID) to the bucket. You can have up to 1,000 inventory - /// configurations per bucket. + /// This implementation of the PUT action adds an S3 Inventory configuration (identified + /// by the inventory ID) to the bucket. You can have up to 1,000 inventory configurations + /// per bucket. /// /// /// @@ -60,14 +68,13 @@ namespace Amazon.S3.Model /// ///
Permissions
/// - /// To use this operation, you must have permission to perform the s3:PutInventoryConfiguration + /// To use this operation, you must have permission to perform the s3:PutInventoryConfiguration /// action. The bucket owner has this permission by default and can grant this permission /// to others. /// /// /// - /// The s3:PutInventoryConfiguration permission allows a user to create an - /// S3 + /// The s3:PutInventoryConfiguration permission allows a user to create an S3 /// Inventory report that includes all object metadata fields available and to specify /// the destination bucket to store the inventory. A user with read access to objects /// in the destination bucket can also access all object metadata fields that are available @@ -85,7 +92,7 @@ namespace Amazon.S3.Model /// ///
/// - /// PutBucketInventoryConfiguration has the following special errors: + /// PutBucketInventoryConfiguration has the following special errors: /// ///
HTTP 400 Bad Request Error
/// @@ -107,12 +114,12 @@ 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:PutInventoryConfiguration bucket permission to set the configuration - /// on the bucket. + /// s3:PutInventoryConfiguration bucket permission to set the configuration on + /// the bucket. /// ///
/// - /// The following operations are related to PutBucketInventoryConfiguration: + /// The following operations are related to PutBucketInventoryConfiguration: /// /// + /// + /// + /// 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 PutBucketInventoryConfigurationRequest : AmazonWebServiceRequest { - private string bucketName; - private string inventoryId; - private InventoryConfiguration inventoryConfiguration; - private string expectedBucketOwner; + private string _bucketName; + private string _expectedBucketOwner; + private InventoryConfiguration _inventoryConfiguration; + private string _inventoryId; /// + /// Gets and sets the property BucketName. + /// /// The name of the bucket where the inventory configuration will be stored. + /// /// + [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 Bucket property is set + // Check to see if BucketName property is set internal bool IsSetBucketName() { - return !(string.IsNullOrEmpty(this.bucketName)); + return this._bucketName != null; } /// - /// Specifies the inventory Id. + /// 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 InventoryId + public string ExpectedBucketOwner { - get { return this.inventoryId; } - set { this.inventoryId = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - // Check to see if InventoryId property is set - internal bool IsSetInventoryId() + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() { - return !(string.IsNullOrEmpty(this.inventoryId)); + return !String.IsNullOrEmpty(this._expectedBucketOwner); } /// + /// Gets and sets the property InventoryConfiguration. + /// /// Specifies the inventory configuration. + /// /// + [AWSProperty(Required=true)] public InventoryConfiguration InventoryConfiguration { - get { return this.inventoryConfiguration; } - set { this.inventoryConfiguration = value; } + get { return this._inventoryConfiguration; } + set { this._inventoryConfiguration = value; } } // Check to see if InventoryConfiguration property is set internal bool IsSetInventoryConfiguration() { - return this.inventoryConfiguration != null; + return this._inventoryConfiguration != null; } /// - /// Gets and sets the property ExpectedBucketOwner. + /// Gets and sets the property InventoryId. /// - /// 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 ID used to identify the inventory configuration. /// /// - public string ExpectedBucketOwner + [AWSProperty(Required=true)] + public string InventoryId { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._inventoryId; } + set { this._inventoryId = value; } } - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() + // Check to see if InventoryId property is set + internal bool IsSetInventoryId() { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + return this._inventoryId != null; } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationResponse.cs similarity index 73% rename from sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationResponse.cs index d6a1071f7162..92c48676e624 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationResponse.cs @@ -12,20 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// Returns information about the PutInventoryConfigurationResponse response metadata. - /// The PutInventoryConfigurationResponse operation has a void result type. + /// This is the response object from the PutBucketInventoryConfiguration operation. /// public partial class PutBucketInventoryConfigurationResponse : AmazonWebServiceResponse { + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/SSEKMS.cs b/sdk/src/Services/S3/Generated/Model/SSEKMS.cs similarity index 60% rename from sdk/src/Services/S3/Custom/Model/SSEKMS.cs rename to sdk/src/Services/S3/Generated/Model/SSEKMS.cs index d0cc25cc6324..00242e995ce8 100644 --- a/sdk/src/Services/S3/Custom/Model/SSEKMS.cs +++ b/sdk/src/Services/S3/Generated/Model/SSEKMS.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,39 +13,48 @@ * 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 { /// - /// SSEKMS class + /// Specifies the use of SSE-KMS to encrypt delivered inventory reports. /// - public class SSEKMS + public partial class SSEKMS { - private string keyId; + private string _keyId; /// /// Gets and sets the property KeyId. /// - /// Specifies the ID of the Amazon Web Services Key Management Service (Amazon Web Services - /// KMS) symmetric encryption customer managed key to use for encrypting inventory reports. + /// Specifies the ID of the Key Management Service (KMS) symmetric encryption customer + /// managed key to use for encrypting inventory reports. /// /// + [AWSProperty(Required=true, Sensitive=true)] public string KeyId { - get { return this.keyId; } - set { this.keyId = value; } + get { return this._keyId; } + set { this._keyId = value; } } // Check to see if KeyId property is set internal bool IsSetKeyId() { - return this.keyId != null; + return this._keyId != null; } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/SSES3.cs b/sdk/src/Services/S3/Generated/Model/SSES3.cs similarity index 69% rename from sdk/src/Services/S3/Custom/Model/SSES3.cs rename to sdk/src/Services/S3/Generated/Model/SSES3.cs index cbcd212d2755..3b8d9eb8b83c 100644 --- a/sdk/src/Services/S3/Custom/Model/SSES3.cs +++ b/sdk/src/Services/S3/Generated/Model/SSES3.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,18 +13,27 @@ * 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 { /// - /// SSES3 class + /// Specifies the use of SSE-S3 to encrypt delivered inventory reports. /// - public class SSES3 + public partial class SSES3 { + } -} +} \ No newline at end of file From 0880c10b29b8a367077244aef72a4b6dfe0cab4e Mon Sep 17 00:00:00 2001 From: Peter Song Date: Fri, 21 Nov 2025 14:10:49 -0800 Subject: [PATCH 02/11] Generate GetBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4155, branch: peterrsongg/petesong/phase-3-pr4-3/2 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 11 +- ...InventoryConfigurationRequestMarshaller.cs | 50 +------ ...entoryConfigurationResponseUnmarshaller.cs | 139 ------------------ .../InventoryConfigurationUnmarshaller.cs | 120 --------------- .../SSES3Unmarshaller.cs | 71 --------- .../GetBucketInventoryConfigurationRequest.cs | 82 +++++++---- ...GetBucketInventoryConfigurationResponse.cs | 24 ++- ...InventoryConfigurationRequestMarshaller.cs | 101 +++++++++++++ ...entoryConfigurationResponseUnmarshaller.cs | 126 ++++++++++++++++ .../InventoryConfigurationUnmarshaller.cs | 131 +++++++++++++++++ .../InventoryDestinationUnmarshaller.cs | 61 ++++---- .../InventoryEncryptionUnmarshaller.cs | 67 +++++---- ...nventoryS3BucketDestinationUnmarshaller.cs | 83 ++++++----- .../InventoryScheduleUnmarshaller.cs | 60 +++++--- .../SSEKMSUnmarshaller.cs | 63 ++++---- .../SSES3Unmarshaller.cs | 85 +++++++++++ 17 files changed, 724 insertions(+), 552 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketInventoryConfigurationRequest.cs (68%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketInventoryConfigurationResponse.cs (64%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs (56%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs (55%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs (52%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs (54%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs (55%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 06674aeb4b86..43c1252c8c9a 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -552,7 +552,7 @@ public List S3AllowListOperations new Operation(this, "CreateSession", DocumentRoot[OperationsKey]["CreateSession"]), new Operation(this, "GetBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["GetBucketAnalyticsConfiguration"]), new Operation(this, "GetBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["GetBucketIntelligentTieringConfiguration"]), - //new Operation(this, "GetBucketInventoryConfiguration", DocumentRoot[OperationsKey]["GetBucketInventoryConfiguration"]), + new Operation(this, "GetBucketInventoryConfiguration", DocumentRoot[OperationsKey]["GetBucketInventoryConfiguration"]), //new Operation(this, "GetBucketLogging", DocumentRoot[OperationsKey]["GetBucketLogging"]), new Operation(this, "GetBucketMetricsConfiguration", DocumentRoot[OperationsKey]["GetBucketMetricsConfiguration"]), //new Operation(this, "GetBucketVersioning", DocumentRoot[OperationsKey]["GetBucketVersioning"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 9d308e46e263..4a8240b78b4f 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1127,8 +1127,17 @@ "Format":{"emitPropertyName":"InventoryFormat"} } ] + }, + "GetBucketInventoryConfigurationRequest":{ + "modify":[ + { + "Id":{"emitPropertyName":"InventoryId"} + }, + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } - }, "operationModifiers": { "CreateBucket": { diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs index 5b298baf4b49..58eb3a39eb35 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.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"). @@ -21,52 +21,14 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations { - /// - /// Get InventoryConfiguration Request Marshaller + /// + /// Custom marshaller for GetBucketInventoryConfiguration /// - public class GetBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller + public partial class GetBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketInventoryConfigurationRequest publicRequest) { - return this.Marshall((GetBucketInventoryConfigurationRequest)input); - } - - public IRequest Marshall(GetBucketInventoryConfigurationRequest getInventoryConfigurationRequest) - { - IRequest request = new DefaultRequest(getInventoryConfigurationRequest, "Amazon.S3"); - - request.Suppress404Exceptions = true; - request.HttpMethod = "GET"; - - if (getInventoryConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getInventoryConfigurationRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(getInventoryConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetBucketInventoryConfigurationRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("inventory"); - request.AddSubResource("id", getInventoryConfigurationRequest.InventoryId); - request.UseQueryString = true; - - return request; - } - - private static GetBucketInventoryConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static GetBucketInventoryConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketInventoryConfigurationRequestMarshaller(); - } - return _instance; - } + defaultRequest.Suppress404Exceptions = true; } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs deleted file mode 100644 index 847d66c8613b..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,139 +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.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for GetInventoryConfiguration operation - /// - public class GetBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - GetBucketInventoryConfigurationResponse response = new GetBucketInventoryConfigurationResponse(); - - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context, response); - continue; - } - } - - return response; - } - - private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketInventoryConfigurationResponse response) - { - - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - response.InventoryConfiguration = new InventoryConfiguration(); - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - if (context.TestExpression("Destination", targetDepth)) - { - response.InventoryConfiguration.Destination = InventoryDestinationUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("IsEnabled", targetDepth)) - { - response.InventoryConfiguration.IsEnabled = BoolUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Filter", targetDepth)) - { - response.InventoryConfiguration.InventoryFilter = InventoryFilterUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Id", targetDepth)) - { - response.InventoryConfiguration.InventoryId = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("IncludedObjectVersions", targetDepth)) - { - response.InventoryConfiguration.IncludedObjectVersions = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Field", targetDepth + 1)) - { - if (response.InventoryConfiguration.InventoryOptionalFields == null) - { - response.InventoryConfiguration.InventoryOptionalFields = new List(); - } - response.InventoryConfiguration.InventoryOptionalFields.Add(StringUnmarshaller.Instance.Unmarshall(context)); - continue; - } - if (context.TestExpression("Schedule", targetDepth)) - { - response.InventoryConfiguration.Schedule = InventoryScheduleUnmarshaller.Instance.Unmarshall(context); - - continue; - } - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return; - } - } - - return; - } - - private static GetBucketInventoryConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static GetBucketInventoryConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketInventoryConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs deleted file mode 100644 index d1a00b1fb71a..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs +++ /dev/null @@ -1,120 +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.Collections.Generic; - -using Amazon.S3.Model; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// InventoryConfiguration Unmarshaller - /// - public class InventoryConfigurationUnmarshaller : IXmlUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public InventoryConfiguration Unmarshall(XmlUnmarshallerContext context) - { - InventoryConfiguration response = new InventoryConfiguration(); - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - if (context.TestExpression("Destination", targetDepth)) - { - response.Destination = InventoryDestinationUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("IsEnabled", targetDepth)) - { - response.IsEnabled = BoolUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Filter", targetDepth)) - { - response.InventoryFilter = InventoryFilterUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Id", targetDepth)) - { - response.InventoryId = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("IncludedObjectVersions", targetDepth)) - { - response.IncludedObjectVersions = InventoryIncludedObjectVersions.FindValue(StringUnmarshaller.Instance.Unmarshall(context)); - - continue; - } - if (context.TestExpression("Field", targetDepth + 1)) - { - if (response.InventoryOptionalFields == null) - { - response.InventoryOptionalFields = new List(); - } - response.InventoryOptionalFields.Add(InventoryOptionalField.FindValue(StringUnmarshaller.Instance.Unmarshall(context))); - continue; - } - if (context.TestExpression("Schedule", targetDepth)) - { - response.Schedule = InventoryScheduleUnmarshaller.Instance.Unmarshall(context); - - continue; - } - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return response; - } - } - - - - return response; - } - - - private static InventoryConfigurationUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static InventoryConfigurationUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new InventoryConfigurationUnmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs deleted file mode 100644 index e6fbff95a7c1..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs +++ /dev/null @@ -1,71 +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.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// SSES3 Unmarshaller - /// - public class SSES3Unmarshaller : IXmlUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public SSES3 Unmarshall(XmlUnmarshallerContext context) - { - SSES3 condition = new SSES3(); - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - // Currently SSES3 is an empty shape and does not have any members inside of it. - continue; - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return condition; - } - } - return condition; - } - - private static SSES3Unmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static SSES3Unmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new SSES3Unmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationRequest.cs similarity index 68% rename from sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationRequest.cs index 778e08b9d18b..cbde2bf3f52f 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationRequest.cs @@ -12,31 +12,37 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; +using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// /// Container for the parameters to the GetBucketInventoryConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// - /// Returns an inventory configuration (identified by the inventory configuration ID) + /// Returns an S3 Inventory configuration (identified by the inventory configuration ID) /// from the bucket. /// /// /// - /// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration + /// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration /// action. The bucket owner has this permission by default and can grant this permission /// to others. For more information about permissions, see Permissions /// Related to Bucket Subresource Operations and Managing @@ -49,7 +55,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following operations are related to GetBucketInventoryConfiguration: + /// The following operations are related to GetBucketInventoryConfiguration: /// /// + /// + /// + /// 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 GetBucketInventoryConfigurationRequest : AmazonWebServiceRequest { - private string bucketName; - private string inventoryId; - private string expectedBucketOwner; + private string _bucketName; + private string _expectedBucketOwner; + private string _inventoryId; /// + /// Gets and sets the property BucketName. + /// /// The name of the bucket containing the inventory configuration to 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; } /// - /// The ID used to identify the inventory configuration. + /// 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 InventoryId + public string ExpectedBucketOwner { - get { return this.inventoryId; } - set { this.inventoryId = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - // Check to see if InventoryId property is set - internal bool IsSetInventoryId() + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() { - return !(string.IsNullOrEmpty(this.inventoryId)); + return !String.IsNullOrEmpty(this._expectedBucketOwner); } /// - /// Gets and sets the property ExpectedBucketOwner. + /// Gets and sets the property InventoryId. /// - /// 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 ID used to identify the inventory configuration. /// /// - public string ExpectedBucketOwner + [AWSProperty(Required=true)] + public string InventoryId { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._inventoryId; } + set { this._inventoryId = value; } } - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() + // Check to see if InventoryId property is set + internal bool IsSetInventoryId() { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + return this._inventoryId != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationResponse.cs similarity index 64% rename from sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationResponse.cs index f7c51291dee0..8905ab0fe5cf 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationResponse.cs @@ -12,35 +12,47 @@ * 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 { /// - /// GetInventoryConfigurationResponse Response + /// This is the response object from the GetBucketInventoryConfiguration operation. /// public partial class GetBucketInventoryConfigurationResponse : AmazonWebServiceResponse { - InventoryConfiguration inventoryConfiguration; + private InventoryConfiguration _inventoryConfiguration; /// + /// Gets and sets the property InventoryConfiguration. + /// /// Specifies the inventory configuration. + /// /// public InventoryConfiguration InventoryConfiguration { - get { return this.inventoryConfiguration; } - set { this.inventoryConfiguration = value; } + get { return this._inventoryConfiguration; } + set { this._inventoryConfiguration = value; } } // Check to see if InventoryConfiguration property is set internal bool IsSetInventoryConfiguration() { - return this.inventoryConfiguration != null; + return this._inventoryConfiguration != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..ced479fd4f69 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.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 +{ + /// + /// GetBucketInventoryConfiguration Request Marshaller + /// + public partial class GetBucketInventoryConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((GetBucketInventoryConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(GetBucketInventoryConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "GET"; + request.AddSubResource("inventory"); + + 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.", "GetBucketInventoryConfigurationRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.InventoryId)) + throw new AmazonS3Exception("Request object does not have required field InventoryId set"); + + if (publicRequest.IsSetInventoryId()) + request.Parameters.Add("id", StringUtils.FromString(publicRequest.InventoryId)); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static GetBucketInventoryConfigurationRequestMarshaller _instance = new GetBucketInventoryConfigurationRequestMarshaller(); + + internal static GetBucketInventoryConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketInventoryConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetBucketInventoryConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketInventoryConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..9bad3d1e2399 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.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 GetBucketInventoryConfiguration operation + /// + public partial class GetBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + GetBucketInventoryConfigurationResponse response = new GetBucketInventoryConfigurationResponse(); + UnmarshallResult(context,response); + + PostUnmarshallCustomization(context, response); + return response; + } + + private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketInventoryConfigurationResponse response) + { + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + if (context.IsEmptyResponse) + { + return; + } + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + if (context.TestExpression("InventoryConfiguration", targetDepth)) + { + var unmarshaller = InventoryConfigurationUnmarshaller.Instance; + response.InventoryConfiguration = 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, GetBucketInventoryConfigurationResponse response); + + private static GetBucketInventoryConfigurationResponseUnmarshaller _instance = new GetBucketInventoryConfigurationResponseUnmarshaller(); + + internal static GetBucketInventoryConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketInventoryConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs new file mode 100644 index 000000000000..29030ab0a989 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs @@ -0,0 +1,131 @@ +/* + * 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 InventoryConfiguration Object + /// + public partial class InventoryConfigurationUnmarshaller : IXmlUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public InventoryConfiguration Unmarshall(XmlUnmarshallerContext context) + { + InventoryConfiguration unmarshalledObject = new InventoryConfiguration(); + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + + if (context.IsStartOfDocument) + targetDepth += 2; + + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + if (context.TestExpression("Destination", targetDepth)) + { + var unmarshaller = InventoryDestinationUnmarshaller.Instance; + unmarshalledObject.Destination = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("IncludedObjectVersions", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.IncludedObjectVersions = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("Filter", targetDepth)) + { + var unmarshaller = InventoryFilterUnmarshaller.Instance; + unmarshalledObject.InventoryFilter = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("Id", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.InventoryId = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("OptionalFields/Field", targetDepth)) + { + if (unmarshalledObject.InventoryOptionalFields == null) + { + unmarshalledObject.InventoryOptionalFields = new List(); + } + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.InventoryOptionalFields.Add(unmarshaller.Unmarshall(context)); + continue; + } + if (context.TestExpression("IsEnabled", targetDepth)) + { + var unmarshaller = NullableBoolUnmarshaller.Instance; + unmarshalledObject.IsEnabled = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("Schedule", targetDepth)) + { + var unmarshaller = InventoryScheduleUnmarshaller.Instance; + unmarshalledObject.Schedule = unmarshaller.Unmarshall(context); + continue; + } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); + } + else if (context.IsEndElement && context.CurrentDepth < originalDepth) + { + return unmarshalledObject; + } + } + return unmarshalledObject; + } + + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryConfiguration unmarshalledObject, int targetDepth); + + private static InventoryConfigurationUnmarshaller _instance = new InventoryConfigurationUnmarshaller(); + + /// + /// Gets the singleton. + /// + public static InventoryConfigurationUnmarshaller Instance + { + get + { + return _instance; + } + } + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs similarity index 56% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs index 93c782ac0451..c6efcb2accd7 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs @@ -12,69 +12,80 @@ * 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 { /// - /// InventoryDestination Unmarshaller - /// - public class InventoryDestinationUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for InventoryDestination Object + /// + public partial class InventoryDestinationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public InventoryDestination Unmarshall(XmlUnmarshallerContext context) { - InventoryDestination condition = new InventoryDestination(); + InventoryDestination unmarshalledObject = new InventoryDestination(); 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("S3BucketDestination", targetDepth)) { - condition.S3BucketDestination = InventoryS3BucketDestinationUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = InventoryS3BucketDestinationUnmarshaller.Instance; + unmarshalledObject.S3BucketDestination = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - - - return condition; + } + return unmarshalledObject; } - private static InventoryDestinationUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryDestination unmarshalledObject, int targetDepth); + + private static InventoryDestinationUnmarshaller _instance = new InventoryDestinationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static InventoryDestinationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new InventoryDestinationUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs similarity index 55% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs index bc5616bf6843..903856c6b99c 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.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,75 +12,86 @@ * 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 { /// - /// InventoryEncryption Unmarshaller - /// - public class InventoryEncryptionUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for InventoryEncryption Object + /// + public partial class InventoryEncryptionUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public InventoryEncryption Unmarshall(XmlUnmarshallerContext context) { - InventoryEncryption condition = new InventoryEncryption(); + InventoryEncryption unmarshalledObject = new InventoryEncryption(); 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("SSE-KMS", targetDepth)) { - condition.SSEKMS = SSEKMSUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = SSEKMSUnmarshaller.Instance; + unmarshalledObject.SSEKMS = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SSE-S3", targetDepth)) { - condition.SSES3 = SSES3Unmarshaller.Instance.Unmarshall(context); - + var unmarshaller = SSES3Unmarshaller.Instance; + unmarshalledObject.SSES3 = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - - - return condition; + } + return unmarshalledObject; } - private static InventoryEncryptionUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryEncryption unmarshalledObject, int targetDepth); + + private static InventoryEncryptionUnmarshaller _instance = new InventoryEncryptionUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static InventoryEncryptionUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new InventoryEncryptionUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs similarity index 52% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs index 3491947ef7ac..3df91d426220 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs @@ -12,91 +12,104 @@ * 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 { /// - /// InventoryS3BucketDestination Unmarshaller - /// - public class InventoryS3BucketDestinationUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for InventoryS3BucketDestination Object + /// + public partial class InventoryS3BucketDestinationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public InventoryS3BucketDestination Unmarshall(XmlUnmarshallerContext context) { - InventoryS3BucketDestination condition = new InventoryS3BucketDestination(); + InventoryS3BucketDestination unmarshalledObject = new InventoryS3BucketDestination(); 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("AccountId", targetDepth)) { - condition.AccountId = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.AccountId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Bucket", targetDepth)) { - condition.BucketName = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.BucketName = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("Format", targetDepth)) + if (context.TestExpression("Encryption", targetDepth)) { - condition.InventoryFormat = InventoryFormat.FindValue(StringUnmarshaller.GetInstance().Unmarshall(context)); - + var unmarshaller = InventoryEncryptionUnmarshaller.Instance; + unmarshalledObject.InventoryEncryption = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("Prefix", targetDepth)) + if (context.TestExpression("Format", targetDepth)) { - condition.Prefix = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.InventoryFormat = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("Encryption", targetDepth)) + if (context.TestExpression("Prefix", targetDepth)) { - condition.InventoryEncryption = InventoryEncryptionUnmarshaller.Instance.Unmarshall(context); + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.Prefix = unmarshaller.Unmarshall(context); + continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - - - return condition; + } + return unmarshalledObject; } - private static InventoryS3BucketDestinationUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryS3BucketDestination unmarshalledObject, int targetDepth); + + private static InventoryS3BucketDestinationUnmarshaller _instance = new InventoryS3BucketDestinationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static InventoryS3BucketDestinationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new InventoryS3BucketDestinationUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs similarity index 54% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs index 24600dffeba6..f0165c7dbd26 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs @@ -12,68 +12,80 @@ * 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 { /// - /// InventorySchedule Unmarshaller - /// - public class InventoryScheduleUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for InventorySchedule Object + /// + public partial class InventoryScheduleUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public InventorySchedule Unmarshall(XmlUnmarshallerContext context) { - InventorySchedule condition = new InventorySchedule(); + InventorySchedule unmarshalledObject = new InventorySchedule(); 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("Frequency", targetDepth)) { - - condition.Frequency = InventoryFrequency.FindValue(StringUnmarshaller.GetInstance().Unmarshall(context)); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.Frequency = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - return condition; + } + return unmarshalledObject; } - private static InventoryScheduleUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventorySchedule unmarshalledObject, int targetDepth); + + private static InventoryScheduleUnmarshaller _instance = new InventoryScheduleUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static InventoryScheduleUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new InventoryScheduleUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs similarity index 55% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs index 730e45196c88..d4fb53e9dc77 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.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,69 +12,80 @@ * 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 { /// - /// SSEKMS Unmarshaller - /// - public class SSEKMSUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for SSEKMS Object + /// + public partial class SSEKMSUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public SSEKMS Unmarshall(XmlUnmarshallerContext context) { - SSEKMS condition = new SSEKMS(); + SSEKMS unmarshalledObject = new SSEKMS(); 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("KeyId", targetDepth)) { - condition.KeyId = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.KeyId = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - - - return condition; + } + return unmarshalledObject; } - private static SSEKMSUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, SSEKMS unmarshalledObject, int targetDepth); + + private static SSEKMSUnmarshaller _instance = new SSEKMSUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static SSEKMSUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new SSEKMSUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs new file mode 100644 index 000000000000..470b40e506b3 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs @@ -0,0 +1,85 @@ +/* + * 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 SSES3 Object + /// + public partial class SSES3Unmarshaller : IXmlUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public SSES3 Unmarshall(XmlUnmarshallerContext context) + { + SSES3 unmarshalledObject = new SSES3(); + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + + if (context.IsStartOfDocument) + targetDepth += 2; + + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); + } + else if (context.IsEndElement && context.CurrentDepth < originalDepth) + { + return unmarshalledObject; + } + } + return unmarshalledObject; + } + + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, SSES3 unmarshalledObject, int targetDepth); + + private static SSES3Unmarshaller _instance = new SSES3Unmarshaller(); + + /// + /// Gets the singleton. + /// + public static SSES3Unmarshaller Instance + { + get + { + return _instance; + } + } + } +} \ No newline at end of file From f004cd0ea75aca7f0539286bfe1e870de5d6bef4 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Fri, 21 Nov 2025 14:38:07 -0800 Subject: [PATCH 03/11] Generate ListBucketInventoryConfigurations stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4156, branch: peterrsongg/petesong/phase-3-pr4-3/3 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 26 ++++ ...nventoryConfigurationsRequestMarshaller.cs | 75 ----------- ...stBucketInventoryConfigurationsResponse.cs | 99 -------------- ...nventoryConfigurationsRequestMarshaller.cs | 99 ++++++++++++++ ...ntoryConfigurationsResponseUnmarshaller.cs | 116 +++++++++------- ...istBucketInventoryConfigurationsRequest.cs | 88 +++++++----- ...stBucketInventoryConfigurationsResponse.cs | 125 ++++++++++++++++++ 8 files changed, 375 insertions(+), 255 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/ListBucketInventoryConfigurationsResponse.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsRequestMarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsResponseUnmarshaller.cs (53%) rename sdk/src/Services/S3/{Custom => Generated}/Model/ListBucketInventoryConfigurationsRequest.cs (58%) create mode 100644 sdk/src/Services/S3/Generated/Model/ListBucketInventoryConfigurationsResponse.cs diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 43c1252c8c9a..74c33ab8291f 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -559,7 +559,7 @@ public List S3AllowListOperations //new Operation(this, "GetBucketWebsite", DocumentRoot[OperationsKey]["GetBucketWebsite"]), new Operation(this, "ListBucketAnalyticsConfigurations", DocumentRoot[OperationsKey]["ListBucketAnalyticsConfigurations"]), new Operation(this, "ListBucketIntelligentTieringConfigurations", DocumentRoot[OperationsKey]["ListBucketIntelligentTieringConfigurations"]), - //new Operation(this, "ListBucketInventoryConfigurations", DocumentRoot[OperationsKey]["ListBucketInventoryConfigurations"]), + new Operation(this, "ListBucketInventoryConfigurations", DocumentRoot[OperationsKey]["ListBucketInventoryConfigurations"]), new Operation(this, "ListBucketMetricsConfigurations", DocumentRoot[OperationsKey]["ListBucketMetricsConfigurations"]), //new Operation(this, "PutBucketAccelerateConfiguration", DocumentRoot[OperationsKey]["PutBucketAccelerateConfiguration"]), //new Operation(this, "RestoreObject", DocumentRoot[OperationsKey]["RestoreObject"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 4a8240b78b4f..b90364ffa234 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1137,6 +1137,32 @@ "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} } ] + }, + "ListBucketInventoryConfigurationsRequest":{ + "modify":[ + { + "ContinuationToken":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._continuationToken);"]} + }, + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] + }, + "ListBucketInventoryConfigurationsOutput":{ + "modify":[ + { + "ContinuationToken":{"emitPropertyName":"Token"} + }, + { + "NextContinuationToken":{"emitPropertyName":"NextToken"} + }, + { + "Token":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._token);"]} + }, + { + "NextToken":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._nextToken);"]} + } + ] } }, "operationModifiers": { diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsRequestMarshaller.cs deleted file mode 100644 index 5b542e380901..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsRequestMarshaller.cs +++ /dev/null @@ -1,75 +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; -using Amazon.Runtime.Internal.Transform; -using Amazon.S3.Util; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// List InventoryConfiguration Request Marshaller - /// - public class ListBucketInventoryConfigurationsRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((ListBucketInventoryConfigurationsRequest)input); - } - - public IRequest Marshall(ListBucketInventoryConfigurationsRequest listBucketInventoryConfigurationsRequest) - { - IRequest request = new DefaultRequest(listBucketInventoryConfigurationsRequest, "Amazon.S3"); - - request.HttpMethod = "GET"; - - if (listBucketInventoryConfigurationsRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(listBucketInventoryConfigurationsRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(listBucketInventoryConfigurationsRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "ListBucketInventoryConfigurationsRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("inventory"); - if (listBucketInventoryConfigurationsRequest.IsSetContinuationToken()) - { - request.AddSubResource("continuation-token", listBucketInventoryConfigurationsRequest.ContinuationToken.ToString()); - } - request.UseQueryString = true; - - return request; - } - - private static ListBucketInventoryConfigurationsRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static ListBucketInventoryConfigurationsRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new ListBucketInventoryConfigurationsRequestMarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/ListBucketInventoryConfigurationsResponse.cs b/sdk/src/Services/S3/Custom/Model/ListBucketInventoryConfigurationsResponse.cs deleted file mode 100644 index 1a3db2d8877f..000000000000 --- a/sdk/src/Services/S3/Custom/Model/ListBucketInventoryConfigurationsResponse.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 System; -using System.Collections.Generic; -using System.Xml.Serialization; -using System.Text; - -using Amazon.Runtime; - -namespace Amazon.S3.Model -{ - /// - /// Returns information about the ListInventoryConfigurationsResponse response and response metadata. - /// - public partial class ListBucketInventoryConfigurationsResponse : AmazonWebServiceResponse - { - private string token; - private List inventoryConfigurationList = AWSConfigs.InitializeCollections ? new List() : null; - private bool? isTruncated; - private string nextToken; - - /// - /// If sent in the request, the marker that is used as a starting point for this inventory configuration list response. - /// - public string Token - { - get { return this.token; } - set { this.token = value; } - } - - // Check to see if Token property is set - internal bool IsSetToken() - { - return !(string.IsNullOrEmpty(this.token)); - } - - /// - /// The list of inventory configurations for a bucket. - /// - public List InventoryConfigurationList - { - get { return this.inventoryConfigurationList; } - set { this.inventoryConfigurationList = value; } - } - - /// - /// Check to see if InventoryConfigurationList property is set - /// - /// - public bool IsSetInventoryConfigurationList() - { - return this.inventoryConfigurationList != null && (this.inventoryConfigurationList.Count > 0 || !AWSConfigs.InitializeCollections); - } - - /// - /// Indicates whether the returned list of inventory configurations is truncated in this response. A value of true indicates that the list is truncated. - /// - 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 NextToken - { - get { return this.nextToken; } - set { this.nextToken = value; } - } - - // Check to see if NextToken property is set - internal bool IsSetNextToken() - { - return !(string.IsNullOrEmpty(this.nextToken)); - } - - } -} diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsRequestMarshaller.cs new file mode 100644 index 000000000000..0dff27b3c3f4 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsRequestMarshaller.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 +{ + /// + /// ListBucketInventoryConfigurations Request Marshaller + /// + public partial class ListBucketInventoryConfigurationsRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((ListBucketInventoryConfigurationsRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(ListBucketInventoryConfigurationsRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "GET"; + request.AddSubResource("inventory"); + + 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.", "ListBucketInventoryConfigurationsRequest.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 ListBucketInventoryConfigurationsRequestMarshaller _instance = new ListBucketInventoryConfigurationsRequestMarshaller(); + + internal static ListBucketInventoryConfigurationsRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static ListBucketInventoryConfigurationsRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, ListBucketInventoryConfigurationsRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, ListBucketInventoryConfigurationsRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsResponseUnmarshaller.cs similarity index 53% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsResponseUnmarshaller.cs index 5ba5c0862043..39bb419817b8 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketInventoryConfigurationsResponseUnmarshaller.cs @@ -12,84 +12,86 @@ * 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.Net; 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 1591 - +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// - /// Response Unmarshaller for ListInventoryConfiguration operation - /// - public class ListBucketInventoryConfigurationsResponseUnmarshaller : S3ReponseUnmarshaller + /// Response Unmarshaller for ListBucketInventoryConfigurations operation + /// + public partial class ListBucketInventoryConfigurationsResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListBucketInventoryConfigurationsResponse response = new ListBucketInventoryConfigurationsResponse(); - - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context, response); - continue; - } - } - - + UnmarshallResult(context,response); + + PostUnmarshallCustomization(context, response); return response; - } + } private static void UnmarshallResult(XmlUnmarshallerContext context, ListBucketInventoryConfigurationsResponse 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.Token = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("InventoryConfiguration", targetDepth)) { if (response.InventoryConfigurationList == null) { response.InventoryConfigurationList = new List(); } - response.InventoryConfigurationList.Add(InventoryConfigurationUnmarshaller.Instance.Unmarshall(context)); + var unmarshaller = InventoryConfigurationUnmarshaller.Instance; + response.InventoryConfigurationList.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.NextToken = StringUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + response.NextToken = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("ContinuationToken", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + response.Token = unmarshaller.Unmarshall(context); continue; } } @@ -98,27 +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(); - return; + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); } - private static ListBucketInventoryConfigurationsResponseUnmarshaller _instance = new ListBucketInventoryConfigurationsResponseUnmarshaller(); + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, ListBucketInventoryConfigurationsResponse response); + + private static ListBucketInventoryConfigurationsResponseUnmarshaller _instance = new ListBucketInventoryConfigurationsResponseUnmarshaller(); + + internal static ListBucketInventoryConfigurationsResponseUnmarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static ListBucketInventoryConfigurationsResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new ListBucketInventoryConfigurationsResponseUnmarshaller(); - } return _instance; } } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/ListBucketInventoryConfigurationsRequest.cs b/sdk/src/Services/S3/Generated/Model/ListBucketInventoryConfigurationsRequest.cs similarity index 58% rename from sdk/src/Services/S3/Custom/Model/ListBucketInventoryConfigurationsRequest.cs rename to sdk/src/Services/S3/Generated/Model/ListBucketInventoryConfigurationsRequest.cs index 1e4dd62358bf..cbd85113a052 100644 --- a/sdk/src/Services/S3/Custom/Model/ListBucketInventoryConfigurationsRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/ListBucketInventoryConfigurationsRequest.cs @@ -12,39 +12,47 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// /// Container for the parameters to the ListBucketInventoryConfigurations operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// - /// Returns a list of inventory configurations for the bucket. You can have up to 1,000 - /// analytics configurations per bucket. + /// Returns a list of S3 Inventory configurations for the bucket. You can have up to 1,000 + /// inventory configurations per bucket. /// /// /// /// This action supports list pagination and does not return more than 100 configurations - /// at a time. Always check the IsTruncated element in the response. If there - /// are no more configurations to list, IsTruncated is set to false. If there - /// are more configurations to list, IsTruncated is set to true, and there - /// is a value in NextContinuationToken. You use the NextContinuationToken - /// value to continue the pagination of the list by passing the value in continuation-token - /// in the request to GET the next page. + /// at a time. Always check the IsTruncated element in the response. If there are + /// no more configurations to list, IsTruncated is set to false. If there are more + /// configurations to list, IsTruncated is set to true, and there is a value in + /// NextContinuationToken. You use the NextContinuationToken value to continue + /// the pagination of the list by passing the value in continuation-token in the request + /// to GET the next page. /// /// /// - /// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration + /// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration /// action. The bucket owner has this permission by default. The bucket owner can grant /// this permission to others. For more information about permissions, see Permissions /// Related to Bucket Subresource Operations and Managing @@ -57,7 +65,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following operations are related to ListBucketInventoryConfigurations: + /// The following operations are related to ListBucketInventoryConfigurations: /// /// + /// + /// + /// 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 ListBucketInventoryConfigurationsRequest : AmazonWebServiceRequest { - private string bucketName; - private string token; - private string expectedBucketOwner; + private string _bucketName; + private string _continuationToken; + private string _expectedBucketOwner; /// + /// Gets and sets the property BucketName. + /// /// The name of the bucket containing the inventory configurations to 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; } /// - /// The marker used to continue an inventory configuration listing that has been truncated. - /// Use the NextContinuationToken from a previously truncated list response - /// to continue the listing. The continuation token is an opaque value that Amazon S3 - /// understands. + /// Gets and sets the property ContinuationToken. + /// + /// The marker used to continue an inventory configuration listing that has been truncated. + /// Use the NextContinuationToken from a previously truncated list response to + /// continue the listing. The continuation token is an opaque value that Amazon S3 understands. + /// /// public string ContinuationToken { - get { return this.token; } - set { this.token = value; } + get { return this._continuationToken; } + set { this._continuationToken = value; } } - // Check to see if Token property is set + // Check to see if ContinuationToken property is set internal bool IsSetContinuationToken() { - return !(string.IsNullOrEmpty(this.token)); + return !String.IsNullOrEmpty(this._continuationToken); } /// @@ -120,22 +140,20 @@ internal bool IsSetContinuationToken() /// /// 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). + /// 403 Forbidden (access denied). /// /// public string ExpectedBucketOwner { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. + // Check to see if ExpectedBucketOwner property is set internal bool IsSetExpectedBucketOwner() { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + return !String.IsNullOrEmpty(this._expectedBucketOwner); } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/ListBucketInventoryConfigurationsResponse.cs b/sdk/src/Services/S3/Generated/Model/ListBucketInventoryConfigurationsResponse.cs new file mode 100644 index 000000000000..b08be7fedc14 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/ListBucketInventoryConfigurationsResponse.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 ListBucketInventoryConfigurations operation. + /// + public partial class ListBucketInventoryConfigurationsResponse : AmazonWebServiceResponse + { + private List _inventoryConfigurationList = AWSConfigs.InitializeCollections ? new List() : null; + private bool? _isTruncated; + private string _nextToken; + private string _token; + + /// + /// Gets and sets the property InventoryConfigurationList. + /// + /// The list of inventory 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 InventoryConfigurationList + { + get { return this._inventoryConfigurationList; } + set { this._inventoryConfigurationList = value; } + } + + // Check to see if InventoryConfigurationList property is set + internal bool IsSetInventoryConfigurationList() + { + return this._inventoryConfigurationList != null && (this._inventoryConfigurationList.Count > 0 || !AWSConfigs.InitializeCollections); + } + + /// + /// Gets and sets the property IsTruncated. + /// + /// Tells whether the returned list of inventory configurations is complete. A value of + /// true indicates that the list is not complete and the NextContinuationToken is 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 NextToken. + /// + /// 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 NextToken + { + get { return this._nextToken; } + set { this._nextToken = value; } + } + + // Check to see if NextToken property is set + internal bool IsSetNextToken() + { + return !String.IsNullOrEmpty(this._nextToken); + } + + /// + /// Gets and sets the property Token. + /// + /// If sent in the request, the marker that is used as a starting point for this inventory + /// configuration list response. + /// + /// + public string Token + { + get { return this._token; } + set { this._token = value; } + } + + // Check to see if Token property is set + internal bool IsSetToken() + { + return !String.IsNullOrEmpty(this._token); + } + + } +} \ No newline at end of file From 01d399b3b2104f998c617ec53efa49b4b5fcc4f6 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 26 Nov 2025 12:21:10 -0800 Subject: [PATCH 04/11] Generate PutBucketInventoryConfiguration (#4154) * Generate PutBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4154, branch: peterrsongg/petesong/phase-3-pr4-3/1 * switch to CustomIsEnabledMarshall --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 58 +++++- ...InventoryConfigurationRequestMarshaller.cs | 166 ++------------- ...entoryConfigurationResponseUnmarshaller.cs | 63 ------ .../S3/Custom/Model/InventoryConfiguration.cs | 155 -------------- .../Model/InventoryS3BucketDestination.cs | 113 ----------- ...InventoryConfigurationRequestMarshaller.cs | 183 +++++++++++++++++ ...entoryConfigurationResponseUnmarshaller.cs | 98 +++++++++ .../Generated/Model/InventoryConfiguration.cs | 189 ++++++++++++++++++ .../Model/InventoryDestination.cs | 37 ++-- .../Model/InventoryEncryption.cs | 53 +++-- .../Model/InventoryS3BucketDestination.cs | 144 +++++++++++++ .../Model/InventorySchedule.cs | 28 ++- .../PutBucketInventoryConfigurationRequest.cs | 110 ++++++---- ...PutBucketInventoryConfigurationResponse.cs | 14 +- .../S3/{Custom => Generated}/Model/SSEKMS.cs | 29 ++- .../S3/{Custom => Generated}/Model/SSES3.cs | 17 +- 17 files changed, 870 insertions(+), 589 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/InventoryConfiguration.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/InventoryS3BucketDestination.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/InventoryConfiguration.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/InventoryDestination.cs (52%) rename sdk/src/Services/S3/{Custom => Generated}/Model/InventoryEncryption.cs (54%) create mode 100644 sdk/src/Services/S3/Generated/Model/InventoryS3BucketDestination.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/InventorySchedule.cs (60%) rename sdk/src/Services/S3/{Custom => Generated}/Model/PutBucketInventoryConfigurationRequest.cs (71%) rename sdk/src/Services/S3/{Custom => Generated}/Model/PutBucketInventoryConfigurationResponse.cs (73%) rename sdk/src/Services/S3/{Custom => Generated}/Model/SSEKMS.cs (60%) rename sdk/src/Services/S3/{Custom => Generated}/Model/SSES3.cs (69%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 2cfa398745f6..06674aeb4b86 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -566,7 +566,7 @@ public List S3AllowListOperations //new Operation(this, "SelectObjectContent", DocumentRoot[OperationsKey]["SelectObjectContent"]), new Operation(this, "PutBucketAnalyticsConfiguration" , DocumentRoot[OperationsKey]["PutBucketAnalyticsConfiguration"]), new Operation(this, "PutBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["PutBucketIntelligentTieringConfiguration"]), - //new Operation(this, "PutBucketInventoryConfiguration", DocumentRoot[OperationsKey]["PutBucketInventoryConfiguration"]), + new Operation(this, "PutBucketInventoryConfiguration", DocumentRoot[OperationsKey]["PutBucketInventoryConfiguration"]), new Operation(this, "PutBucketMetricsConfiguration", DocumentRoot[OperationsKey]["PutBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketMetricsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketAnalyticsConfiguration"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 6dc8337d042c..65e2199bf87c 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1076,7 +1076,59 @@ "Id":{"emitPropertyName": "IntelligentTieringId"} } ] + }, + "PutBucketInventoryConfigurationRequest":{ + "modify":[ + { + "Id" :{"emitPropertyName":"InventoryId"} + }, + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] + }, + "InventoryConfiguration":{ + "modify":[ + { + "Filter":{"emitPropertyName":"InventoryFilter"} + }, + { + "Id":{"emitPropertyName":"InventoryId"} + }, + { + "InventoryId":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._inventoryId);"]} + }, + { + "OptionalFields":{"emitPropertyName": "InventoryOptionalFields"} + }, + { + "InventoryFilter":{"injectXmlMarshallCode":["InventoryFilterCustomMarshall(publicRequest, xmlWriter);"]} + }, + { + "IsEnabled":{"injectXmlMarshallCode":["CustomIsEnabledMarshall(publicRequest, xmlWriter);"]} + } + ] + }, + "InventoryS3BucketDestination":{ + "modify":[ + { + "AccountId":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._accountId);"]} + }, + { + "BucketName":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._bucketName);"]} + }, + { + "Encryption":{"emitPropertyName": "InventoryEncryption"} + }, + { + "Prefix":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._prefix);"]} + }, + { + "Format":{"emitPropertyName":"InventoryFormat"} + } + ] } + }, "operationModifiers": { "CreateBucket": { @@ -1221,7 +1273,8 @@ } }, "overrideTreatEnumsAsString":{ - "ObjectAttributesList": false + "ObjectAttributesList": false, + "InventoryOptionalFields": false }, "dataTypeSwap":{ "ListPartsRequest":{ @@ -1452,6 +1505,7 @@ "AnalyticsFilter", "AnalyticsAndOperator", "IntelligentTieringFilter", - "IntelligentTieringAndOperator" + "IntelligentTieringAndOperator", + "InventoryFilter" ] } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs index e4810ed3fee5..77658f78e247 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs @@ -32,167 +32,27 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Request Marshaller for PutInventoryConfiguration operation /// - public class PutBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller + public partial class PutBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketInventoryConfigurationRequest publicRequest) { - return this.Marshall((PutBucketInventoryConfigurationRequest)input); + ChecksumUtils.SetChecksumData(defaultRequest); } - public IRequest Marshall(PutBucketInventoryConfigurationRequest putBucketInventoryConfigurationRequest) - { - IRequest request = new DefaultRequest(putBucketInventoryConfigurationRequest, "Amazon.S3"); - - request.HttpMethod = "PUT"; - - if (putBucketInventoryConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(putBucketInventoryConfigurationRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(putBucketInventoryConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "PutBucketInventoryConfigurationRequest.BucketName"); - - request.ResourcePath = "/"; - - request.AddSubResource("inventory"); - - if (putBucketInventoryConfigurationRequest.IsSetInventoryId()) - { - request.AddSubResource("id", S3Transforms.ToStringValue(putBucketInventoryConfigurationRequest.InventoryId)); - } - - 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 (putBucketInventoryConfigurationRequest.IsSetInventoryConfiguration()) - { - var inventoryConfiguration = putBucketInventoryConfigurationRequest.InventoryConfiguration; - xmlWriter.WriteStartElement("InventoryConfiguration", S3Constants.S3RequestXmlNamespace); - if (inventoryConfiguration != null) - { - if (inventoryConfiguration.IsSetDestination()) - { - InventoryDestination inventoryDestination = inventoryConfiguration.Destination; - xmlWriter.WriteStartElement("Destination"); - if (inventoryDestination.isSetS3BucketDestination()) - { - InventoryS3BucketDestination inventoryS3BucketDestination = inventoryDestination.S3BucketDestination; - xmlWriter.WriteStartElement("S3BucketDestination"); - if (inventoryS3BucketDestination.IsSetAccountId()) - { - xmlWriter.WriteElementString("AccountId", S3Transforms.ToXmlStringValue(inventoryS3BucketDestination.AccountId)); - } - if (inventoryS3BucketDestination.IsSetBucketName()) - { - xmlWriter.WriteElementString("Bucket", S3Transforms.ToXmlStringValue(inventoryS3BucketDestination.BucketName)); - } - if (inventoryS3BucketDestination.IsSetInventoryFormat()) - { - xmlWriter.WriteElementString("Format", S3Transforms.ToXmlStringValue(inventoryS3BucketDestination.InventoryFormat)); - } - if (inventoryS3BucketDestination.IsSetPrefix()) - { - xmlWriter.WriteElementString("Prefix", S3Transforms.ToXmlStringValue(inventoryS3BucketDestination.Prefix)); - } - if (inventoryS3BucketDestination.IsSetInventoryEncryption()) - { - xmlWriter.WriteStartElement("Encryption"); - var inventoryEncryption = inventoryS3BucketDestination.InventoryEncryption; - if (inventoryEncryption.IsSetSSEKMS()) - { - xmlWriter.WriteStartElement("SSE-KMS"); - if (inventoryEncryption.SSEKMS.IsSetKeyId()) - { - xmlWriter.WriteElementString("KeyId", S3Transforms.ToXmlStringValue(inventoryEncryption.SSEKMS.KeyId)); - } - xmlWriter.WriteEndElement(); - } - if (inventoryEncryption.IsSetSSES3()) - { - xmlWriter.WriteStartElement("SSE-S3"); - xmlWriter.WriteEndElement(); - } - xmlWriter.WriteEndElement(); - } - xmlWriter.WriteEndElement(); - } - xmlWriter.WriteEndElement(); - } - - xmlWriter.WriteElementString("IsEnabled", S3Transforms.ToXmlStringValue(inventoryConfiguration.IsEnabled.GetValueOrDefault())); - - if (inventoryConfiguration.IsSetInventoryFilter()) - { - xmlWriter.WriteStartElement("Filter"); - var predicate = inventoryConfiguration.InventoryFilter.InventoryFilterPredicate; - predicate.Accept(new InventoryPredicateVisitor(xmlWriter)); - xmlWriter.WriteEndElement(); - } - if(inventoryConfiguration.IsSetInventoryId()) - { - xmlWriter.WriteElementString("Id", S3Transforms.ToXmlStringValue(inventoryConfiguration.InventoryId)); - } - - if(inventoryConfiguration.IsSetIncludedObjectVersions()) - { - xmlWriter.WriteElementString("IncludedObjectVersions", S3Transforms.ToXmlStringValue(inventoryConfiguration.IncludedObjectVersions)); - } - - if (inventoryConfiguration.IsSetInventoryOptionalFields()) - { - xmlWriter.WriteStartElement("OptionalFields"); - foreach (var inventoryOptionalField in inventoryConfiguration.InventoryOptionalFields) - { - xmlWriter.WriteElementString("Field", S3Transforms.ToXmlStringValue(inventoryOptionalField)); - } - xmlWriter.WriteEndElement(); - } - - if(inventoryConfiguration.IsSetSchedule()) - { - xmlWriter.WriteStartElement("Schedule"); - var inventorySchedule = inventoryConfiguration.Schedule; - if (inventorySchedule.IsFrequency()) - { - xmlWriter.WriteElementString("Frequency", S3Transforms.ToXmlStringValue(inventorySchedule.Frequency)); - } - xmlWriter.WriteEndElement(); - } - } - xmlWriter.WriteEndElement(); - } - } - - try - { - var content = stringWriter.ToString(); - request.Content = Encoding.UTF8.GetBytes(content); - request.Headers[HeaderKeys.ContentTypeHeader] = "application/xml"; - - ChecksumUtils.SetChecksumData(request); - } - catch (EncoderFallbackException e) + void InventoryFilterCustomMarshall(PutBucketInventoryConfigurationRequest publicRequest, XmlWriter xmlWriter) + { + var inventoryConfiguration = publicRequest.InventoryConfiguration; + if (inventoryConfiguration.IsSetInventoryFilter()) { - throw new AmazonServiceException("Unable to marshall request to XML", e); + xmlWriter.WriteStartElement("Filter"); + var predicate = inventoryConfiguration.InventoryFilter.InventoryFilterPredicate; + predicate.Accept(new InventoryPredicateVisitor(xmlWriter)); + xmlWriter.WriteEndElement(); } - - return request; } - - private static PutBucketInventoryConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static PutBucketInventoryConfigurationRequestMarshaller Instance + void CustomIsEnabledMarshall(PutBucketInventoryConfigurationRequest publicRequest, XmlWriter xmlWriter) { - get - { - if (_instance == null) - { - _instance = new PutBucketInventoryConfigurationRequestMarshaller(); - } - return _instance; - } + xmlWriter.WriteElementString("IsEnabled", StringUtils.FromBool(publicRequest.InventoryConfiguration.IsEnabled.GetValueOrDefault())); } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs deleted file mode 100644 index 90a8b29c087d..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,63 +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.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for PutBucketWebsite operation - /// - public class PutBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - PutBucketInventoryConfigurationResponse response = new PutBucketInventoryConfigurationResponse(); - - - return response; - } - - private static PutBucketInventoryConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static PutBucketInventoryConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketInventoryConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - - } -} - - diff --git a/sdk/src/Services/S3/Custom/Model/InventoryConfiguration.cs b/sdk/src/Services/S3/Custom/Model/InventoryConfiguration.cs deleted file mode 100644 index 7ed4cbd64964..000000000000 --- a/sdk/src/Services/S3/Custom/Model/InventoryConfiguration.cs +++ /dev/null @@ -1,155 +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.Xml.Serialization; -using System.Text; -using System.IO; - - -namespace Amazon.S3.Model -{ - /// - /// Specifies the inventory configuration for an Amazon S3 bucket. For more information, - /// see GET - /// Bucket inventory in the Amazon S3 API Reference. - /// - public class InventoryConfiguration - { - private InventoryDestination inventoryDestination; - private InventoryFilter inventoryFilter; - private string inventoryId; - private bool? isEnabled; - private InventoryIncludedObjectVersions inventoryIncludedObjectVersions; - private List inventoryOptionalFields = AWSConfigs.InitializeCollections ? new List() : null; - private InventorySchedule inventorySchedule; - - /// - /// Gets and sets the property Destination. - /// - /// Contains information about where to publish the inventory results. - /// - /// - public InventoryDestination Destination - { - get { return this.inventoryDestination; } - set { this.inventoryDestination = value; } - } - - // Check to see if Destination property is set - internal bool IsSetDestination() - { - return this.inventoryDestination != null; - } - - /// - /// Specifies an inventory filter. The inventory only includes objects that meet the filter's criteria. - /// - public InventoryFilter InventoryFilter - { - get { return this.inventoryFilter; } - set { this.inventoryFilter = value; } - } - - // Check to see if InventoryFilter property is set - internal bool IsSetInventoryFilter() - { - return this.inventoryFilter != null; - } - - /// - /// The ID used to identify the inventory configuration. - /// - public string InventoryId - { - get { return this.inventoryId; } - set { this.inventoryId = value; } - } - - // Check to see if InventoryId property is set - internal bool IsSetInventoryId() - { - return !(string.IsNullOrEmpty(this.inventoryId)); - } - - /// - /// Gets and sets the property IncludedObjectVersions. - /// - /// Object versions to include in the inventory list. If set to All, the - /// list includes all the object versions, which adds the version-related fields VersionId, - /// IsLatest, and DeleteMarker to the list. If set to Current, - /// the list does not contain these version-related fields. - /// - /// - public InventoryIncludedObjectVersions IncludedObjectVersions - { - get { return this.inventoryIncludedObjectVersions; } - set { this.inventoryIncludedObjectVersions = value; } - } - - // Check to see if IncludedObjectVersions property is set - internal bool IsSetIncludedObjectVersions() - { - return this.inventoryIncludedObjectVersions != null; - } - - /// - /// Gets and sets the property IsEnabled. - /// - /// Specifies whether the inventory is enabled or disabled. If set to True, - /// an inventory list is generated. If set to False, no inventory list is - /// generated. - /// - /// - public bool? IsEnabled - { - get { return this.isEnabled; } - set { this.isEnabled = value; } - } - - /// - /// Contains the optional fields that are included in the inventory results. - /// - public List InventoryOptionalFields - { - get { return this.inventoryOptionalFields; } - set { this.inventoryOptionalFields = value; } - } - - // Check to see if InventoryOptionalFields property is set - internal bool IsSetInventoryOptionalFields() - { - return this.inventoryOptionalFields != null && (this.inventoryOptionalFields.Count > 0 || !AWSConfigs.InitializeCollections); - } - - /// - /// Gets and sets the property Schedule. - /// - /// Specifies the schedule for generating inventory results. - /// - /// - public InventorySchedule Schedule - { - get { return this.inventorySchedule; } - set { this.inventorySchedule = value; } - } - - // Check to see if Schedule property is set - internal bool IsSetSchedule() - { - return this.inventorySchedule != null; - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/InventoryS3BucketDestination.cs b/sdk/src/Services/S3/Custom/Model/InventoryS3BucketDestination.cs deleted file mode 100644 index 1f13f571d80b..000000000000 --- a/sdk/src/Services/S3/Custom/Model/InventoryS3BucketDestination.cs +++ /dev/null @@ -1,113 +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.Xml.Serialization; -using System.Text; -using System.IO; - - -namespace Amazon.S3.Model -{ - /// - /// The InventoryS3BucketDestination contains information where the inventory results will be saved in S3. - /// - public class InventoryS3BucketDestination - { - private string accountId; - private string bucketName; - private string prefix; - private InventoryFormat inventoryFormat; - private InventoryEncryption inventoryEncryption; - /// - /// The ID of the account that owns the destination bucket. - /// - public string AccountId - { - get { return this.accountId; } - set { this.accountId = value; } - } - - /// - /// Check to see if AccountId property is set - /// - /// - public bool IsSetAccountId() - { - return !(string.IsNullOrEmpty(this.accountId)); - } - - /// - /// The Amazon resource name (ARN) of the bucket where inventory results will be published. - /// - public string BucketName - { - get { return this.bucketName; } - set { this.bucketName = value; } - } - - // Check to see if BucketName property is set - internal bool IsSetBucketName() - { - return !(string.IsNullOrEmpty(this.bucketName)); - } - /// - /// The prefix that is prepended to all inventory results. - /// - public string Prefix - { - get { return this.prefix; } - set { this.prefix = value; } - } - - - // Check to see if Prefix property is set - internal bool IsSetPrefix() - { - return !(string.IsNullOrEmpty(this.prefix)); - } - - /// - /// Specifies the output format of the inventory results. - /// - public InventoryFormat InventoryFormat - { - get { return this.inventoryFormat; } - set { this.inventoryFormat = value; } - } - - // Check to see if InventoryFormat property is set - internal bool IsSetInventoryFormat() - { - return this.inventoryFormat != null; - } - - /// - /// Contains the type of server-side encryption used to encrypt the inventory results. - /// - public InventoryEncryption InventoryEncryption - { - get { return this.inventoryEncryption; } - set { this.inventoryEncryption = value; } - } - - // Check to see if InventoryEncryption property is set - internal bool IsSetInventoryEncryption() - { - return this.inventoryEncryption != null; - } - - } -} diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..1e7eb726f5b9 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationRequestMarshaller.cs @@ -0,0 +1,183 @@ +/* + * 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 +{ + /// + /// PutBucketInventoryConfiguration Request Marshaller + /// + public partial class PutBucketInventoryConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((PutBucketInventoryConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(PutBucketInventoryConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "PUT"; + request.AddSubResource("inventory"); + + 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.", "PutBucketInventoryConfigurationRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.InventoryId)) + throw new AmazonS3Exception("Request object does not have required field InventoryId set"); + + if (publicRequest.IsSetInventoryId()) + request.Parameters.Add("id", StringUtils.FromString(publicRequest.InventoryId)); + 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.IsSetInventoryConfiguration()) + { + xmlWriter.WriteStartElement("InventoryConfiguration", "http://s3.amazonaws.com/doc/2006-03-01/"); + if (publicRequest.InventoryConfiguration.Destination != null) + { + xmlWriter.WriteStartElement("Destination"); + if (publicRequest.InventoryConfiguration.Destination.S3BucketDestination != null) + { + xmlWriter.WriteStartElement("S3BucketDestination"); + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.IsSetAccountId()) + xmlWriter.WriteElementString("AccountId", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.AccountId)); + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.IsSetBucketName()) + xmlWriter.WriteElementString("Bucket", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.BucketName)); + if (publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption != null) + { + xmlWriter.WriteStartElement("Encryption"); + if (publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption.SSEKMS != null) + { + xmlWriter.WriteStartElement("SSE-KMS"); + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption.SSEKMS.IsSetKeyId()) + xmlWriter.WriteElementString("KeyId", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption.SSEKMS.KeyId)); + xmlWriter.WriteEndElement(); + } + if (publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryEncryption.SSES3 != null) + { + xmlWriter.WriteStartElement("SSE-S3"); + xmlWriter.WriteEndElement(); + } + xmlWriter.WriteEndElement(); + } + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.IsSetInventoryFormat()) + xmlWriter.WriteElementString("Format", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.InventoryFormat)); + if(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.IsSetPrefix()) + xmlWriter.WriteElementString("Prefix", StringUtils.FromString(publicRequest.InventoryConfiguration.Destination.S3BucketDestination.Prefix)); + xmlWriter.WriteEndElement(); + } + xmlWriter.WriteEndElement(); + } + if(publicRequest.InventoryConfiguration.IsSetIncludedObjectVersions()) + xmlWriter.WriteElementString("IncludedObjectVersions", StringUtils.FromString(publicRequest.InventoryConfiguration.IncludedObjectVersions)); + + InventoryFilterCustomMarshall(publicRequest, xmlWriter); + if(publicRequest.InventoryConfiguration.IsSetInventoryId()) + xmlWriter.WriteElementString("Id", StringUtils.FromString(publicRequest.InventoryConfiguration.InventoryId)); + + var publicRequestInventoryConfigurationInventoryOptionalFields = publicRequest.InventoryConfiguration.InventoryOptionalFields; + if (publicRequestInventoryConfigurationInventoryOptionalFields != null && (publicRequestInventoryConfigurationInventoryOptionalFields.Count > 0 || !AWSConfigs.InitializeCollections)) + { + xmlWriter.WriteStartElement("OptionalFields"); + foreach (var publicRequestInventoryConfigurationInventoryOptionalFieldsValue in publicRequestInventoryConfigurationInventoryOptionalFields) + { + xmlWriter.WriteStartElement("Field"); + xmlWriter.WriteValue(publicRequestInventoryConfigurationInventoryOptionalFieldsValue); + xmlWriter.WriteEndElement(); + } + xmlWriter.WriteEndElement(); + } + CustomIsEnabledMarshall(publicRequest, xmlWriter); + if (publicRequest.InventoryConfiguration.Schedule != null) + { + xmlWriter.WriteStartElement("Schedule"); + if(publicRequest.InventoryConfiguration.Schedule.IsSetFrequency()) + xmlWriter.WriteElementString("Frequency", StringUtils.FromString(publicRequest.InventoryConfiguration.Schedule.Frequency)); + 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 PutBucketInventoryConfigurationRequestMarshaller _instance = new PutBucketInventoryConfigurationRequestMarshaller(); + + internal static PutBucketInventoryConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketInventoryConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketInventoryConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, PutBucketInventoryConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..ffc4357b83b3 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketInventoryConfigurationResponseUnmarshaller.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 PutBucketInventoryConfiguration operation + /// + public partial class PutBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + PutBucketInventoryConfigurationResponse response = new PutBucketInventoryConfigurationResponse(); + + 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, PutBucketInventoryConfigurationResponse response); + + private static PutBucketInventoryConfigurationResponseUnmarshaller _instance = new PutBucketInventoryConfigurationResponseUnmarshaller(); + + internal static PutBucketInventoryConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketInventoryConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/InventoryConfiguration.cs b/sdk/src/Services/S3/Generated/Model/InventoryConfiguration.cs new file mode 100644 index 000000000000..a148486ec4a1 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/InventoryConfiguration.cs @@ -0,0 +1,189 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Specifies the S3 Inventory configuration for an Amazon S3 bucket. For more information, + /// see GET + /// Bucket inventory in the Amazon S3 API Reference. + /// + public partial class InventoryConfiguration + { + private InventoryDestination _destination; + private InventoryIncludedObjectVersions _includedObjectVersions; + private InventoryFilter _inventoryFilter; + private string _inventoryId; + private List _inventoryOptionalFields = AWSConfigs.InitializeCollections ? new List() : null; + private bool? _isEnabled; + private InventorySchedule _schedule; + + /// + /// Gets and sets the property Destination. + /// + /// Contains information about where to publish the inventory results. + /// + /// + [AWSProperty(Required=true)] + public InventoryDestination Destination + { + get { return this._destination; } + set { this._destination = value; } + } + + // Check to see if Destination property is set + internal bool IsSetDestination() + { + return this._destination != null; + } + + /// + /// Gets and sets the property IncludedObjectVersions. + /// + /// Object versions to include in the inventory list. If set to All, the list includes + /// all the object versions, which adds the version-related fields VersionId, IsLatest, + /// and DeleteMarker to the list. If set to Current, the list does not contain + /// these version-related fields. + /// + /// + [AWSProperty(Required=true)] + public InventoryIncludedObjectVersions IncludedObjectVersions + { + get { return this._includedObjectVersions; } + set { this._includedObjectVersions = value; } + } + + // Check to see if IncludedObjectVersions property is set + internal bool IsSetIncludedObjectVersions() + { + return this._includedObjectVersions != null; + } + + /// + /// Gets and sets the property InventoryFilter. + /// + /// Specifies an inventory filter. The inventory only includes objects that meet the filter's + /// criteria. + /// + /// + public InventoryFilter InventoryFilter + { + get { return this._inventoryFilter; } + set { this._inventoryFilter = value; } + } + + // Check to see if InventoryFilter property is set + internal bool IsSetInventoryFilter() + { + return this._inventoryFilter != null; + } + + /// + /// Gets and sets the property InventoryId. + /// + /// The ID used to identify the inventory configuration. + /// + /// + [AWSProperty(Required=true)] + public string InventoryId + { + get { return this._inventoryId; } + set { this._inventoryId = value; } + } + + // Check to see if InventoryId property is set + internal bool IsSetInventoryId() + { + return !String.IsNullOrEmpty(this._inventoryId); + } + + /// + /// Gets and sets the property InventoryOptionalFields. + /// + /// Contains the optional fields that are included in the inventory results. + /// + /// + /// 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 InventoryOptionalFields + { + get { return this._inventoryOptionalFields; } + set { this._inventoryOptionalFields = value; } + } + + // Check to see if InventoryOptionalFields property is set + internal bool IsSetInventoryOptionalFields() + { + return this._inventoryOptionalFields != null && (this._inventoryOptionalFields.Count > 0 || !AWSConfigs.InitializeCollections); + } + + /// + /// Gets and sets the property IsEnabled. + /// + /// Specifies whether the inventory is enabled or disabled. If set to True, an + /// inventory list is generated. If set to False, no inventory list is generated. + /// + /// + [AWSProperty(Required=true)] + public bool? IsEnabled + { + get { return this._isEnabled; } + set { this._isEnabled = value; } + } + + // Check to see if IsEnabled property is set + internal bool IsSetIsEnabled() + { + return this._isEnabled.HasValue; + } + + /// + /// Gets and sets the property Schedule. + /// + /// Specifies the schedule for generating inventory results. + /// + /// + [AWSProperty(Required=true)] + public InventorySchedule Schedule + { + get { return this._schedule; } + set { this._schedule = value; } + } + + // Check to see if Schedule property is set + internal bool IsSetSchedule() + { + return this._schedule != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/InventoryDestination.cs b/sdk/src/Services/S3/Generated/Model/InventoryDestination.cs similarity index 52% rename from sdk/src/Services/S3/Custom/Model/InventoryDestination.cs rename to sdk/src/Services/S3/Generated/Model/InventoryDestination.cs index 54ec52c9b15c..169b309a6828 100644 --- a/sdk/src/Services/S3/Custom/Model/InventoryDestination.cs +++ b/sdk/src/Services/S3/Generated/Model/InventoryDestination.cs @@ -12,38 +12,49 @@ * 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 { /// - /// Class for InventoryDestination + /// Specifies the S3 Inventory configuration for an Amazon S3 bucket. /// - public class InventoryDestination + public partial class InventoryDestination { - private InventoryS3BucketDestination inventoryS3BucketDestination; + private InventoryS3BucketDestination _s3BucketDestination; /// - /// Contains the bucket name, file format, bucket owner (optional), and prefix (optional) where inventory results are published. + /// Gets and sets the property S3BucketDestination. + /// + /// Contains the bucket name, file format, bucket owner (optional), and prefix (optional) + /// where inventory results are published. + /// /// + [AWSProperty(Required=true)] public InventoryS3BucketDestination S3BucketDestination { - get { return this.inventoryS3BucketDestination; } - set { this.inventoryS3BucketDestination = value; } + get { return this._s3BucketDestination; } + set { this._s3BucketDestination = value; } } - /// - /// Check to see if S3BucketDestination property is set - /// - /// - public bool isSetS3BucketDestination() + // Check to see if S3BucketDestination property is set + internal bool IsSetS3BucketDestination() { - return this.inventoryS3BucketDestination != null; + return this._s3BucketDestination != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/InventoryEncryption.cs b/sdk/src/Services/S3/Generated/Model/InventoryEncryption.cs similarity index 54% rename from sdk/src/Services/S3/Custom/Model/InventoryEncryption.cs rename to sdk/src/Services/S3/Generated/Model/InventoryEncryption.cs index 716786682e8d..e580c2f9146f 100644 --- a/sdk/src/Services/S3/Custom/Model/InventoryEncryption.cs +++ b/sdk/src/Services/S3/Generated/Model/InventoryEncryption.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,52 +13,65 @@ * 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 { /// - /// InventoryEncryption class + /// Contains the type of server-side encryption used to encrypt the S3 Inventory results. /// - public class InventoryEncryption + public partial class InventoryEncryption { - private SSES3 sSES3; - private SSEKMS sSEKms; + private SSEKMS _ssekms; + private SSES3 _sses3; /// - /// Specifies the use of SSE-S3 to encrypt delievered Inventory reports. + /// Gets and sets the property SSEKMS. + /// + /// Specifies the use of SSE-KMS to encrypt delivered inventory reports. + /// /// - public SSES3 SSES3 + public SSEKMS SSEKMS { - get { return this.sSES3; } - set { this.sSES3 = value; } + get { return this._ssekms; } + set { this._ssekms = value; } } - // Check to see if SSES3 property is set - internal bool IsSetSSES3() + // Check to see if SSEKMS property is set + internal bool IsSetSSEKMS() { - return this.sSES3 != null; + return this._ssekms != null; } /// - /// Specifies the use of SSE-KMS to encrypt delievered Inventory reports. + /// Gets and sets the property SSES3. + /// + /// Specifies the use of SSE-S3 to encrypt delivered inventory reports. + /// /// - public SSEKMS SSEKMS + public SSES3 SSES3 { - get { return this.sSEKms; } - set { this.sSEKms = value; } + get { return this._sses3; } + set { this._sses3 = value; } } - // Check to see if SSEKMS property is set - internal bool IsSetSSEKMS() + // Check to see if SSES3 property is set + internal bool IsSetSSES3() { - return this.sSEKms != null; + return this._sses3 != null; } - } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/InventoryS3BucketDestination.cs b/sdk/src/Services/S3/Generated/Model/InventoryS3BucketDestination.cs new file mode 100644 index 000000000000..9997bfda1cbd --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/InventoryS3BucketDestination.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.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 +{ + /// + /// Contains the bucket name, file format, bucket owner (optional), and prefix (optional) + /// where S3 Inventory results are published. + /// + public partial class InventoryS3BucketDestination + { + private string _accountId; + private string _bucketName; + private InventoryEncryption _inventoryEncryption; + private InventoryFormat _inventoryFormat; + private string _prefix; + + /// + /// Gets and sets the property AccountId. + /// + /// The account ID that owns the destination S3 bucket. If no account ID is provided, + /// the owner is not validated before exporting data. + /// + /// + /// + /// Although this value is optional, we strongly recommend that you set it to help prevent + /// problems if the destination bucket ownership changes. + /// + /// + /// + public string AccountId + { + get { return this._accountId; } + set { this._accountId = value; } + } + + // Check to see if AccountId property is set + internal bool IsSetAccountId() + { + return !String.IsNullOrEmpty(this._accountId); + } + + /// + /// Gets and sets the property BucketName. + /// + /// The Amazon Resource Name (ARN) of the bucket where inventory results will be published. + /// + /// + [AWSProperty(Required=true)] + public string BucketName + { + get { return this._bucketName; } + set { this._bucketName = value; } + } + + // Check to see if BucketName property is set + internal bool IsSetBucketName() + { + return !String.IsNullOrEmpty(this._bucketName); + } + + /// + /// Gets and sets the property InventoryEncryption. + /// + /// Contains the type of server-side encryption used to encrypt the inventory results. + /// + /// + public InventoryEncryption InventoryEncryption + { + get { return this._inventoryEncryption; } + set { this._inventoryEncryption = value; } + } + + // Check to see if InventoryEncryption property is set + internal bool IsSetInventoryEncryption() + { + return this._inventoryEncryption != null; + } + + /// + /// Gets and sets the property InventoryFormat. + /// + /// Specifies the output format of the inventory results. + /// + /// + [AWSProperty(Required=true)] + public InventoryFormat InventoryFormat + { + get { return this._inventoryFormat; } + set { this._inventoryFormat = value; } + } + + // Check to see if InventoryFormat property is set + internal bool IsSetInventoryFormat() + { + return this._inventoryFormat != null; + } + + /// + /// Gets and sets the property Prefix. + /// + /// The prefix that is prepended to all inventory results. + /// + /// + public string Prefix + { + get { return this._prefix; } + set { this._prefix = value; } + } + + // Check to see if Prefix property is set + internal bool IsSetPrefix() + { + return !String.IsNullOrEmpty(this._prefix); + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/InventorySchedule.cs b/sdk/src/Services/S3/Generated/Model/InventorySchedule.cs similarity index 60% rename from sdk/src/Services/S3/Custom/Model/InventorySchedule.cs rename to sdk/src/Services/S3/Generated/Model/InventorySchedule.cs index 10fd782bb2ff..02c99e200455 100644 --- a/sdk/src/Services/S3/Custom/Model/InventorySchedule.cs +++ b/sdk/src/Services/S3/Generated/Model/InventorySchedule.cs @@ -12,36 +12,48 @@ * 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 { /// - /// Class for InventorySchedule + /// Specifies the schedule for generating S3 Inventory results. /// - public class InventorySchedule + public partial class InventorySchedule { - private InventoryFrequency inventoryFrequency; + private InventoryFrequency _frequency; /// + /// Gets and sets the property Frequency. + /// /// Specifies how frequently inventory results are produced. + /// /// + [AWSProperty(Required=true)] public InventoryFrequency Frequency { - get { return this.inventoryFrequency; } - set { this.inventoryFrequency = value; } + get { return this._frequency; } + set { this._frequency = value; } } // Check to see if Frequency property is set - internal bool IsFrequency() + internal bool IsSetFrequency() { - return this.inventoryFrequency != null; + return this._frequency != null; } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationRequest.cs similarity index 71% rename from sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationRequest.cs index d326a75834a8..dcd65ec7d50e 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationRequest.cs @@ -12,26 +12,34 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// /// Container for the parameters to the PutBucketInventoryConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// - /// This implementation of the PUT action adds an inventory configuration - /// (identified by the inventory ID) to the bucket. You can have up to 1,000 inventory - /// configurations per bucket. + /// This implementation of the PUT action adds an S3 Inventory configuration (identified + /// by the inventory ID) to the bucket. You can have up to 1,000 inventory configurations + /// per bucket. /// /// /// @@ -60,14 +68,13 @@ namespace Amazon.S3.Model /// ///
Permissions
/// - /// To use this operation, you must have permission to perform the s3:PutInventoryConfiguration + /// To use this operation, you must have permission to perform the s3:PutInventoryConfiguration /// action. The bucket owner has this permission by default and can grant this permission /// to others. /// /// /// - /// The s3:PutInventoryConfiguration permission allows a user to create an - /// S3 + /// The s3:PutInventoryConfiguration permission allows a user to create an S3 /// Inventory report that includes all object metadata fields available and to specify /// the destination bucket to store the inventory. A user with read access to objects /// in the destination bucket can also access all object metadata fields that are available @@ -85,7 +92,7 @@ namespace Amazon.S3.Model /// ///
/// - /// PutBucketInventoryConfiguration has the following special errors: + /// PutBucketInventoryConfiguration has the following special errors: /// ///
HTTP 400 Bad Request Error
/// @@ -107,12 +114,12 @@ 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:PutInventoryConfiguration bucket permission to set the configuration - /// on the bucket. + /// s3:PutInventoryConfiguration bucket permission to set the configuration on + /// the bucket. /// ///
/// - /// The following operations are related to PutBucketInventoryConfiguration: + /// The following operations are related to PutBucketInventoryConfiguration: /// /// + /// + /// + /// 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 PutBucketInventoryConfigurationRequest : AmazonWebServiceRequest { - private string bucketName; - private string inventoryId; - private InventoryConfiguration inventoryConfiguration; - private string expectedBucketOwner; + private string _bucketName; + private string _expectedBucketOwner; + private InventoryConfiguration _inventoryConfiguration; + private string _inventoryId; /// + /// Gets and sets the property BucketName. + /// /// The name of the bucket where the inventory configuration will be stored. + /// /// + [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 Bucket property is set + // Check to see if BucketName property is set internal bool IsSetBucketName() { - return !(string.IsNullOrEmpty(this.bucketName)); + return this._bucketName != null; } /// - /// Specifies the inventory Id. + /// 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 InventoryId + public string ExpectedBucketOwner { - get { return this.inventoryId; } - set { this.inventoryId = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - // Check to see if InventoryId property is set - internal bool IsSetInventoryId() + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() { - return !(string.IsNullOrEmpty(this.inventoryId)); + return !String.IsNullOrEmpty(this._expectedBucketOwner); } /// + /// Gets and sets the property InventoryConfiguration. + /// /// Specifies the inventory configuration. + /// /// + [AWSProperty(Required=true)] public InventoryConfiguration InventoryConfiguration { - get { return this.inventoryConfiguration; } - set { this.inventoryConfiguration = value; } + get { return this._inventoryConfiguration; } + set { this._inventoryConfiguration = value; } } // Check to see if InventoryConfiguration property is set internal bool IsSetInventoryConfiguration() { - return this.inventoryConfiguration != null; + return this._inventoryConfiguration != null; } /// - /// Gets and sets the property ExpectedBucketOwner. + /// Gets and sets the property InventoryId. /// - /// 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 ID used to identify the inventory configuration. /// /// - public string ExpectedBucketOwner + [AWSProperty(Required=true)] + public string InventoryId { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._inventoryId; } + set { this._inventoryId = value; } } - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() + // Check to see if InventoryId property is set + internal bool IsSetInventoryId() { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + return this._inventoryId != null; } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationResponse.cs similarity index 73% rename from sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationResponse.cs index d6a1071f7162..92c48676e624 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketInventoryConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketInventoryConfigurationResponse.cs @@ -12,20 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// Returns information about the PutInventoryConfigurationResponse response metadata. - /// The PutInventoryConfigurationResponse operation has a void result type. + /// This is the response object from the PutBucketInventoryConfiguration operation. /// public partial class PutBucketInventoryConfigurationResponse : AmazonWebServiceResponse { + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/SSEKMS.cs b/sdk/src/Services/S3/Generated/Model/SSEKMS.cs similarity index 60% rename from sdk/src/Services/S3/Custom/Model/SSEKMS.cs rename to sdk/src/Services/S3/Generated/Model/SSEKMS.cs index d0cc25cc6324..00242e995ce8 100644 --- a/sdk/src/Services/S3/Custom/Model/SSEKMS.cs +++ b/sdk/src/Services/S3/Generated/Model/SSEKMS.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,39 +13,48 @@ * 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 { /// - /// SSEKMS class + /// Specifies the use of SSE-KMS to encrypt delivered inventory reports. /// - public class SSEKMS + public partial class SSEKMS { - private string keyId; + private string _keyId; /// /// Gets and sets the property KeyId. /// - /// Specifies the ID of the Amazon Web Services Key Management Service (Amazon Web Services - /// KMS) symmetric encryption customer managed key to use for encrypting inventory reports. + /// Specifies the ID of the Key Management Service (KMS) symmetric encryption customer + /// managed key to use for encrypting inventory reports. /// /// + [AWSProperty(Required=true, Sensitive=true)] public string KeyId { - get { return this.keyId; } - set { this.keyId = value; } + get { return this._keyId; } + set { this._keyId = value; } } // Check to see if KeyId property is set internal bool IsSetKeyId() { - return this.keyId != null; + return this._keyId != null; } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/SSES3.cs b/sdk/src/Services/S3/Generated/Model/SSES3.cs similarity index 69% rename from sdk/src/Services/S3/Custom/Model/SSES3.cs rename to sdk/src/Services/S3/Generated/Model/SSES3.cs index cbcd212d2755..3b8d9eb8b83c 100644 --- a/sdk/src/Services/S3/Custom/Model/SSES3.cs +++ b/sdk/src/Services/S3/Generated/Model/SSES3.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,18 +13,27 @@ * 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 { /// - /// SSES3 class + /// Specifies the use of SSE-S3 to encrypt delivered inventory reports. /// - public class SSES3 + public partial class SSES3 { + } -} +} \ No newline at end of file From 47bb5fe6e997ce6cf8393c18680944906b97de56 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 26 Nov 2025 12:22:59 -0800 Subject: [PATCH 05/11] Generate GetBucketInventoryConfiguration (#4155) * Generate PutBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4154, branch: peterrsongg/petesong/phase-3-pr4-3/1 * Generate PutBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4154, branch: peterrsongg/petesong/phase-3-pr4-3/1 * Generate GetBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4155, branch: peterrsongg/petesong/phase-3-pr4-3/2 * Remove IsEnabled customization --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 10 ++ ...InventoryConfigurationRequestMarshaller.cs | 50 +------ ...entoryConfigurationResponseUnmarshaller.cs | 139 ------------------ .../InventoryConfigurationUnmarshaller.cs | 120 --------------- .../SSES3Unmarshaller.cs | 71 --------- .../GetBucketInventoryConfigurationRequest.cs | 82 +++++++---- ...GetBucketInventoryConfigurationResponse.cs | 24 ++- ...InventoryConfigurationRequestMarshaller.cs | 101 +++++++++++++ ...entoryConfigurationResponseUnmarshaller.cs | 126 ++++++++++++++++ .../InventoryConfigurationUnmarshaller.cs | 131 +++++++++++++++++ .../InventoryDestinationUnmarshaller.cs | 61 ++++---- .../InventoryEncryptionUnmarshaller.cs | 67 +++++---- ...nventoryS3BucketDestinationUnmarshaller.cs | 83 ++++++----- .../InventoryScheduleUnmarshaller.cs | 60 +++++--- .../SSEKMSUnmarshaller.cs | 63 ++++---- .../SSES3Unmarshaller.cs | 85 +++++++++++ 17 files changed, 724 insertions(+), 551 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketInventoryConfigurationRequest.cs (68%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketInventoryConfigurationResponse.cs (64%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs (56%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs (55%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs (52%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs (54%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs (55%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 06674aeb4b86..43c1252c8c9a 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -552,7 +552,7 @@ public List S3AllowListOperations new Operation(this, "CreateSession", DocumentRoot[OperationsKey]["CreateSession"]), new Operation(this, "GetBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["GetBucketAnalyticsConfiguration"]), new Operation(this, "GetBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["GetBucketIntelligentTieringConfiguration"]), - //new Operation(this, "GetBucketInventoryConfiguration", DocumentRoot[OperationsKey]["GetBucketInventoryConfiguration"]), + new Operation(this, "GetBucketInventoryConfiguration", DocumentRoot[OperationsKey]["GetBucketInventoryConfiguration"]), //new Operation(this, "GetBucketLogging", DocumentRoot[OperationsKey]["GetBucketLogging"]), new Operation(this, "GetBucketMetricsConfiguration", DocumentRoot[OperationsKey]["GetBucketMetricsConfiguration"]), //new Operation(this, "GetBucketVersioning", DocumentRoot[OperationsKey]["GetBucketVersioning"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 65e2199bf87c..77891d4f19c6 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1127,6 +1127,16 @@ "Format":{"emitPropertyName":"InventoryFormat"} } ] + }, + "GetBucketInventoryConfigurationRequest":{ + "modify":[ + { + "Id":{"emitPropertyName":"InventoryId"} + }, + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs index 5b298baf4b49..58eb3a39eb35 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.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"). @@ -21,52 +21,14 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations { - /// - /// Get InventoryConfiguration Request Marshaller + /// + /// Custom marshaller for GetBucketInventoryConfiguration /// - public class GetBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller + public partial class GetBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketInventoryConfigurationRequest publicRequest) { - return this.Marshall((GetBucketInventoryConfigurationRequest)input); - } - - public IRequest Marshall(GetBucketInventoryConfigurationRequest getInventoryConfigurationRequest) - { - IRequest request = new DefaultRequest(getInventoryConfigurationRequest, "Amazon.S3"); - - request.Suppress404Exceptions = true; - request.HttpMethod = "GET"; - - if (getInventoryConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getInventoryConfigurationRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(getInventoryConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetBucketInventoryConfigurationRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("inventory"); - request.AddSubResource("id", getInventoryConfigurationRequest.InventoryId); - request.UseQueryString = true; - - return request; - } - - private static GetBucketInventoryConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static GetBucketInventoryConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketInventoryConfigurationRequestMarshaller(); - } - return _instance; - } + defaultRequest.Suppress404Exceptions = true; } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs deleted file mode 100644 index 847d66c8613b..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,139 +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.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for GetInventoryConfiguration operation - /// - public class GetBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - GetBucketInventoryConfigurationResponse response = new GetBucketInventoryConfigurationResponse(); - - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context, response); - continue; - } - } - - return response; - } - - private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketInventoryConfigurationResponse response) - { - - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - response.InventoryConfiguration = new InventoryConfiguration(); - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - if (context.TestExpression("Destination", targetDepth)) - { - response.InventoryConfiguration.Destination = InventoryDestinationUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("IsEnabled", targetDepth)) - { - response.InventoryConfiguration.IsEnabled = BoolUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Filter", targetDepth)) - { - response.InventoryConfiguration.InventoryFilter = InventoryFilterUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Id", targetDepth)) - { - response.InventoryConfiguration.InventoryId = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("IncludedObjectVersions", targetDepth)) - { - response.InventoryConfiguration.IncludedObjectVersions = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Field", targetDepth + 1)) - { - if (response.InventoryConfiguration.InventoryOptionalFields == null) - { - response.InventoryConfiguration.InventoryOptionalFields = new List(); - } - response.InventoryConfiguration.InventoryOptionalFields.Add(StringUnmarshaller.Instance.Unmarshall(context)); - continue; - } - if (context.TestExpression("Schedule", targetDepth)) - { - response.InventoryConfiguration.Schedule = InventoryScheduleUnmarshaller.Instance.Unmarshall(context); - - continue; - } - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return; - } - } - - return; - } - - private static GetBucketInventoryConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static GetBucketInventoryConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketInventoryConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs deleted file mode 100644 index d1a00b1fb71a..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs +++ /dev/null @@ -1,120 +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.Collections.Generic; - -using Amazon.S3.Model; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// InventoryConfiguration Unmarshaller - /// - public class InventoryConfigurationUnmarshaller : IXmlUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public InventoryConfiguration Unmarshall(XmlUnmarshallerContext context) - { - InventoryConfiguration response = new InventoryConfiguration(); - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - if (context.TestExpression("Destination", targetDepth)) - { - response.Destination = InventoryDestinationUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("IsEnabled", targetDepth)) - { - response.IsEnabled = BoolUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Filter", targetDepth)) - { - response.InventoryFilter = InventoryFilterUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Id", targetDepth)) - { - response.InventoryId = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("IncludedObjectVersions", targetDepth)) - { - response.IncludedObjectVersions = InventoryIncludedObjectVersions.FindValue(StringUnmarshaller.Instance.Unmarshall(context)); - - continue; - } - if (context.TestExpression("Field", targetDepth + 1)) - { - if (response.InventoryOptionalFields == null) - { - response.InventoryOptionalFields = new List(); - } - response.InventoryOptionalFields.Add(InventoryOptionalField.FindValue(StringUnmarshaller.Instance.Unmarshall(context))); - continue; - } - if (context.TestExpression("Schedule", targetDepth)) - { - response.Schedule = InventoryScheduleUnmarshaller.Instance.Unmarshall(context); - - continue; - } - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return response; - } - } - - - - return response; - } - - - private static InventoryConfigurationUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static InventoryConfigurationUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new InventoryConfigurationUnmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs deleted file mode 100644 index e6fbff95a7c1..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs +++ /dev/null @@ -1,71 +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.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// SSES3 Unmarshaller - /// - public class SSES3Unmarshaller : IXmlUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public SSES3 Unmarshall(XmlUnmarshallerContext context) - { - SSES3 condition = new SSES3(); - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - // Currently SSES3 is an empty shape and does not have any members inside of it. - continue; - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return condition; - } - } - return condition; - } - - private static SSES3Unmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static SSES3Unmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new SSES3Unmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationRequest.cs similarity index 68% rename from sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationRequest.cs index 778e08b9d18b..cbde2bf3f52f 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationRequest.cs @@ -12,31 +12,37 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; +using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// /// Container for the parameters to the GetBucketInventoryConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// - /// Returns an inventory configuration (identified by the inventory configuration ID) + /// Returns an S3 Inventory configuration (identified by the inventory configuration ID) /// from the bucket. /// /// /// - /// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration + /// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration /// action. The bucket owner has this permission by default and can grant this permission /// to others. For more information about permissions, see Permissions /// Related to Bucket Subresource Operations and Managing @@ -49,7 +55,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following operations are related to GetBucketInventoryConfiguration: + /// The following operations are related to GetBucketInventoryConfiguration: /// /// + /// + /// + /// 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 GetBucketInventoryConfigurationRequest : AmazonWebServiceRequest { - private string bucketName; - private string inventoryId; - private string expectedBucketOwner; + private string _bucketName; + private string _expectedBucketOwner; + private string _inventoryId; /// + /// Gets and sets the property BucketName. + /// /// The name of the bucket containing the inventory configuration to 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; } /// - /// The ID used to identify the inventory configuration. + /// 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 InventoryId + public string ExpectedBucketOwner { - get { return this.inventoryId; } - set { this.inventoryId = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - // Check to see if InventoryId property is set - internal bool IsSetInventoryId() + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() { - return !(string.IsNullOrEmpty(this.inventoryId)); + return !String.IsNullOrEmpty(this._expectedBucketOwner); } /// - /// Gets and sets the property ExpectedBucketOwner. + /// Gets and sets the property InventoryId. /// - /// 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 ID used to identify the inventory configuration. /// /// - public string ExpectedBucketOwner + [AWSProperty(Required=true)] + public string InventoryId { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._inventoryId; } + set { this._inventoryId = value; } } - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() + // Check to see if InventoryId property is set + internal bool IsSetInventoryId() { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + return this._inventoryId != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationResponse.cs similarity index 64% rename from sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationResponse.cs index f7c51291dee0..8905ab0fe5cf 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketInventoryConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketInventoryConfigurationResponse.cs @@ -12,35 +12,47 @@ * 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 { /// - /// GetInventoryConfigurationResponse Response + /// This is the response object from the GetBucketInventoryConfiguration operation. /// public partial class GetBucketInventoryConfigurationResponse : AmazonWebServiceResponse { - InventoryConfiguration inventoryConfiguration; + private InventoryConfiguration _inventoryConfiguration; /// + /// Gets and sets the property InventoryConfiguration. + /// /// Specifies the inventory configuration. + /// /// public InventoryConfiguration InventoryConfiguration { - get { return this.inventoryConfiguration; } - set { this.inventoryConfiguration = value; } + get { return this._inventoryConfiguration; } + set { this._inventoryConfiguration = value; } } // Check to see if InventoryConfiguration property is set internal bool IsSetInventoryConfiguration() { - return this.inventoryConfiguration != null; + return this._inventoryConfiguration != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..ced479fd4f69 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationRequestMarshaller.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 +{ + /// + /// GetBucketInventoryConfiguration Request Marshaller + /// + public partial class GetBucketInventoryConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((GetBucketInventoryConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(GetBucketInventoryConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "GET"; + request.AddSubResource("inventory"); + + 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.", "GetBucketInventoryConfigurationRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.InventoryId)) + throw new AmazonS3Exception("Request object does not have required field InventoryId set"); + + if (publicRequest.IsSetInventoryId()) + request.Parameters.Add("id", StringUtils.FromString(publicRequest.InventoryId)); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static GetBucketInventoryConfigurationRequestMarshaller _instance = new GetBucketInventoryConfigurationRequestMarshaller(); + + internal static GetBucketInventoryConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketInventoryConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetBucketInventoryConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketInventoryConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..9bad3d1e2399 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketInventoryConfigurationResponseUnmarshaller.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 GetBucketInventoryConfiguration operation + /// + public partial class GetBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + GetBucketInventoryConfigurationResponse response = new GetBucketInventoryConfigurationResponse(); + UnmarshallResult(context,response); + + PostUnmarshallCustomization(context, response); + return response; + } + + private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketInventoryConfigurationResponse response) + { + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + if (context.IsEmptyResponse) + { + return; + } + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + if (context.TestExpression("InventoryConfiguration", targetDepth)) + { + var unmarshaller = InventoryConfigurationUnmarshaller.Instance; + response.InventoryConfiguration = 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, GetBucketInventoryConfigurationResponse response); + + private static GetBucketInventoryConfigurationResponseUnmarshaller _instance = new GetBucketInventoryConfigurationResponseUnmarshaller(); + + internal static GetBucketInventoryConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketInventoryConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs new file mode 100644 index 000000000000..29030ab0a989 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryConfigurationUnmarshaller.cs @@ -0,0 +1,131 @@ +/* + * 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 InventoryConfiguration Object + /// + public partial class InventoryConfigurationUnmarshaller : IXmlUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public InventoryConfiguration Unmarshall(XmlUnmarshallerContext context) + { + InventoryConfiguration unmarshalledObject = new InventoryConfiguration(); + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + + if (context.IsStartOfDocument) + targetDepth += 2; + + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + if (context.TestExpression("Destination", targetDepth)) + { + var unmarshaller = InventoryDestinationUnmarshaller.Instance; + unmarshalledObject.Destination = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("IncludedObjectVersions", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.IncludedObjectVersions = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("Filter", targetDepth)) + { + var unmarshaller = InventoryFilterUnmarshaller.Instance; + unmarshalledObject.InventoryFilter = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("Id", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.InventoryId = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("OptionalFields/Field", targetDepth)) + { + if (unmarshalledObject.InventoryOptionalFields == null) + { + unmarshalledObject.InventoryOptionalFields = new List(); + } + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.InventoryOptionalFields.Add(unmarshaller.Unmarshall(context)); + continue; + } + if (context.TestExpression("IsEnabled", targetDepth)) + { + var unmarshaller = NullableBoolUnmarshaller.Instance; + unmarshalledObject.IsEnabled = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("Schedule", targetDepth)) + { + var unmarshaller = InventoryScheduleUnmarshaller.Instance; + unmarshalledObject.Schedule = unmarshaller.Unmarshall(context); + continue; + } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); + } + else if (context.IsEndElement && context.CurrentDepth < originalDepth) + { + return unmarshalledObject; + } + } + return unmarshalledObject; + } + + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryConfiguration unmarshalledObject, int targetDepth); + + private static InventoryConfigurationUnmarshaller _instance = new InventoryConfigurationUnmarshaller(); + + /// + /// Gets the singleton. + /// + public static InventoryConfigurationUnmarshaller Instance + { + get + { + return _instance; + } + } + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs similarity index 56% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs index 93c782ac0451..c6efcb2accd7 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryDestinationUnmarshaller.cs @@ -12,69 +12,80 @@ * 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 { /// - /// InventoryDestination Unmarshaller - /// - public class InventoryDestinationUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for InventoryDestination Object + /// + public partial class InventoryDestinationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public InventoryDestination Unmarshall(XmlUnmarshallerContext context) { - InventoryDestination condition = new InventoryDestination(); + InventoryDestination unmarshalledObject = new InventoryDestination(); 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("S3BucketDestination", targetDepth)) { - condition.S3BucketDestination = InventoryS3BucketDestinationUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = InventoryS3BucketDestinationUnmarshaller.Instance; + unmarshalledObject.S3BucketDestination = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - - - return condition; + } + return unmarshalledObject; } - private static InventoryDestinationUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryDestination unmarshalledObject, int targetDepth); + + private static InventoryDestinationUnmarshaller _instance = new InventoryDestinationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static InventoryDestinationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new InventoryDestinationUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs similarity index 55% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs index bc5616bf6843..903856c6b99c 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryEncryptionUnmarshaller.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,75 +12,86 @@ * 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 { /// - /// InventoryEncryption Unmarshaller - /// - public class InventoryEncryptionUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for InventoryEncryption Object + /// + public partial class InventoryEncryptionUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public InventoryEncryption Unmarshall(XmlUnmarshallerContext context) { - InventoryEncryption condition = new InventoryEncryption(); + InventoryEncryption unmarshalledObject = new InventoryEncryption(); 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("SSE-KMS", targetDepth)) { - condition.SSEKMS = SSEKMSUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = SSEKMSUnmarshaller.Instance; + unmarshalledObject.SSEKMS = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SSE-S3", targetDepth)) { - condition.SSES3 = SSES3Unmarshaller.Instance.Unmarshall(context); - + var unmarshaller = SSES3Unmarshaller.Instance; + unmarshalledObject.SSES3 = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - - - return condition; + } + return unmarshalledObject; } - private static InventoryEncryptionUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryEncryption unmarshalledObject, int targetDepth); + + private static InventoryEncryptionUnmarshaller _instance = new InventoryEncryptionUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static InventoryEncryptionUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new InventoryEncryptionUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs similarity index 52% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs index 3491947ef7ac..3df91d426220 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryS3BucketDestinationUnmarshaller.cs @@ -12,91 +12,104 @@ * 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 { /// - /// InventoryS3BucketDestination Unmarshaller - /// - public class InventoryS3BucketDestinationUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for InventoryS3BucketDestination Object + /// + public partial class InventoryS3BucketDestinationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public InventoryS3BucketDestination Unmarshall(XmlUnmarshallerContext context) { - InventoryS3BucketDestination condition = new InventoryS3BucketDestination(); + InventoryS3BucketDestination unmarshalledObject = new InventoryS3BucketDestination(); 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("AccountId", targetDepth)) { - condition.AccountId = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.AccountId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Bucket", targetDepth)) { - condition.BucketName = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.BucketName = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("Format", targetDepth)) + if (context.TestExpression("Encryption", targetDepth)) { - condition.InventoryFormat = InventoryFormat.FindValue(StringUnmarshaller.GetInstance().Unmarshall(context)); - + var unmarshaller = InventoryEncryptionUnmarshaller.Instance; + unmarshalledObject.InventoryEncryption = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("Prefix", targetDepth)) + if (context.TestExpression("Format", targetDepth)) { - condition.Prefix = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.InventoryFormat = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("Encryption", targetDepth)) + if (context.TestExpression("Prefix", targetDepth)) { - condition.InventoryEncryption = InventoryEncryptionUnmarshaller.Instance.Unmarshall(context); + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.Prefix = unmarshaller.Unmarshall(context); + continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - - - return condition; + } + return unmarshalledObject; } - private static InventoryS3BucketDestinationUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryS3BucketDestination unmarshalledObject, int targetDepth); + + private static InventoryS3BucketDestinationUnmarshaller _instance = new InventoryS3BucketDestinationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static InventoryS3BucketDestinationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new InventoryS3BucketDestinationUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs similarity index 54% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs index 24600dffeba6..f0165c7dbd26 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryScheduleUnmarshaller.cs @@ -12,68 +12,80 @@ * 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 { /// - /// InventorySchedule Unmarshaller - /// - public class InventoryScheduleUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for InventorySchedule Object + /// + public partial class InventoryScheduleUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public InventorySchedule Unmarshall(XmlUnmarshallerContext context) { - InventorySchedule condition = new InventorySchedule(); + InventorySchedule unmarshalledObject = new InventorySchedule(); 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("Frequency", targetDepth)) { - - condition.Frequency = InventoryFrequency.FindValue(StringUnmarshaller.GetInstance().Unmarshall(context)); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.Frequency = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - return condition; + } + return unmarshalledObject; } - private static InventoryScheduleUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventorySchedule unmarshalledObject, int targetDepth); + + private static InventoryScheduleUnmarshaller _instance = new InventoryScheduleUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static InventoryScheduleUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new InventoryScheduleUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs similarity index 55% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs index 730e45196c88..d4fb53e9dc77 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSEKMSUnmarshaller.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,69 +12,80 @@ * 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 { /// - /// SSEKMS Unmarshaller - /// - public class SSEKMSUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for SSEKMS Object + /// + public partial class SSEKMSUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public SSEKMS Unmarshall(XmlUnmarshallerContext context) { - SSEKMS condition = new SSEKMS(); + SSEKMS unmarshalledObject = new SSEKMS(); 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("KeyId", targetDepth)) { - condition.KeyId = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.KeyId = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return condition; + return unmarshalledObject; } - } - - - - return condition; + } + return unmarshalledObject; } - private static SSEKMSUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, SSEKMS unmarshalledObject, int targetDepth); + + private static SSEKMSUnmarshaller _instance = new SSEKMSUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static SSEKMSUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new SSEKMSUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs new file mode 100644 index 000000000000..470b40e506b3 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/SSES3Unmarshaller.cs @@ -0,0 +1,85 @@ +/* + * 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 SSES3 Object + /// + public partial class SSES3Unmarshaller : IXmlUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public SSES3 Unmarshall(XmlUnmarshallerContext context) + { + SSES3 unmarshalledObject = new SSES3(); + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + + if (context.IsStartOfDocument) + targetDepth += 2; + + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); + } + else if (context.IsEndElement && context.CurrentDepth < originalDepth) + { + return unmarshalledObject; + } + } + return unmarshalledObject; + } + + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, SSES3 unmarshalledObject, int targetDepth); + + private static SSES3Unmarshaller _instance = new SSES3Unmarshaller(); + + /// + /// Gets the singleton. + /// + public static SSES3Unmarshaller Instance + { + get + { + return _instance; + } + } + } +} \ No newline at end of file From 0384a3bd7ff7175ba858ed848f3c50b2ac484ec8 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 26 Nov 2025 12:36:04 -0800 Subject: [PATCH 06/11] Geneate DeleteBucketInventoryConfiguration (#4157) stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4157, branch: peterrsongg/petesong/phase-3-pr4-3/4 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 10 ++ ...leteBucketInventoryConfigurationRequest.cs | 91 ----------- ...InventoryConfigurationRequestMarshaller.cs | 71 --------- ...entoryConfigurationResponseUnmarshaller.cs | 59 ------- ...leteBucketInventoryConfigurationRequest.cs | 147 ++++++++++++++++++ ...eteBucketInventoryConfigurationResponse.cs | 14 +- ...InventoryConfigurationRequestMarshaller.cs | 101 ++++++++++++ ...entoryConfigurationResponseUnmarshaller.cs | 98 ++++++++++++ 9 files changed, 368 insertions(+), 225 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationRequest.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationRequest.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/DeleteBucketInventoryConfigurationResponse.cs (73%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 74c33ab8291f..61b8e7ba4a0c 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -571,7 +571,7 @@ public List S3AllowListOperations new Operation(this, "DeleteBucketMetricsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketAnalyticsConfiguration"]), new Operation(this, "DeleteBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["DeleteBucketIntelligentTieringConfiguration"]), - //new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), + new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), }; } diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index c4e3dbd14361..8d40ec042246 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1163,6 +1163,16 @@ "NextToken":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._nextToken);"]} } ] + }, + "DeleteBucketInventoryConfigurationRequest":{ + "modify":[ + { + "Id":{"emitPropertyName":"InventoryId"} + }, + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationRequest.cs b/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationRequest.cs deleted file mode 100644 index c9429fa0f9b1..000000000000 --- a/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationRequest.cs +++ /dev/null @@ -1,91 +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.Xml.Serialization; -using System.Text; -using System.IO; - -using Amazon.Runtime; -using Amazon.Runtime.Internal; - - -namespace Amazon.S3.Model -{ - /// - /// Container for the parameters to the DeleteInventoryConfiguration operation. - /// Deletes an inventory configuration (identified by the inventory ID) from the bucket. - /// - public partial class DeleteBucketInventoryConfigurationRequest : AmazonWebServiceRequest - { - private string bucketName; - private string inventoryId; - private string expectedBucketOwner; - - /// - /// The name of the bucket containing the inventory configuration to delete. - /// - public string BucketName - { - get { return this.bucketName; } - set { this.bucketName = value; } - } - - // Check to see if BucketName property is set - internal bool IsSetBucketName() - { - return !(string.IsNullOrEmpty(this.bucketName)); - } - - /// - /// The ID used to identify the inventory configuration. - /// - public string InventoryId - { - get { return this.inventoryId; } - set { this.inventoryId = value; } - } - - // Check to see if InventoryId property is set - internal bool IsSetInventoryId() - { - return !(string.IsNullOrEmpty(this.inventoryId)); - } - - /// - /// Gets and sets the property ExpectedBucketOwner. - /// - /// The account ID of the expected bucket owner. If the account ID that you provide does - /// not match the actual owner of the bucket, the request fails with the HTTP status code - /// 403 Forbidden (access denied). - /// - /// - public string ExpectedBucketOwner - { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } - } - - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() - { - return !String.IsNullOrEmpty(this.expectedBucketOwner); - } - - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs deleted file mode 100644 index d2bf215460f2..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs +++ /dev/null @@ -1,71 +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; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Delete InventoryConfiguration Request Marshaller - /// - public class DeleteBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((DeleteBucketInventoryConfigurationRequest)input); - } - - public IRequest Marshall(DeleteBucketInventoryConfigurationRequest deleteInventoryConfigurationRequest) - { - IRequest request = new DefaultRequest(deleteInventoryConfigurationRequest, "Amazon.S3"); - - request.HttpMethod = "DELETE"; - - if (deleteInventoryConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(deleteInventoryConfigurationRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(deleteInventoryConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "DeleteBucketInventoryConfigurationRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("inventory"); - request.AddSubResource("id", deleteInventoryConfigurationRequest.InventoryId); - request.UseQueryString = true; - - return request; - } - - private static DeleteBucketInventoryConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static DeleteBucketInventoryConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new DeleteBucketInventoryConfigurationRequestMarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs deleted file mode 100644 index f7f4a8e1be7a..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,59 +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.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for DeleteInventoryConfiguration operation - /// - public class DeleteBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - DeleteBucketInventoryConfigurationResponse response = new DeleteBucketInventoryConfigurationResponse(); - - return response; - } - - private static DeleteBucketInventoryConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static DeleteBucketInventoryConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new DeleteBucketInventoryConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationRequest.cs new file mode 100644 index 000000000000..dfee3069c261 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationRequest.cs @@ -0,0 +1,147 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Container for the parameters to the DeleteBucketInventoryConfiguration operation. + /// + /// + /// This operation is not supported for directory buckets. + /// + /// + /// + /// Deletes an S3 Inventory configuration (identified by the inventory ID) from the bucket. + /// + /// + /// + /// To use this operation, you must have permissions to perform the s3:PutInventoryConfiguration + /// action. The bucket owner has this permission by default. The bucket owner can grant + /// this permission to others. For more information about permissions, see Permissions + /// Related to Bucket Subresource Operations and Managing + /// Access Permissions to Your Amazon S3 Resources. + /// + /// + /// + /// For information about the Amazon S3 inventory feature, see Amazon + /// S3 Inventory. + /// + /// + /// + /// Operations related to DeleteBucketInventoryConfiguration 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 DeleteBucketInventoryConfigurationRequest : AmazonWebServiceRequest + { + private string _bucketName; + private string _expectedBucketOwner; + private string _inventoryId; + + /// + /// Gets and sets the property BucketName. + /// + /// The name of the bucket containing the inventory configuration to delete. + /// + /// + [AWSProperty(Required=true)] + public string BucketName + { + get { return this._bucketName; } + set { this._bucketName = value; } + } + + // Check to see if BucketName property is set + internal bool IsSetBucketName() + { + return this._bucketName != null; + } + + /// + /// Gets and sets the property ExpectedBucketOwner. + /// + /// The account ID of the expected bucket owner. If the account ID that you provide does + /// not match the actual owner of the bucket, the request fails with the HTTP status code + /// 403 Forbidden (access denied). + /// + /// + public string ExpectedBucketOwner + { + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } + } + + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() + { + return !String.IsNullOrEmpty(this._expectedBucketOwner); + } + + /// + /// Gets and sets the property InventoryId. + /// + /// The ID used to identify the inventory configuration. + /// + /// + [AWSProperty(Required=true)] + public string InventoryId + { + get { return this._inventoryId; } + set { this._inventoryId = value; } + } + + // Check to see if InventoryId property is set + internal bool IsSetInventoryId() + { + return this._inventoryId != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationResponse.cs similarity index 73% rename from sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationResponse.cs index cb2fb4057194..0b1098a4e85d 100644 --- a/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationResponse.cs @@ -12,20 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// Returns information about the DeleteInventoryConfiguration response metadata. - /// The DeleteInventoryConfiguration operation has a void result type. + /// This is the response object from the DeleteBucketInventoryConfiguration operation. /// public partial class DeleteBucketInventoryConfigurationResponse : AmazonWebServiceResponse { + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..ca7fc5603ea9 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.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 +{ + /// + /// DeleteBucketInventoryConfiguration Request Marshaller + /// + public partial class DeleteBucketInventoryConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((DeleteBucketInventoryConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(DeleteBucketInventoryConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "DELETE"; + request.AddSubResource("inventory"); + + 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.", "DeleteBucketInventoryConfigurationRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.InventoryId)) + throw new AmazonS3Exception("Request object does not have required field InventoryId set"); + + if (publicRequest.IsSetInventoryId()) + request.Parameters.Add("id", StringUtils.FromString(publicRequest.InventoryId)); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static DeleteBucketInventoryConfigurationRequestMarshaller _instance = new DeleteBucketInventoryConfigurationRequestMarshaller(); + + internal static DeleteBucketInventoryConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static DeleteBucketInventoryConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketInventoryConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketInventoryConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..516de60a49c4 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.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 DeleteBucketInventoryConfiguration operation + /// + public partial class DeleteBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + DeleteBucketInventoryConfigurationResponse response = new DeleteBucketInventoryConfigurationResponse(); + + 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, DeleteBucketInventoryConfigurationResponse response); + + private static DeleteBucketInventoryConfigurationResponseUnmarshaller _instance = new DeleteBucketInventoryConfigurationResponseUnmarshaller(); + + internal static DeleteBucketInventoryConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static DeleteBucketInventoryConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file From 061f71802cab7567980147a23ef24a43228b2f9d Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 26 Nov 2025 12:44:50 -0800 Subject: [PATCH 07/11] Generate PutBucketAcclerateConfiguration (#4158) * Generate PutBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4154, branch: peterrsongg/petesong/phase-3-pr4-3/1 * Generate GetBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4155, branch: peterrsongg/petesong/phase-3-pr4-3/2 * Generate ListBucketInventoryConfigurations stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4156, branch: peterrsongg/petesong/phase-3-pr4-3/3 * Geneate DeleteBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4157, branch: peterrsongg/petesong/phase-3-pr4-3/4 * Generate PutBucketAcclerateConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4158, branch: peterrsongg/petesong/phase-3-pr4-3/5 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 7 + ...ccelerateConfigurationRequestMarshaller.cs | 121 ---------------- ...lerateConfigurationResponseUnmarshaller.cs | 63 --------- .../Model/AccelerateConfiguration.cs | 29 ++-- ...ccelerateConfigurationRequestMarshaller.cs | 130 ++++++++++++++++++ ...lerateConfigurationResponseUnmarshaller.cs | 98 +++++++++++++ ...PutBucketAccelerateConfigurationRequest.cs | 105 ++++++++------ ...tBucketAccelerateConfigurationResponse.cs} | 13 +- 9 files changed, 325 insertions(+), 243 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/AccelerateConfiguration.cs (56%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/PutBucketAccelerateConfigurationRequest.cs (68%) rename sdk/src/Services/S3/{Custom/Model/PutBucketAccelerateConfiguarationResponse.cs => Generated/Model/PutBucketAccelerateConfigurationResponse.cs} (77%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 61b8e7ba4a0c..370b5c3ef39f 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -561,7 +561,7 @@ public List S3AllowListOperations 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"]), + new Operation(this, "PutBucketAccelerateConfiguration", DocumentRoot[OperationsKey]["PutBucketAccelerateConfiguration"]), //new Operation(this, "RestoreObject", DocumentRoot[OperationsKey]["RestoreObject"]), //new Operation(this, "SelectObjectContent", DocumentRoot[OperationsKey]["SelectObjectContent"]), new Operation(this, "PutBucketAnalyticsConfiguration" , DocumentRoot[OperationsKey]["PutBucketAnalyticsConfiguration"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 8d40ec042246..835a5bd6e3fc 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1173,6 +1173,13 @@ "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} } ] + }, + "PutBucketAccelerateConfigurationRequest":{ + "modify":[ + { + "ExpectedBucketOwner": {"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationRequestMarshaller.cs deleted file mode 100644 index 87841a1619f6..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationRequestMarshaller.cs +++ /dev/null @@ -1,121 +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.IO; -using System.Xml; -using System.Text; -using Amazon.S3.Util; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; -using System.Globalization; -using Amazon.Util; -using Amazon.Runtime.Internal.Util; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Put Object Acl Request Marshaller - /// - public class PutBucketAccelerateConfigurationRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((PutBucketAccelerateConfigurationRequest)input); - } - - public IRequest Marshall(PutBucketAccelerateConfigurationRequest putBucketAccelerateRequest) - { - IRequest request = new DefaultRequest(putBucketAccelerateRequest, "Amazon.S3"); - - request.HttpMethod = "PUT"; - - if (putBucketAccelerateRequest.IsSetChecksumAlgorithm()) - request.Headers.Add(S3Constants.AmzHeaderSdkChecksumAlgorithm, S3Transforms.ToStringValue(putBucketAccelerateRequest.ChecksumAlgorithm)); - - if (putBucketAccelerateRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(putBucketAccelerateRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(putBucketAccelerateRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "PutBucketAccelerateConfigurationRequest.BucketName"); - - request.ResourcePath = "/"; - - request.AddSubResource("accelerate"); - - var stringWriter = new XMLEncodedStringWriter(System.Globalization.CultureInfo.InvariantCulture); - using (var xmlWriter = XmlWriter.Create(stringWriter, - new XmlWriterSettings() - { - Encoding = Encoding.UTF8, - OmitXmlDeclaration = true, - NewLineHandling = NewLineHandling.Entitize - })) - { - var accelerateConfiguration = putBucketAccelerateRequest.AccelerateConfiguration; - if (accelerateConfiguration != null) - { - xmlWriter.WriteStartElement("AccelerateConfiguration", S3Constants.S3RequestXmlNamespace); - - var accelerateConfigurationStatus = accelerateConfiguration.Status; - if (accelerateConfiguration.IsSetBucketAccelerateStatus() && accelerateConfigurationStatus != null) - { - xmlWriter.WriteElementString("Status", S3Transforms.ToXmlStringValue(accelerateConfiguration.Status)); - } - xmlWriter.WriteEndElement(); - } - } - try - { - var content = stringWriter.ToString(); - request.Content = Encoding.UTF8.GetBytes(content); - request.Headers[HeaderKeys.ContentTypeHeader] = "application/xml"; - - ChecksumUtils.SetChecksumData( - request, - putBucketAccelerateRequest.ChecksumAlgorithm, - fallbackToMD5: false, - isRequestChecksumRequired: false, - headerName: S3Constants.AmzHeaderSdkChecksumAlgorithm - ); - } - catch (EncoderFallbackException e) - { - throw new AmazonServiceException("Unable to marshall request to XML", e); - } - return request; - } - - private static PutBucketAccelerateConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static PutBucketAccelerateConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketAccelerateConfigurationRequestMarshaller(); - } - return _instance; - } - } - } -} - diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationResponseUnmarshaller.cs deleted file mode 100644 index 9281864a5575..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,63 +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.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for PutBucketAccelerate operation - /// - public class PutBucketAccelerateConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - PutBucketAccelerateConfigurationResponse response = new PutBucketAccelerateConfigurationResponse(); - - - return response; - } - - private static PutBucketAccelerateConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static PutBucketAccelerateConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketAccelerateConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - - - } -} - diff --git a/sdk/src/Services/S3/Custom/Model/AccelerateConfiguration.cs b/sdk/src/Services/S3/Generated/Model/AccelerateConfiguration.cs similarity index 56% rename from sdk/src/Services/S3/Custom/Model/AccelerateConfiguration.cs rename to sdk/src/Services/S3/Generated/Model/AccelerateConfiguration.cs index b439f76d9228..26715545291f 100644 --- a/sdk/src/Services/S3/Custom/Model/AccelerateConfiguration.cs +++ b/sdk/src/Services/S3/Generated/Model/AccelerateConfiguration.cs @@ -12,38 +12,49 @@ * 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 { /// - /// Bucket accelerate configuration. + /// Configures the transfer acceleration state for an Amazon S3 bucket. For more information, + /// see Amazon + /// S3 Transfer Acceleration in the Amazon S3 User Guide. /// public partial class AccelerateConfiguration { - private BucketAccelerateStatus status; + private BucketAccelerateStatus _status; /// - /// The accelerate status of the bucket. + /// Gets and sets the property Status. + /// + /// Specifies the transfer acceleration status of the bucket. + /// /// public BucketAccelerateStatus Status { - get { return this.status; } - set { this.status = value; } + get { return this._status; } + set { this._status = value; } } // Check to see if Status property is set - internal bool IsSetBucketAccelerateStatus() + internal bool IsSetStatus() { - return this.status != null; + return this._status != null; } + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..941d2d8c4bac --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationRequestMarshaller.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.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 +{ + /// + /// PutBucketAccelerateConfiguration Request Marshaller + /// + public partial class PutBucketAccelerateConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((PutBucketAccelerateConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(PutBucketAccelerateConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "PUT"; + request.AddSubResource("accelerate"); + + if (publicRequest.IsSetChecksumAlgorithm()) + { + request.Headers["x-amz-sdk-checksum-algorithm"] = publicRequest.ChecksumAlgorithm; + } + + 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.", "PutBucketAccelerateConfigurationRequest.BucketName"); + request.ResourcePath = "/"; + var stringWriter = new XMLEncodedStringWriter(CultureInfo.InvariantCulture); + using (var xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings() { Encoding = System.Text.Encoding.UTF8, OmitXmlDeclaration = true, NewLineHandling = NewLineHandling.Entitize })) + { + if (publicRequest.IsSetAccelerateConfiguration()) + { + xmlWriter.WriteStartElement("AccelerateConfiguration", "http://s3.amazonaws.com/doc/2006-03-01/"); + if(publicRequest.AccelerateConfiguration.IsSetStatus()) + xmlWriter.WriteElementString("Status", StringUtils.FromString(publicRequest.AccelerateConfiguration.Status)); + + + xmlWriter.WriteEndElement(); + } + } + PostMarshallCustomization(request, publicRequest); + try + { + string content = stringWriter.ToString(); + request.Content = System.Text.Encoding.UTF8.GetBytes(content); + request.Headers["Content-Type"] = "application/xml"; + ChecksumUtils.SetChecksumData( + request, + publicRequest.ChecksumAlgorithm, + fallbackToMD5: false, + isRequestChecksumRequired: false, + headerName: "x-amz-sdk-checksum-algorithm" + ); + request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2006-03-01"; + } + catch (EncoderFallbackException e) + { + throw new AmazonServiceException("Unable to marshall request to XML", e); + } + return request; + } + private static PutBucketAccelerateConfigurationRequestMarshaller _instance = new PutBucketAccelerateConfigurationRequestMarshaller(); + + internal static PutBucketAccelerateConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketAccelerateConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketAccelerateConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, PutBucketAccelerateConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..bd583695b0f0 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketAccelerateConfigurationResponseUnmarshaller.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 PutBucketAccelerateConfiguration operation + /// + public partial class PutBucketAccelerateConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + PutBucketAccelerateConfigurationResponse response = new PutBucketAccelerateConfigurationResponse(); + + 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, PutBucketAccelerateConfigurationResponse response); + + private static PutBucketAccelerateConfigurationResponseUnmarshaller _instance = new PutBucketAccelerateConfigurationResponseUnmarshaller(); + + internal static PutBucketAccelerateConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketAccelerateConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketAccelerateConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/PutBucketAccelerateConfigurationRequest.cs similarity index 68% rename from sdk/src/Services/S3/Custom/Model/PutBucketAccelerateConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketAccelerateConfigurationRequest.cs index ddf9eebbdde3..137a66782946 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketAccelerateConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketAccelerateConfigurationRequest.cs @@ -12,22 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.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 PutBucketAccelerateConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -37,7 +43,7 @@ namespace Amazon.S3.Model /// /// /// - /// To use this operation, you must have permission to perform the s3:PutAccelerateConfiguration + /// To use this operation, you must have permission to perform the s3:PutAccelerateConfiguration /// action. The bucket owner has this permission by default. The bucket owner can grant /// this permission to others. For more information about permissions, see Permissions /// Related to Bucket Subresource Operations and Managing @@ -50,11 +56,11 @@ namespace Amazon.S3.Model /// ///
  • /// - /// Enabled � Enables accelerated data transfers to the bucket. + /// Enabled – Enables accelerated data transfers to the bucket. /// ///
  • /// - /// Suspended � Disables accelerated data transfers to the bucket. + /// Suspended – Disables accelerated data transfers to the bucket. /// ///
/// @@ -78,7 +84,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following operations are related to PutBucketAccelerateConfiguration: + /// The following operations are related to PutBucketAccelerateConfiguration: /// ///
+ /// + /// + /// 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 PutBucketAccelerateConfigurationRequest : AmazonWebServiceRequest { - private string bucketName; + private AccelerateConfiguration _accelerateConfiguration; + private string _bucketName; private ChecksumAlgorithm _checksumAlgorithm; - private AccelerateConfiguration accelerateConfiguration; - private string expectedBucketOwner; + private string _expectedBucketOwner; /// - /// The name of the bucket for which the accelerate configuration is set. + /// Gets and sets the property AccelerateConfiguration. + /// + /// Container for setting the transfer acceleration state. + /// /// + [AWSProperty(Required=true)] + public AccelerateConfiguration AccelerateConfiguration + { + get { return this._accelerateConfiguration; } + set { this._accelerateConfiguration = value; } + } + + // Check to see if AccelerateConfiguration property is set + internal bool IsSetAccelerateConfiguration() + { + return this._accelerateConfiguration != null; + } + + /// + /// Gets and sets the property BucketName. + /// + /// The name of the bucket for which the accelerate configuration is set. + /// + /// + [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 Bucket property is set + // Check to see if BucketName property is set internal bool IsSetBucketName() { - return this.BucketName != null; + return this._bucketName != null; } /// /// Gets and sets the property ChecksumAlgorithm. /// - /// Indicates the algorithm used to create the checksum for the object when you use the + /// Indicates the algorithm used to create the checksum for the request when you use the /// SDK. This header will not provide any additional functionality if you don't use the - /// SDK. When you send this header, there must be a corresponding x-amz-checksum - /// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request - /// with the HTTP status code 400 Bad Request. For more information, see - /// Checking + /// SDK. When you send this header, there must be a corresponding x-amz-checksum + /// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the + /// HTTP status code 400 Bad Request. For more information, see Checking /// object integrity in the Amazon S3 User Guide. /// /// /// - /// If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm + /// If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm /// parameter. /// /// @@ -143,44 +177,25 @@ internal bool IsSetChecksumAlgorithm() return this._checksumAlgorithm != null; } - /// - /// Accelerate configuration for the bucket. - /// - public AccelerateConfiguration AccelerateConfiguration - { - get { return this.accelerateConfiguration; } - set { this.accelerateConfiguration = value; } - } - - // Check to see if AccelerateConfiguration property is set - internal bool IsSetAccelerateConfiguration() - { - return this.AccelerateConfiguration != null; - } - /// /// Gets and sets the property ExpectedBucketOwner. /// /// The account ID of the expected bucket owner. If the account ID that you provide does /// not match the actual owner of the bucket, the request fails with the HTTP status code - /// 403 Forbidden (access denied). + /// 403 Forbidden (access denied). /// /// public string ExpectedBucketOwner { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. + // Check to see if ExpectedBucketOwner property is set internal bool IsSetExpectedBucketOwner() { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + return !String.IsNullOrEmpty(this._expectedBucketOwner); } } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketAccelerateConfiguarationResponse.cs b/sdk/src/Services/S3/Generated/Model/PutBucketAccelerateConfigurationResponse.cs similarity index 77% rename from sdk/src/Services/S3/Custom/Model/PutBucketAccelerateConfiguarationResponse.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketAccelerateConfigurationResponse.cs index ddeb1e8a73fe..35b8423cc2f5 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketAccelerateConfiguarationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketAccelerateConfigurationResponse.cs @@ -12,23 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.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 response for the PutBucketAccelerateConfiguration operation. - /// Adds an object to a bucket. + /// This is the response object from the PutBucketAccelerateConfiguration operation. /// public partial class PutBucketAccelerateConfigurationResponse : AmazonWebServiceResponse { + } -} - +} \ No newline at end of file From 76a5c9fb18c2b51f0f1551e3e1cc8dbb4cd4dab6 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 26 Nov 2025 13:00:16 -0800 Subject: [PATCH 08/11] Generate PutBucketRequestPayment (#4159) * Generate PutBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4154, branch: peterrsongg/petesong/phase-3-pr4-3/1 * Generate GetBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4155, branch: peterrsongg/petesong/phase-3-pr4-3/2 * Generate ListBucketInventoryConfigurations stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4156, branch: peterrsongg/petesong/phase-3-pr4-3/3 * Geneate DeleteBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4157, branch: peterrsongg/petesong/phase-3-pr4-3/4 * Generate PutBucketAcclerateConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4158, branch: peterrsongg/petesong/phase-3-pr4-3/5 * Generate PutBucketRequestPayment stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4159, branch: peterrsongg/petesong/phase-3-pr4-3/6 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 1 + .../ServiceModels/s3/s3.customizations.json | 7 + ...utBucketRequestPaymentRequestMarshaller.cs | 115 --------------- ...ucketRequestPaymentResponseUnmarshaller.cs | 61 -------- ...utBucketRequestPaymentRequestMarshaller.cs | 135 ++++++++++++++++++ ...ucketRequestPaymentResponseUnmarshaller.cs | 98 +++++++++++++ .../Model/PutBucketRequestPaymentRequest.cs | 109 +++++++++----- .../Model/PutBucketRequestPaymentResponse.cs | 15 +- .../Model/RequestPaymentConfiguration.cs | 31 ++-- 9 files changed, 350 insertions(+), 222 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestPaymentRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestPaymentResponseUnmarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketRequestPaymentRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketRequestPaymentResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/PutBucketRequestPaymentRequest.cs (55%) rename sdk/src/Services/S3/{Custom => Generated}/Model/PutBucketRequestPaymentResponse.cs (74%) rename sdk/src/Services/S3/{Custom => Generated}/Model/RequestPaymentConfiguration.cs (62%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 370b5c3ef39f..6485dc260992 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -572,6 +572,7 @@ public List S3AllowListOperations new Operation(this, "DeleteBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketAnalyticsConfiguration"]), new Operation(this, "DeleteBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["DeleteBucketIntelligentTieringConfiguration"]), new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), + new Operation(this,"PutBucketRequestPayment", DocumentRoot[OperationsKey]["PutBucketRequestPayment"]) }; } diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 835a5bd6e3fc..7e9fc6818404 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1180,6 +1180,13 @@ "ExpectedBucketOwner": {"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} } ] + }, + "PutBucketRequestPaymentRequest":{ + "modify":[ + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestPaymentRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestPaymentRequestMarshaller.cs deleted file mode 100644 index a8b49d35496f..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestPaymentRequestMarshaller.cs +++ /dev/null @@ -1,115 +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.IO; -using System.Xml; -using System.Text; -using Amazon.S3.Util; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.Util; -using Amazon.Runtime.Internal.Util; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Put Bucket Request Payment Request Marshaller - /// - public class PutBucketRequestPaymentRequestMarshaller : IMarshaller ,IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((PutBucketRequestPaymentRequest)input); - } - - public IRequest Marshall(PutBucketRequestPaymentRequest putBucketRequestPaymentRequest) - { - IRequest request = new DefaultRequest(putBucketRequestPaymentRequest, "Amazon.S3"); - - request.HttpMethod = "PUT"; - - if (putBucketRequestPaymentRequest.IsSetChecksumAlgorithm()) - request.Headers.Add(S3Constants.AmzHeaderSdkChecksumAlgorithm, S3Transforms.ToStringValue(putBucketRequestPaymentRequest.ChecksumAlgorithm)); - - if (putBucketRequestPaymentRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(putBucketRequestPaymentRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(putBucketRequestPaymentRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "PutBucketRequestPaymentRequest.BucketName"); - - request.ResourcePath = "/"; - - request.AddSubResource("requestPayment"); - - var stringWriter = new XMLEncodedStringWriter(System.Globalization.CultureInfo.InvariantCulture); - using (var xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings() { Encoding = Encoding.UTF8, OmitXmlDeclaration = true, NewLineHandling = NewLineHandling.Entitize })) - { - var requestPaymentConfigurationRequestPaymentConfiguration = putBucketRequestPaymentRequest.RequestPaymentConfiguration; - if (requestPaymentConfigurationRequestPaymentConfiguration != null) - { - xmlWriter.WriteStartElement("RequestPaymentConfiguration", S3Constants.S3RequestXmlNamespace); - - if (requestPaymentConfigurationRequestPaymentConfiguration.IsSetPayer()) - { - xmlWriter.WriteElementString("Payer", S3Transforms.ToXmlStringValue(requestPaymentConfigurationRequestPaymentConfiguration.Payer)); - } - xmlWriter.WriteEndElement(); - } - } - - try - { - var content = stringWriter.ToString(); - request.Content = Encoding.UTF8.GetBytes(content); - request.Headers[HeaderKeys.ContentTypeHeader] = "application/xml"; - - ChecksumUtils.SetChecksumData( - request, - putBucketRequestPaymentRequest.ChecksumAlgorithm, - fallbackToMD5: false, - isRequestChecksumRequired: true, - headerName: S3Constants.AmzHeaderSdkChecksumAlgorithm - ); - } - catch (EncoderFallbackException e) - { - throw new AmazonServiceException("Unable to marshall request to XML", e); - } - - return request; - } - - private static PutBucketRequestPaymentRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static PutBucketRequestPaymentRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketRequestPaymentRequestMarshaller(); - } - return _instance; - } - } - } -} - diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestPaymentResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestPaymentResponseUnmarshaller.cs deleted file mode 100644 index 8302d3e00c15..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketRequestPaymentResponseUnmarshaller.cs +++ /dev/null @@ -1,61 +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.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for PutBucketRequestPayment operation - /// - public class PutBucketRequestPaymentResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - PutBucketRequestPaymentResponse response = new PutBucketRequestPaymentResponse(); - - - return response; - } - - private static PutBucketRequestPaymentResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static PutBucketRequestPaymentResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new PutBucketRequestPaymentResponseUnmarshaller(); - } - return _instance; - } - } - } -} - diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketRequestPaymentRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketRequestPaymentRequestMarshaller.cs new file mode 100644 index 000000000000..5bf510f56ff7 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketRequestPaymentRequestMarshaller.cs @@ -0,0 +1,135 @@ +/* + * 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 +{ + /// + /// PutBucketRequestPayment Request Marshaller + /// + public partial class PutBucketRequestPaymentRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((PutBucketRequestPaymentRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(PutBucketRequestPaymentRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "PUT"; + request.AddSubResource("requestPayment"); + + if (publicRequest.IsSetChecksumAlgorithm()) + { + request.Headers["x-amz-sdk-checksum-algorithm"] = publicRequest.ChecksumAlgorithm; + } + + if (publicRequest.IsSetContentMD5()) + { + request.Headers["Content-MD5"] = publicRequest.ContentMD5; + } + + if (publicRequest.IsSetExpectedBucketOwner()) + { + request.Headers["x-amz-expected-bucket-owner"] = publicRequest.ExpectedBucketOwner; + } + if (string.IsNullOrEmpty(publicRequest.BucketName)) + throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "PutBucketRequestPaymentRequest.BucketName"); + request.ResourcePath = "/"; + var stringWriter = new XMLEncodedStringWriter(CultureInfo.InvariantCulture); + using (var xmlWriter = XmlWriter.Create(stringWriter, new XmlWriterSettings() { Encoding = System.Text.Encoding.UTF8, OmitXmlDeclaration = true, NewLineHandling = NewLineHandling.Entitize })) + { + if (publicRequest.IsSetRequestPaymentConfiguration()) + { + xmlWriter.WriteStartElement("RequestPaymentConfiguration", "http://s3.amazonaws.com/doc/2006-03-01/"); + if(publicRequest.RequestPaymentConfiguration.IsSetPayer()) + xmlWriter.WriteElementString("Payer", StringUtils.FromString(publicRequest.RequestPaymentConfiguration.Payer)); + + + xmlWriter.WriteEndElement(); + } + } + PostMarshallCustomization(request, publicRequest); + try + { + string content = stringWriter.ToString(); + request.Content = System.Text.Encoding.UTF8.GetBytes(content); + request.Headers["Content-Type"] = "application/xml"; + ChecksumUtils.SetChecksumData( + request, + publicRequest.ChecksumAlgorithm, + fallbackToMD5: false, + isRequestChecksumRequired: true, + headerName: "x-amz-sdk-checksum-algorithm" + ); + request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2006-03-01"; + } + catch (EncoderFallbackException e) + { + throw new AmazonServiceException("Unable to marshall request to XML", e); + } + return request; + } + private static PutBucketRequestPaymentRequestMarshaller _instance = new PutBucketRequestPaymentRequestMarshaller(); + + internal static PutBucketRequestPaymentRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketRequestPaymentRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, PutBucketRequestPaymentRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, PutBucketRequestPaymentRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketRequestPaymentResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketRequestPaymentResponseUnmarshaller.cs new file mode 100644 index 000000000000..aae496f88a50 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PutBucketRequestPaymentResponseUnmarshaller.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 PutBucketRequestPayment operation + /// + public partial class PutBucketRequestPaymentResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + PutBucketRequestPaymentResponse response = new PutBucketRequestPaymentResponse(); + + 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, PutBucketRequestPaymentResponse response); + + private static PutBucketRequestPaymentResponseUnmarshaller _instance = new PutBucketRequestPaymentResponseUnmarshaller(); + + internal static PutBucketRequestPaymentResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static PutBucketRequestPaymentResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketRequestPaymentRequest.cs b/sdk/src/Services/S3/Generated/Model/PutBucketRequestPaymentRequest.cs similarity index 55% rename from sdk/src/Services/S3/Custom/Model/PutBucketRequestPaymentRequest.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketRequestPaymentRequest.cs index c453c693cc7b..c0d1a3981b99 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketRequestPaymentRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketRequestPaymentRequest.cs @@ -12,22 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.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 PutBucketRequestPayment operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -39,7 +45,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following operations are related to PutBucketRequestPayment: + /// The following operations are related to PutBucketRequestPayment: /// /// + /// + /// + /// 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 PutBucketRequestPaymentRequest : AmazonWebServiceRequest { - private string bucketName; + private string _bucketName; private ChecksumAlgorithm _checksumAlgorithm; - private RequestPaymentConfiguration requestPaymentConfiguration; - private string expectedBucketOwner; + private string _contentMD5; + private string _expectedBucketOwner; + private RequestPaymentConfiguration _requestPaymentConfiguration; /// - /// The name of the bucket to set payment config. + /// Gets and sets the property BucketName. + /// + /// The bucket name. + /// /// + [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 Bucket property is set + // Check to see if BucketName property is set internal bool IsSetBucketName() { - return this.bucketName != null; + return this._bucketName != null; } /// /// Gets and sets the property ChecksumAlgorithm. /// - /// Indicates the algorithm used to create the checksum for the object when you use the + /// Indicates the algorithm used to create the checksum for the request when you use the /// SDK. This header will not provide any additional functionality if you don't use the - /// SDK. When you send this header, there must be a corresponding x-amz-checksum - /// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request - /// with the HTTP status code 400 Bad Request. For more information, see - /// Checking + /// SDK. When you send this header, there must be a corresponding x-amz-checksum + /// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the + /// HTTP status code 400 Bad Request. For more information, see Checking /// object integrity in the Amazon S3 User Guide. /// /// /// - /// If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm + /// If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm /// parameter. /// /// @@ -105,18 +121,29 @@ internal bool IsSetChecksumAlgorithm() } /// - /// Gets and sets request payment configuration + /// Gets and sets the property ContentMD5. + /// + /// The Base64 encoded 128-bit MD5 digest of the data. You must use this header + /// as a message integrity check to verify that the request body was not corrupted in + /// transit. For more information, see RFC + /// 1864. + /// + /// + /// + /// For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon + /// Web Services SDKs, this field is calculated automatically. + /// /// - public RequestPaymentConfiguration RequestPaymentConfiguration + public string ContentMD5 { - get { return this.requestPaymentConfiguration; } - set { this.requestPaymentConfiguration = value; } + get { return this._contentMD5; } + set { this._contentMD5 = value; } } - // Check to see if RequestPaymentConfiguration property is set - internal bool IsSetRequestPaymentConfiguration() + // Check to see if ContentMD5 property is set + internal bool IsSetContentMD5() { - return this.requestPaymentConfiguration != null; + return this._contentMD5 != null; } /// @@ -124,23 +151,39 @@ internal bool IsSetRequestPaymentConfiguration() /// /// 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). + /// 403 Forbidden (access denied). /// /// 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 !String.IsNullOrEmpty(this._expectedBucketOwner); } /// - /// Checks to see if ExpectedBucketOwner is set. + /// Gets and sets the property RequestPaymentConfiguration. + /// + /// Container for Payer. + /// /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() + [AWSProperty(Required=true)] + public RequestPaymentConfiguration RequestPaymentConfiguration { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + get { return this._requestPaymentConfiguration; } + set { this._requestPaymentConfiguration = value; } } + + // Check to see if RequestPaymentConfiguration property is set + internal bool IsSetRequestPaymentConfiguration() + { + return this._requestPaymentConfiguration != null; + } + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/PutBucketRequestPaymentResponse.cs b/sdk/src/Services/S3/Generated/Model/PutBucketRequestPaymentResponse.cs similarity index 74% rename from sdk/src/Services/S3/Custom/Model/PutBucketRequestPaymentResponse.cs rename to sdk/src/Services/S3/Generated/Model/PutBucketRequestPaymentResponse.cs index 2cb3dbf52d59..21dc09397d7a 100644 --- a/sdk/src/Services/S3/Custom/Model/PutBucketRequestPaymentResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/PutBucketRequestPaymentResponse.cs @@ -12,21 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// Returns information about the PutBucketRequestPayment response metadata. - /// The PutBucketRequestPayment operation has a void result type. + /// This is the response object from the PutBucketRequestPayment operation. /// public partial class PutBucketRequestPaymentResponse : AmazonWebServiceResponse { + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/RequestPaymentConfiguration.cs b/sdk/src/Services/S3/Generated/Model/RequestPaymentConfiguration.cs similarity index 62% rename from sdk/src/Services/S3/Custom/Model/RequestPaymentConfiguration.cs rename to sdk/src/Services/S3/Generated/Model/RequestPaymentConfiguration.cs index 380eb6758c32..6282668da465 100644 --- a/sdk/src/Services/S3/Custom/Model/RequestPaymentConfiguration.cs +++ b/sdk/src/Services/S3/Generated/Model/RequestPaymentConfiguration.cs @@ -12,35 +12,48 @@ * 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 { /// - /// Request Payment Configuration + /// Container for Payer. /// - public class RequestPaymentConfiguration + public partial class RequestPaymentConfiguration { - - private string payer; + private String _payer; /// + /// Gets and sets the property Payer. + /// /// Specifies who pays for the download and request fees. + /// /// - public string Payer + [AWSProperty(Required=true)] + public String Payer { - get { return this.payer; } - set { this.payer = value; } + get { return this._payer; } + set { this._payer = value; } } // Check to see if Payer property is set internal bool IsSetPayer() { - return this.payer != null; + return this._payer != null; } + } -} +} \ No newline at end of file From c039734563e2aabc525d7b79cf856a4d9536bae8 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 26 Nov 2025 13:16:46 -0800 Subject: [PATCH 09/11] Generate CreateBucketMetadataTableConfiguration (#4160) * Geneate DeleteBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4157, branch: peterrsongg/petesong/phase-3-pr4-3/4 * Generate PutBucketAcclerateConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4158, branch: peterrsongg/petesong/phase-3-pr4-3/5 * Generate PutBucketRequestPayment stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4159, branch: peterrsongg/petesong/phase-3-pr4-3/6 * Generate CreateBucketMetadataTableConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4160, branch: peterrsongg/petesong/phase-3-pr4-3/7 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 6 +- .../ServiceModels/s3/s3.customizations.json | 20 ++ ...reateBucketMetadataConfigurationRequest.cs | 102 -------- .../MetadataTableEncryptionConfiguration.cs | 68 ----- ...reateBucketMetadataConfigurationRequest.cs | 237 ++++++++++++++++++ ...eateBucketMetadataConfigurationResponse.cs | 0 ...tMetadataConfigurationRequestMarshaller.cs | 34 +-- ...tadataConfigurationResponseUnmarshaller.cs | 13 +- .../Model/InventoryTableConfiguration.cs | 3 +- .../Model/JournalTableConfiguration.cs | 0 .../Model/MetadataConfiguration.cs | 0 .../MetadataTableEncryptionConfiguration.cs | 84 +++++++ .../Model/RecordExpiration.cs | 7 +- 13 files changed, 374 insertions(+), 200 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/CreateBucketMetadataConfigurationRequest.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/MetadataTableEncryptionConfiguration.cs create mode 100644 sdk/src/Services/S3/Generated/Model/CreateBucketMetadataConfigurationRequest.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/CreateBucketMetadataConfigurationResponse.cs (100%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationRequestMarshaller.cs (90%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationResponseUnmarshaller.cs (82%) rename sdk/src/Services/S3/{Custom => Generated}/Model/InventoryTableConfiguration.cs (97%) rename sdk/src/Services/S3/{Custom => Generated}/Model/JournalTableConfiguration.cs (100%) rename sdk/src/Services/S3/{Custom => Generated}/Model/MetadataConfiguration.cs (100%) create mode 100644 sdk/src/Services/S3/Generated/Model/MetadataTableEncryptionConfiguration.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/RecordExpiration.cs (95%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 6485dc260992..e077511bab60 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -572,7 +572,8 @@ public List S3AllowListOperations new Operation(this, "DeleteBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketAnalyticsConfiguration"]), new Operation(this, "DeleteBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["DeleteBucketIntelligentTieringConfiguration"]), new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), - new Operation(this,"PutBucketRequestPayment", DocumentRoot[OperationsKey]["PutBucketRequestPayment"]) + new Operation(this,"PutBucketRequestPayment", DocumentRoot[OperationsKey]["PutBucketRequestPayment"]), + new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"]) }; } @@ -602,7 +603,8 @@ public List S3RequestMarshallerThrowGenericExceptionList "GetBucketAcl", "PutObjectAcl", "GetObjectAcl", - "PutBucketAcl" + "PutBucketAcl", + "CreateBucketMetadataConfiguration" }; } return _s3RequestMarshallerThrowAmazonS3ExceptionList; diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 7e9fc6818404..0acc7070cf86 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1187,6 +1187,26 @@ "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} } ] + }, + "CreateBucketMetadataConfigurationRequest":{ + "modify":[ + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + }, + { + "ContentMD5":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._contentMD5);"]} + }, + { + "BucketName":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._bucketName);"]} + } + ] + }, + "MetadataTableEncryptionConfiguration":{ + "modify":[ + { + "KmsKeyArn":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._kmsKeyArn);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/CreateBucketMetadataConfigurationRequest.cs b/sdk/src/Services/S3/Custom/Model/CreateBucketMetadataConfigurationRequest.cs deleted file mode 100644 index 18a74a0e6333..000000000000 --- a/sdk/src/Services/S3/Custom/Model/CreateBucketMetadataConfigurationRequest.cs +++ /dev/null @@ -1,102 +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 Amazon.Runtime; - -namespace Amazon.S3.Model -{ - /// - /// Container for the parameters to the CreateBucketMetadataConfiguration operation. - /// - public partial class CreateBucketMetadataConfigurationRequest : AmazonWebServiceRequest - { - private string bucketName; - private ChecksumAlgorithm checksumAlgorithm; - private string contentMD5; - private string expectedBucketOwner; - private MetadataConfiguration metadataConfiguration; - - /// - /// Gets and sets the property BucketName. - /// - public string BucketName - { - get { return this.bucketName; } - set { this.bucketName = value; } - } - - internal bool IsSetBucketName() - { - return !String.IsNullOrEmpty(this.bucketName); - } - - /// - /// Gets and sets the property ChecksumAlgorithm. - /// - public ChecksumAlgorithm ChecksumAlgorithm - { - get { return this.checksumAlgorithm; } - set { this.checksumAlgorithm = value; } - } - - internal bool IsSetChecksumAlgorithm() - { - return this.checksumAlgorithm != null; - } - - /// - /// Gets and sets the property ContentMD5. - /// - public string ContentMD5 - { - get { return this.contentMD5; } - set { this.contentMD5 = value; } - } - - internal bool IsSetContentMD5() - { - return !String.IsNullOrEmpty(this.contentMD5); - } - - /// - /// Gets and sets the property ExpectedBucketOwner. - /// - public string ExpectedBucketOwner - { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } - } - - internal bool IsSetExpectedBucketOwner() - { - return !String.IsNullOrEmpty(this.expectedBucketOwner); - } - - /// - /// Gets and sets the property MetadataConfiguration. - /// - public MetadataConfiguration MetadataConfiguration - { - get { return this.metadataConfiguration; } - set { this.metadataConfiguration = value; } - } - - internal bool IsSetMetadataConfiguration() - { - return this.metadataConfiguration != null; - } - - } -} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/MetadataTableEncryptionConfiguration.cs b/sdk/src/Services/S3/Custom/Model/MetadataTableEncryptionConfiguration.cs deleted file mode 100644 index 4ccb5dace110..000000000000 --- a/sdk/src/Services/S3/Custom/Model/MetadataTableEncryptionConfiguration.cs +++ /dev/null @@ -1,68 +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.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 -{ - /// - /// - /// - public partial class MetadataTableEncryptionConfiguration - { - private string kmsKeyArn; - private TableSseAlgorithm sseAlgorithm; - - /// - /// Gets and sets the property KmsKeyArn. - /// - public string KmsKeyArn - { - get { return this.kmsKeyArn; } - set { this.kmsKeyArn = value; } - } - - // Check to see if KmsKeyArn property is set - internal bool IsSetKmsKeyArn() - { - return !String.IsNullOrEmpty(this.kmsKeyArn); - } - - /// - /// Gets and sets the property SseAlgorithm. - /// - public TableSseAlgorithm SseAlgorithm - { - get { return this.sseAlgorithm; } - set { this.sseAlgorithm = value; } - } - - // Check to see if SseAlgorithm property is set - internal bool IsSetSseAlgorithm() - { - return this.sseAlgorithm != null; - } - - } -} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/CreateBucketMetadataConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/CreateBucketMetadataConfigurationRequest.cs new file mode 100644 index 000000000000..9ae9a2c50250 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/CreateBucketMetadataConfigurationRequest.cs @@ -0,0 +1,237 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Container for the parameters to the CreateBucketMetadataConfiguration operation. + /// Creates an S3 Metadata V2 metadata configuration for a general purpose bucket. For + /// more information, see Accelerating + /// data discovery with S3 Metadata in the Amazon S3 User Guide. + /// + ///
Permissions
+ /// + /// To use this operation, you must have the following permissions. For more information, + /// see Setting + /// up permissions for configuring metadata tables in the Amazon S3 User Guide. + /// + /// + /// + /// If you want to encrypt your metadata tables with server-side encryption with Key Management + /// Service (KMS) keys (SSE-KMS), you need additional permissions in your KMS key policy. + /// For more information, see + /// Setting up permissions for configuring metadata tables in the Amazon S3 User + /// Guide. + /// + /// + /// + /// If you also want to integrate your table bucket with Amazon Web Services analytics + /// services so that you can query your metadata table, you need additional permissions. + /// For more information, see + /// Integrating Amazon S3 Tables with Amazon Web Services analytics services in the + /// Amazon S3 User Guide. + /// + /// + /// + /// To query your metadata tables, you need additional permissions. For more information, + /// see + /// Permissions for querying metadata tables in the Amazon S3 User Guide. + /// + ///
  • + /// + /// s3:CreateBucketMetadataTableConfiguration + /// + /// + /// + /// The IAM policy action name is the same for the V1 and V2 API operations. + /// + ///
  • + /// + /// s3tables:CreateTableBucket + /// + ///
  • + /// + /// s3tables:CreateNamespace + /// + ///
  • + /// + /// s3tables:GetTable + /// + ///
  • + /// + /// s3tables:CreateTable + /// + ///
  • + /// + /// s3tables:PutTablePolicy + /// + ///
  • + /// + /// s3tables:PutTableEncryption + /// + ///
  • + /// + /// kms:DescribeKey + /// + ///
+ /// + /// The following operations are related to CreateBucketMetadataConfiguration: + /// + /// + /// + /// 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 CreateBucketMetadataConfigurationRequest : AmazonWebServiceRequest + { + private string _bucketName; + private ChecksumAlgorithm _checksumAlgorithm; + private string _contentMD5; + private string _expectedBucketOwner; + private MetadataConfiguration _metadataConfiguration; + + /// + /// Gets and sets the property BucketName. + /// + /// The general purpose bucket that you want to create the metadata configuration for. + /// + /// + /// + [AWSProperty(Required=true)] + public string BucketName + { + get { return this._bucketName; } + set { this._bucketName = value; } + } + + // Check to see if BucketName property is set + internal bool IsSetBucketName() + { + return !String.IsNullOrEmpty(this._bucketName); + } + + /// + /// Gets and sets the property ChecksumAlgorithm. + /// + /// The checksum algorithm to use with your metadata configuration. + /// + /// + public ChecksumAlgorithm ChecksumAlgorithm + { + get { return this._checksumAlgorithm; } + set { this._checksumAlgorithm = value; } + } + + // Check to see if ChecksumAlgorithm property is set + internal bool IsSetChecksumAlgorithm() + { + return this._checksumAlgorithm != null; + } + + /// + /// Gets and sets the property ContentMD5. + /// + /// The Content-MD5 header for the metadata configuration. + /// + /// + public string ContentMD5 + { + get { return this._contentMD5; } + set { this._contentMD5 = value; } + } + + // Check to see if ContentMD5 property is set + internal bool IsSetContentMD5() + { + return !String.IsNullOrEmpty(this._contentMD5); + } + + /// + /// Gets and sets the property ExpectedBucketOwner. + /// + /// The expected owner of the general purpose bucket that corresponds to your metadata + /// configuration. + /// + /// + public string ExpectedBucketOwner + { + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } + } + + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() + { + return !String.IsNullOrEmpty(this._expectedBucketOwner); + } + + /// + /// Gets and sets the property MetadataConfiguration. + /// + /// The contents of your metadata configuration. + /// + /// + [AWSProperty(Required=true)] + public MetadataConfiguration MetadataConfiguration + { + get { return this._metadataConfiguration; } + set { this._metadataConfiguration = value; } + } + + // Check to see if MetadataConfiguration property is set + internal bool IsSetMetadataConfiguration() + { + return this._metadataConfiguration != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/CreateBucketMetadataConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/CreateBucketMetadataConfigurationResponse.cs similarity index 100% rename from sdk/src/Services/S3/Custom/Model/CreateBucketMetadataConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/CreateBucketMetadataConfigurationResponse.cs diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationRequestMarshaller.cs similarity index 90% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationRequestMarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationRequestMarshaller.cs index b240dd04b7b6..29fa48b163dc 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationRequestMarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// CreateBucketMetadataConfiguration Request Marshaller /// - public class CreateBucketMetadataConfigurationRequestMarshaller : IMarshaller , IMarshaller + public partial class CreateBucketMetadataConfigurationRequestMarshaller : IMarshaller , IMarshaller { /// /// Marshaller the request object to the HTTP request. @@ -56,6 +56,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) public IRequest Marshall(CreateBucketMetadataConfigurationRequest publicRequest) { var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); request.HttpMethod = "POST"; request.AddSubResource("metadataConfiguration"); @@ -75,9 +76,7 @@ public IRequest Marshall(CreateBucketMetadataConfigurationRequest publicRequest) } if (!publicRequest.IsSetBucketName()) throw new AmazonS3Exception("Request object does not have required field BucketName set"); - request.AddPathResource("{Bucket}", StringUtils.FromString(publicRequest.BucketName)); - request.ResourcePath = "/{Bucket}"; - + 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 })) { @@ -88,17 +87,14 @@ public IRequest Marshall(CreateBucketMetadataConfigurationRequest publicRequest) { xmlWriter.WriteStartElement("InventoryTableConfiguration"); if(publicRequest.MetadataConfiguration.InventoryTableConfiguration.IsSetConfigurationState()) - xmlWriter.WriteElementString("ConfigurationState", StringUtils.FromString(publicRequest.MetadataConfiguration.InventoryTableConfiguration.ConfigurationState)); - + xmlWriter.WriteElementString("ConfigurationState", StringUtils.FromString(publicRequest.MetadataConfiguration.InventoryTableConfiguration.ConfigurationState)); if (publicRequest.MetadataConfiguration.InventoryTableConfiguration.EncryptionConfiguration != null) { xmlWriter.WriteStartElement("EncryptionConfiguration"); if(publicRequest.MetadataConfiguration.InventoryTableConfiguration.EncryptionConfiguration.IsSetKmsKeyArn()) - xmlWriter.WriteElementString("KmsKeyArn", StringUtils.FromString(publicRequest.MetadataConfiguration.InventoryTableConfiguration.EncryptionConfiguration.KmsKeyArn)); - + xmlWriter.WriteElementString("KmsKeyArn", StringUtils.FromString(publicRequest.MetadataConfiguration.InventoryTableConfiguration.EncryptionConfiguration.KmsKeyArn)); if(publicRequest.MetadataConfiguration.InventoryTableConfiguration.EncryptionConfiguration.IsSetSseAlgorithm()) - xmlWriter.WriteElementString("SseAlgorithm", StringUtils.FromString(publicRequest.MetadataConfiguration.InventoryTableConfiguration.EncryptionConfiguration.SseAlgorithm)); - + xmlWriter.WriteElementString("SseAlgorithm", StringUtils.FromString(publicRequest.MetadataConfiguration.InventoryTableConfiguration.EncryptionConfiguration.SseAlgorithm)); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); @@ -110,22 +106,18 @@ public IRequest Marshall(CreateBucketMetadataConfigurationRequest publicRequest) { xmlWriter.WriteStartElement("EncryptionConfiguration"); if(publicRequest.MetadataConfiguration.JournalTableConfiguration.EncryptionConfiguration.IsSetKmsKeyArn()) - xmlWriter.WriteElementString("KmsKeyArn", StringUtils.FromString(publicRequest.MetadataConfiguration.JournalTableConfiguration.EncryptionConfiguration.KmsKeyArn)); - + xmlWriter.WriteElementString("KmsKeyArn", StringUtils.FromString(publicRequest.MetadataConfiguration.JournalTableConfiguration.EncryptionConfiguration.KmsKeyArn)); if(publicRequest.MetadataConfiguration.JournalTableConfiguration.EncryptionConfiguration.IsSetSseAlgorithm()) - xmlWriter.WriteElementString("SseAlgorithm", StringUtils.FromString(publicRequest.MetadataConfiguration.JournalTableConfiguration.EncryptionConfiguration.SseAlgorithm)); - + xmlWriter.WriteElementString("SseAlgorithm", StringUtils.FromString(publicRequest.MetadataConfiguration.JournalTableConfiguration.EncryptionConfiguration.SseAlgorithm)); xmlWriter.WriteEndElement(); } if (publicRequest.MetadataConfiguration.JournalTableConfiguration.RecordExpiration != null) { xmlWriter.WriteStartElement("RecordExpiration"); if(publicRequest.MetadataConfiguration.JournalTableConfiguration.RecordExpiration.IsSetDays()) - xmlWriter.WriteElementString("Days", StringUtils.FromInt(publicRequest.MetadataConfiguration.JournalTableConfiguration.RecordExpiration.Days)); - + xmlWriter.WriteElementString("Days", StringUtils.FromInt(publicRequest.MetadataConfiguration.JournalTableConfiguration.RecordExpiration.Days.Value)); if(publicRequest.MetadataConfiguration.JournalTableConfiguration.RecordExpiration.IsSetExpiration()) - xmlWriter.WriteElementString("Expiration", StringUtils.FromString(publicRequest.MetadataConfiguration.JournalTableConfiguration.RecordExpiration.Expiration)); - + xmlWriter.WriteElementString("Expiration", StringUtils.FromString(publicRequest.MetadataConfiguration.JournalTableConfiguration.RecordExpiration.Expiration)); xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); @@ -134,13 +126,12 @@ public IRequest Marshall(CreateBucketMetadataConfigurationRequest publicRequest) xmlWriter.WriteEndElement(); } } + PostMarshallCustomization(request, publicRequest); try { string content = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(content); request.Headers["Content-Type"] = "application/xml"; - if (publicRequest.IsSetContentMD5()) - request.Headers[Amazon.Util.HeaderKeys.ContentMD5Header] = publicRequest.ContentMD5; ChecksumUtils.SetChecksumData( request, publicRequest.ChecksumAlgorithm, @@ -154,7 +145,6 @@ public IRequest Marshall(CreateBucketMetadataConfigurationRequest publicRequest) { throw new AmazonServiceException("Unable to marshall request to XML", e); } - return request; } private static CreateBucketMetadataConfigurationRequestMarshaller _instance = new CreateBucketMetadataConfigurationRequestMarshaller(); @@ -175,5 +165,7 @@ public static CreateBucketMetadataConfigurationRequestMarshaller Instance } } + partial void PostMarshallCustomization(DefaultRequest defaultRequest, CreateBucketMetadataConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, CreateBucketMetadataConfigurationRequest publicRequest); } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationResponseUnmarshaller.cs similarity index 82% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationResponseUnmarshaller.cs index 8ca998880ae9..54fe2c4bc8ab 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/CreateBucketMetadataConfigurationResponseUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for CreateBucketMetadataConfiguration operation /// - public class CreateBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + public partial class CreateBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -47,6 +47,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte { CreateBucketMetadataConfigurationResponse response = new CreateBucketMetadataConfigurationResponse(); + PostUnmarshallCustomization(context, response); return response; } @@ -60,7 +61,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - var errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; @@ -70,11 +71,17 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) { } - return new AmazonS3Exception(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode); + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); } + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, CreateBucketMetadataConfigurationResponse response); + private static CreateBucketMetadataConfigurationResponseUnmarshaller _instance = new CreateBucketMetadataConfigurationResponseUnmarshaller(); + internal static CreateBucketMetadataConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } /// /// Gets the singleton. diff --git a/sdk/src/Services/S3/Custom/Model/InventoryTableConfiguration.cs b/sdk/src/Services/S3/Generated/Model/InventoryTableConfiguration.cs similarity index 97% rename from sdk/src/Services/S3/Custom/Model/InventoryTableConfiguration.cs rename to sdk/src/Services/S3/Generated/Model/InventoryTableConfiguration.cs index 21e2675a00d6..6a90c8511e6b 100644 --- a/sdk/src/Services/S3/Custom/Model/InventoryTableConfiguration.cs +++ b/sdk/src/Services/S3/Generated/Model/InventoryTableConfiguration.cs @@ -40,7 +40,8 @@ public partial class InventoryTableConfiguration /// /// Gets and sets the property ConfigurationState. /// - /// The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled. + /// The configuration state of the inventory table, indicating whether the inventory + /// table is enabled or disabled. /// /// [AWSProperty(Required=true)] diff --git a/sdk/src/Services/S3/Custom/Model/JournalTableConfiguration.cs b/sdk/src/Services/S3/Generated/Model/JournalTableConfiguration.cs similarity index 100% rename from sdk/src/Services/S3/Custom/Model/JournalTableConfiguration.cs rename to sdk/src/Services/S3/Generated/Model/JournalTableConfiguration.cs diff --git a/sdk/src/Services/S3/Custom/Model/MetadataConfiguration.cs b/sdk/src/Services/S3/Generated/Model/MetadataConfiguration.cs similarity index 100% rename from sdk/src/Services/S3/Custom/Model/MetadataConfiguration.cs rename to sdk/src/Services/S3/Generated/Model/MetadataConfiguration.cs diff --git a/sdk/src/Services/S3/Generated/Model/MetadataTableEncryptionConfiguration.cs b/sdk/src/Services/S3/Generated/Model/MetadataTableEncryptionConfiguration.cs new file mode 100644 index 000000000000..b4ce5e8c55fc --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/MetadataTableEncryptionConfiguration.cs @@ -0,0 +1,84 @@ +/* + * 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 encryption settings for an S3 Metadata journal table or inventory table configuration. + /// + public partial class MetadataTableEncryptionConfiguration + { + private string _kmsKeyArn; + private TableSseAlgorithm _sseAlgorithm; + + /// + /// Gets and sets the property KmsKeyArn. + /// + /// If server-side encryption with Key Management Service (KMS) keys (SSE-KMS) is specified, + /// you must also specify the KMS key Amazon Resource Name (ARN). You must specify a customer-managed + /// KMS key that's located in the same Region as the general purpose bucket that corresponds + /// to the metadata table configuration. + /// + /// + public string KmsKeyArn + { + get { return this._kmsKeyArn; } + set { this._kmsKeyArn = value; } + } + + // Check to see if KmsKeyArn property is set + internal bool IsSetKmsKeyArn() + { + return !String.IsNullOrEmpty(this._kmsKeyArn); + } + + /// + /// Gets and sets the property SseAlgorithm. + /// + /// The encryption type specified for a metadata table. To specify server-side encryption + /// with Key Management Service (KMS) keys (SSE-KMS), use the aws:kms value. To + /// specify server-side encryption with Amazon S3 managed keys (SSE-S3), use the AES256 + /// value. + /// + /// + [AWSProperty(Required=true)] + public TableSseAlgorithm SseAlgorithm + { + get { return this._sseAlgorithm; } + set { this._sseAlgorithm = value; } + } + + // Check to see if SseAlgorithm property is set + internal bool IsSetSseAlgorithm() + { + return this._sseAlgorithm != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/RecordExpiration.cs b/sdk/src/Services/S3/Generated/Model/RecordExpiration.cs similarity index 95% rename from sdk/src/Services/S3/Custom/Model/RecordExpiration.cs rename to sdk/src/Services/S3/Generated/Model/RecordExpiration.cs index 11ebd34f3211..ea347e40f84d 100644 --- a/sdk/src/Services/S3/Custom/Model/RecordExpiration.cs +++ b/sdk/src/Services/S3/Generated/Model/RecordExpiration.cs @@ -30,7 +30,8 @@ namespace Amazon.S3.Model { /// - /// The journal table record expiration settings for a journal table in an S3 Metadata configuration. + /// The journal table record expiration settings for a journal table in an S3 Metadata + /// configuration. /// public partial class RecordExpiration { @@ -47,9 +48,9 @@ public partial class RecordExpiration /// 365. /// /// - public int Days + public int? Days { - get { return this._days.GetValueOrDefault(); } + get { return this._days; } set { this._days = value; } } From 0d8293ad4d8341b989eca56c5c2d8bd5b6f29263 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 26 Nov 2025 13:20:51 -0800 Subject: [PATCH 10/11] Generate GetBucketMetadataConfiguration (#4161) * Geneate DeleteBucketInventoryConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4157, branch: peterrsongg/petesong/phase-3-pr4-3/4 * Generate PutBucketAcclerateConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4158, branch: peterrsongg/petesong/phase-3-pr4-3/5 * Generate PutBucketRequestPayment stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4159, branch: peterrsongg/petesong/phase-3-pr4-3/6 * Generate CreateBucketMetadataTableConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4160, branch: peterrsongg/petesong/phase-3-pr4-3/7 * Generate GetBucketMetadataConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4161, branch: peterrsongg/petesong/phase-3-pr4-3/8 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 6 +- .../ServiceModels/s3/s3.customizations.json | 10 ++ .../GetBucketMetadataConfigurationRequest.cs | 69 --------- .../Model/DestinationResult.cs | 0 .../GetBucketMetadataConfigurationRequest.cs | 133 ++++++++++++++++++ .../GetBucketMetadataConfigurationResponse.cs | 5 +- .../GetBucketMetadataConfigurationResult.cs | 7 +- .../DestinationResultUnmarshaller.cs | 6 +- ...tMetadataConfigurationRequestMarshaller.cs | 10 +- ...tadataConfigurationResponseUnmarshaller.cs | 14 +- ...MetadataConfigurationResultUnmarshaller.cs | 6 +- ...oryTableConfigurationResultUnmarshaller.cs | 8 +- ...nalTableConfigurationResultUnmarshaller.cs | 8 +- ...MetadataConfigurationResultUnmarshaller.cs | 6 +- .../RecordExpirationUnmarshaller.cs | 8 +- .../InventoryTableConfigurationResult.cs | 29 ++-- .../Model/JournalTableConfigurationResult.cs | 2 +- .../Model/MetadataConfigurationResult.cs | 0 18 files changed, 221 insertions(+), 106 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationRequest.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/DestinationResult.cs (100%) create mode 100644 sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationRequest.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketMetadataConfigurationResponse.cs (93%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketMetadataConfigurationResult.cs (90%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/DestinationResultUnmarshaller.cs (90%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationRequestMarshaller.cs (82%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResponseUnmarshaller.cs (86%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResultUnmarshaller.cs (87%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/InventoryTableConfigurationResultUnmarshaller.cs (89%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/JournalTableConfigurationResultUnmarshaller.cs (89%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/MetadataConfigurationResultUnmarshaller.cs (90%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/RecordExpirationUnmarshaller.cs (87%) rename sdk/src/Services/S3/{Custom => Generated}/Model/InventoryTableConfigurationResult.cs (82%) rename sdk/src/Services/S3/{Custom => Generated}/Model/JournalTableConfigurationResult.cs (99%) rename sdk/src/Services/S3/{Custom => Generated}/Model/MetadataConfigurationResult.cs (100%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index e077511bab60..5d0a63188b3b 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -573,7 +573,8 @@ public List S3AllowListOperations new Operation(this, "DeleteBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["DeleteBucketIntelligentTieringConfiguration"]), new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), new Operation(this,"PutBucketRequestPayment", DocumentRoot[OperationsKey]["PutBucketRequestPayment"]), - new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"]) + new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"]), + new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"]) }; } @@ -604,7 +605,8 @@ public List S3RequestMarshallerThrowGenericExceptionList "PutObjectAcl", "GetObjectAcl", "PutBucketAcl", - "CreateBucketMetadataConfiguration" + "CreateBucketMetadataConfiguration", + "GetBucketMetadataConfiguration" }; } return _s3RequestMarshallerThrowAmazonS3ExceptionList; diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 0acc7070cf86..b241f9a605a7 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1207,6 +1207,16 @@ "KmsKeyArn":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._kmsKeyArn);"]} } ] + }, + "GetBucketMetadataConfigurationRequest":{ + "modify":[ + { + "BucketName":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._bucketName);"]} + }, + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationRequest.cs b/sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationRequest.cs deleted file mode 100644 index 2eb99b73892e..000000000000 --- a/sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationRequest.cs +++ /dev/null @@ -1,69 +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.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 GetBucketMetadataConfiguration operation. - /// - /// - public partial class GetBucketMetadataConfigurationRequest : AmazonWebServiceRequest - { - private string bucketName; - private string expectedBucketOwner; - - /// - /// Gets and sets the property BucketName. - /// - public string BucketName - { - get { return this.bucketName; } - set { this.bucketName = value; } - } - - // Check to see if BucketName property is set - internal bool IsSetBucketName() - { - return !String.IsNullOrEmpty(this.bucketName); - } - - /// - /// Gets and sets the property ExpectedBucketOwner. - /// - public string ExpectedBucketOwner - { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } - } - - // Check to see if ExpectedBucketOwner property is set - internal bool IsSetExpectedBucketOwner() - { - return !String.IsNullOrEmpty(this.expectedBucketOwner); - } - - } -} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/DestinationResult.cs b/sdk/src/Services/S3/Generated/Model/DestinationResult.cs similarity index 100% rename from sdk/src/Services/S3/Custom/Model/DestinationResult.cs rename to sdk/src/Services/S3/Generated/Model/DestinationResult.cs diff --git a/sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationRequest.cs new file mode 100644 index 000000000000..1f7a7207d0e3 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationRequest.cs @@ -0,0 +1,133 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Container for the parameters to the GetBucketMetadataConfiguration operation. + /// Retrieves the S3 Metadata configuration for a general purpose bucket. For more information, + /// see Accelerating + /// data discovery with S3 Metadata in the Amazon S3 User Guide. + /// + /// + /// + /// You can use the V2 GetBucketMetadataConfiguration API operation with V1 or + /// V2 metadata configurations. However, if you try to use the V1 GetBucketMetadataTableConfiguration + /// API operation with V2 configurations, you will receive an HTTP 405 Method Not Allowed + /// error. + /// + ///
Permissions
+ /// + /// To use this operation, you must have the s3:GetBucketMetadataTableConfiguration + /// permission. For more information, see Setting + /// up permissions for configuring metadata tables in the Amazon S3 User Guide. + /// + /// + /// + /// + /// The IAM policy action name is the same for the V1 and V2 API operations. + /// + ///
+ /// + /// The following operations are related to GetBucketMetadataConfiguration: + /// + /// + /// + /// 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 GetBucketMetadataConfigurationRequest : AmazonWebServiceRequest + { + private string _bucketName; + private string _expectedBucketOwner; + + /// + /// Gets and sets the property BucketName. + /// + /// The general purpose bucket that corresponds to the metadata configuration that you + /// want to retrieve. + /// + /// + [AWSProperty(Required=true)] + public string BucketName + { + get { return this._bucketName; } + set { this._bucketName = value; } + } + + // Check to see if BucketName property is set + internal bool IsSetBucketName() + { + return !String.IsNullOrEmpty(this._bucketName); + } + + /// + /// Gets and sets the property ExpectedBucketOwner. + /// + /// The expected owner of the general purpose bucket that you want to retrieve the metadata + /// table configuration for. + /// + /// + public string ExpectedBucketOwner + { + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } + } + + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() + { + return !String.IsNullOrEmpty(this._expectedBucketOwner); + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationResponse.cs similarity index 93% rename from sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationResponse.cs index 7a6a549e1f73..4de7b771bbb8 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationResponse.cs @@ -37,7 +37,10 @@ public partial class GetBucketMetadataConfigurationResponse : AmazonWebServiceRe private GetBucketMetadataConfigurationResult _getBucketMetadataConfigurationResult; /// - /// Gets and sets the property GetBucketMetadataConfigurationResult. + /// Gets and sets the property GetBucketMetadataConfigurationResult. + /// + /// The metadata configuration for the general purpose bucket. + /// /// public GetBucketMetadataConfigurationResult GetBucketMetadataConfigurationResult { diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationResult.cs b/sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationResult.cs similarity index 90% rename from sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationResult.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationResult.cs index 46cccd9cc928..ad6c72fcfc48 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketMetadataConfigurationResult.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketMetadataConfigurationResult.cs @@ -30,14 +30,17 @@ namespace Amazon.S3.Model { /// - /// + /// The S3 Metadata configuration for a general purpose bucket. /// public partial class GetBucketMetadataConfigurationResult { private MetadataConfigurationResult _metadataConfigurationResult; /// - /// Gets and sets the property MetadataConfigurationResult. + /// Gets and sets the property MetadataConfigurationResult. + /// + /// The metadata configuration for a general purpose bucket. + /// /// [AWSProperty(Required=true)] public MetadataConfigurationResult MetadataConfigurationResult diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DestinationResultUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DestinationResultUnmarshaller.cs similarity index 90% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DestinationResultUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DestinationResultUnmarshaller.cs index a7de8544cb44..044eefe73089 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DestinationResultUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DestinationResultUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for DestinationResult Object /// - public class DestinationResultUnmarshaller : IXmlUnmarshaller + public partial class DestinationResultUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -74,6 +74,8 @@ public DestinationResult Unmarshall(XmlUnmarshallerContext context) unmarshalledObject.TableNamespace = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { @@ -83,6 +85,8 @@ public DestinationResult Unmarshall(XmlUnmarshallerContext context) return unmarshalledObject; } + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, DestinationResult unmarshalledObject, int targetDepth); + private static DestinationResultUnmarshaller _instance = new DestinationResultUnmarshaller(); /// diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationRequestMarshaller.cs similarity index 82% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationRequestMarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationRequestMarshaller.cs index f58276f2ea51..fd718a66cb8c 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationRequestMarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// GetBucketMetadataConfiguration Request Marshaller /// - public class GetBucketMetadataConfigurationRequestMarshaller : IMarshaller , IMarshaller + public partial class GetBucketMetadataConfigurationRequestMarshaller : IMarshaller , IMarshaller { /// /// Marshaller the request object to the HTTP request. @@ -56,6 +56,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) public IRequest Marshall(GetBucketMetadataConfigurationRequest publicRequest) { var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); request.HttpMethod = "GET"; request.AddSubResource("metadataConfiguration"); @@ -65,10 +66,9 @@ public IRequest Marshall(GetBucketMetadataConfigurationRequest publicRequest) } if (!publicRequest.IsSetBucketName()) throw new AmazonS3Exception("Request object does not have required field BucketName set"); - request.AddPathResource("{Bucket}", StringUtils.FromString(publicRequest.BucketName)); - request.ResourcePath = "/{Bucket}"; - + request.ResourcePath = "/"; + PostMarshallCustomization(request, publicRequest); return request; } private static GetBucketMetadataConfigurationRequestMarshaller _instance = new GetBucketMetadataConfigurationRequestMarshaller(); @@ -89,5 +89,7 @@ public static GetBucketMetadataConfigurationRequestMarshaller Instance } } + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetBucketMetadataConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketMetadataConfigurationRequest publicRequest); } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResponseUnmarshaller.cs similarity index 86% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResponseUnmarshaller.cs index 8487718789c4..e478553fde29 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResponseUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for GetBucketMetadataConfiguration operation /// - public class GetBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + public partial class GetBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -48,6 +48,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte GetBucketMetadataConfigurationResponse response = new GetBucketMetadataConfigurationResponse(); UnmarshallResult(context,response); + PostUnmarshallCustomization(context, response); return response; } @@ -75,7 +76,6 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketMe return; } } - return; } @@ -89,7 +89,7 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketMe /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - var errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; @@ -99,11 +99,17 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) { } - return new AmazonS3Exception(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode); + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); } + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, GetBucketMetadataConfigurationResponse response); + private static GetBucketMetadataConfigurationResponseUnmarshaller _instance = new GetBucketMetadataConfigurationResponseUnmarshaller(); + internal static GetBucketMetadataConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } /// /// Gets the singleton. diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResultUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResultUnmarshaller.cs similarity index 87% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResultUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResultUnmarshaller.cs index 9070a84d6bec..85ac1458d169 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResultUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketMetadataConfigurationResultUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for GetBucketMetadataConfigurationResult Object /// - public class GetBucketMetadataConfigurationResultUnmarshaller : IXmlUnmarshaller + public partial class GetBucketMetadataConfigurationResultUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -62,6 +62,8 @@ public GetBucketMetadataConfigurationResult Unmarshall(XmlUnmarshallerContext co unmarshalledObject.MetadataConfigurationResult = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { @@ -71,6 +73,8 @@ public GetBucketMetadataConfigurationResult Unmarshall(XmlUnmarshallerContext co return unmarshalledObject; } + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, GetBucketMetadataConfigurationResult unmarshalledObject, int targetDepth); + private static GetBucketMetadataConfigurationResultUnmarshaller _instance = new GetBucketMetadataConfigurationResultUnmarshaller(); /// diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryTableConfigurationResultUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryTableConfigurationResultUnmarshaller.cs similarity index 89% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryTableConfigurationResultUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryTableConfigurationResultUnmarshaller.cs index 7f4861a09f84..bd95aec719a4 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/InventoryTableConfigurationResultUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/InventoryTableConfigurationResultUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for InventoryTableConfigurationResult Object /// - public class InventoryTableConfigurationResultUnmarshaller : IXmlUnmarshaller + public partial class InventoryTableConfigurationResultUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -64,7 +64,7 @@ public InventoryTableConfigurationResult Unmarshall(XmlUnmarshallerContext conte } if (context.TestExpression("Error", targetDepth)) { - var unmarshaller = ErrorUnmarshaller.Instance; + var unmarshaller = ErrorDetailsUnmarshaller.Instance; unmarshalledObject.Error = unmarshaller.Unmarshall(context); continue; } @@ -86,6 +86,8 @@ public InventoryTableConfigurationResult Unmarshall(XmlUnmarshallerContext conte unmarshalledObject.TableStatus = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { @@ -95,6 +97,8 @@ public InventoryTableConfigurationResult Unmarshall(XmlUnmarshallerContext conte return unmarshalledObject; } + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, InventoryTableConfigurationResult unmarshalledObject, int targetDepth); + private static InventoryTableConfigurationResultUnmarshaller _instance = new InventoryTableConfigurationResultUnmarshaller(); /// diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/JournalTableConfigurationResultUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/JournalTableConfigurationResultUnmarshaller.cs similarity index 89% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/JournalTableConfigurationResultUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/JournalTableConfigurationResultUnmarshaller.cs index bb8a8b7574f2..db022b7f3515 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/JournalTableConfigurationResultUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/JournalTableConfigurationResultUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for JournalTableConfigurationResult Object /// - public class JournalTableConfigurationResultUnmarshaller : IXmlUnmarshaller + public partial class JournalTableConfigurationResultUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -58,7 +58,7 @@ public JournalTableConfigurationResult Unmarshall(XmlUnmarshallerContext context { if (context.TestExpression("Error", targetDepth)) { - var unmarshaller = ErrorUnmarshaller.Instance; + var unmarshaller = ErrorDetailsUnmarshaller.Instance; unmarshalledObject.Error = unmarshaller.Unmarshall(context); continue; } @@ -86,6 +86,8 @@ public JournalTableConfigurationResult Unmarshall(XmlUnmarshallerContext context unmarshalledObject.TableStatus = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { @@ -95,6 +97,8 @@ public JournalTableConfigurationResult Unmarshall(XmlUnmarshallerContext context return unmarshalledObject; } + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, JournalTableConfigurationResult unmarshalledObject, int targetDepth); + private static JournalTableConfigurationResultUnmarshaller _instance = new JournalTableConfigurationResultUnmarshaller(); /// diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/MetadataConfigurationResultUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/MetadataConfigurationResultUnmarshaller.cs similarity index 90% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/MetadataConfigurationResultUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/MetadataConfigurationResultUnmarshaller.cs index 3729d5e402ec..ffec2c53303d 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/MetadataConfigurationResultUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/MetadataConfigurationResultUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for MetadataConfigurationResult Object /// - public class MetadataConfigurationResultUnmarshaller : IXmlUnmarshaller + public partial class MetadataConfigurationResultUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -74,6 +74,8 @@ public MetadataConfigurationResult Unmarshall(XmlUnmarshallerContext context) unmarshalledObject.JournalTableConfigurationResult = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { @@ -83,6 +85,8 @@ public MetadataConfigurationResult Unmarshall(XmlUnmarshallerContext context) return unmarshalledObject; } + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, MetadataConfigurationResult unmarshalledObject, int targetDepth); + private static MetadataConfigurationResultUnmarshaller _instance = new MetadataConfigurationResultUnmarshaller(); /// diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/RecordExpirationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/RecordExpirationUnmarshaller.cs similarity index 87% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/RecordExpirationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/RecordExpirationUnmarshaller.cs index dab2c5232742..cc584bbe5bc2 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/RecordExpirationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/RecordExpirationUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for RecordExpiration Object /// - public class RecordExpirationUnmarshaller : IXmlUnmarshaller + public partial class RecordExpirationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -58,7 +58,7 @@ public RecordExpiration Unmarshall(XmlUnmarshallerContext context) { if (context.TestExpression("Days", targetDepth)) { - var unmarshaller = IntUnmarshaller.Instance; + var unmarshaller = NullableIntUnmarshaller.Instance; unmarshalledObject.Days = unmarshaller.Unmarshall(context); continue; } @@ -68,6 +68,8 @@ public RecordExpiration Unmarshall(XmlUnmarshallerContext context) unmarshalledObject.Expiration = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { @@ -77,6 +79,8 @@ public RecordExpiration Unmarshall(XmlUnmarshallerContext context) return unmarshalledObject; } + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, RecordExpiration unmarshalledObject, int targetDepth); + private static RecordExpirationUnmarshaller _instance = new RecordExpirationUnmarshaller(); /// diff --git a/sdk/src/Services/S3/Custom/Model/InventoryTableConfigurationResult.cs b/sdk/src/Services/S3/Generated/Model/InventoryTableConfigurationResult.cs similarity index 82% rename from sdk/src/Services/S3/Custom/Model/InventoryTableConfigurationResult.cs rename to sdk/src/Services/S3/Generated/Model/InventoryTableConfigurationResult.cs index 4c927f40870d..17ad46b5e5d9 100644 --- a/sdk/src/Services/S3/Custom/Model/InventoryTableConfigurationResult.cs +++ b/sdk/src/Services/S3/Generated/Model/InventoryTableConfigurationResult.cs @@ -43,7 +43,8 @@ public partial class InventoryTableConfigurationResult /// /// Gets and sets the property ConfigurationState. /// - /// The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled. + /// The configuration state of the inventory table, indicating whether the inventory + /// table is enabled or disabled. /// /// [AWSProperty(Required=true)] @@ -117,19 +118,19 @@ internal bool IsSetTableName() /// ///
  • /// - /// CREATING - The inventory table is in the process of being created in the - /// specified Amazon Web Services managed table bucket. + /// CREATING - The inventory table is in the process of being created in the specified + /// Amazon Web Services managed table bucket. /// ///
  • /// - /// BACKFILLING - The inventory table is in the process of being backfilled. - /// When you enable the inventory table for your metadata configuration, the table goes - /// through a process known as backfilling, during which Amazon S3 scans your general - /// purpose bucket to retrieve the initial metadata for all objects in the bucket. Depending - /// on the number of objects in your bucket, this process can take several hours. When - /// the backfilling process is finished, the status of your inventory table changes from - /// BACKFILLING to ACTIVE. After backfilling is completed, updates to your - /// objects are reflected in the inventory table within one hour. + /// BACKFILLING - The inventory table is in the process of being backfilled. When + /// you enable the inventory table for your metadata configuration, the table goes through + /// a process known as backfilling, during which Amazon S3 scans your general purpose + /// bucket to retrieve the initial metadata for all objects in the bucket. Depending on + /// the number of objects in your bucket, this process can take several hours. When the + /// backfilling process is finished, the status of your inventory table changes from BACKFILLING + /// to ACTIVE. After backfilling is completed, updates to your objects are reflected + /// in the inventory table within one hour. /// ///
  • /// @@ -138,10 +139,10 @@ internal bool IsSetTableName() /// ///
  • /// - /// FAILED - Amazon S3 is unable to create the inventory table, or Amazon S3 - /// is unable to deliver records. + /// FAILED - Amazon S3 is unable to create the inventory table, or Amazon S3 is + /// unable to deliver records. /// - ///
+ /// ///
public string TableStatus { diff --git a/sdk/src/Services/S3/Custom/Model/JournalTableConfigurationResult.cs b/sdk/src/Services/S3/Generated/Model/JournalTableConfigurationResult.cs similarity index 99% rename from sdk/src/Services/S3/Custom/Model/JournalTableConfigurationResult.cs rename to sdk/src/Services/S3/Generated/Model/JournalTableConfigurationResult.cs index 85c7483d7423..ca2c65dda3e2 100644 --- a/sdk/src/Services/S3/Custom/Model/JournalTableConfigurationResult.cs +++ b/sdk/src/Services/S3/Generated/Model/JournalTableConfigurationResult.cs @@ -131,7 +131,7 @@ internal bool IsSetTableName() /// FAILED - Amazon S3 is unable to create the journal table, or Amazon S3 is /// unable to deliver records. /// - /// + /// ///
[AWSProperty(Required=true)] public string TableStatus diff --git a/sdk/src/Services/S3/Custom/Model/MetadataConfigurationResult.cs b/sdk/src/Services/S3/Generated/Model/MetadataConfigurationResult.cs similarity index 100% rename from sdk/src/Services/S3/Custom/Model/MetadataConfigurationResult.cs rename to sdk/src/Services/S3/Generated/Model/MetadataConfigurationResult.cs From e04e0ae54232c94426610219e97aa18d4e5cb3fe Mon Sep 17 00:00:00 2001 From: Peter Song Date: Wed, 26 Nov 2025 14:44:10 -0800 Subject: [PATCH 11/11] update devconfig --- .../1a7f3123-7320-4467-b277-ef4003e31fe1.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 generator/.DevConfigs/1a7f3123-7320-4467-b277-ef4003e31fe1.json diff --git a/generator/.DevConfigs/1a7f3123-7320-4467-b277-ef4003e31fe1.json b/generator/.DevConfigs/1a7f3123-7320-4467-b277-ef4003e31fe1.json new file mode 100644 index 000000000000..92aca284c574 --- /dev/null +++ b/generator/.DevConfigs/1a7f3123-7320-4467-b277-ef4003e31fe1.json @@ -0,0 +1,16 @@ +{ + "services": [ + { + "serviceName": "S3", + "type": "patch", + "changeLogMessages": [ + "The following changes are a result of moving S3 from custom code to generated code based on the model provided by S3:", + "[Breaking Change] The method isSetS3BucketDestination() in Amazon.S3.Model.InventoryDestination has been changed from public to internal to be consistent with all other services.", + "[Breaking Change] The method isSetAccountId() in Amazon.S3.Model.InventoryS3BucketDestination has been changed from public to internal to be consistent with all other services.", + "[Breaking Change] The method IsSetInventoryConfigurationList() in Amazon.S3.Model.ListBucketInventoryConfigurationsResponse has been changed from public to internal to be consistent with all other services.", + "[Breaking Change] The setter for Days in Amazon.S3.Model.RecordExpiration has been changed from int to int? to be consistent with the nullability changes in V4.", + "Generates Put, Get, Delete, and ListBucketInventoryConfiguration. Generate PutBucketAccelerateConfiguration, PutBucketRequestPayment, CreateBucketMetadataTableConfiguration, GetBucketMetadataConfiguration." + ] + } + ] +} \ No newline at end of file