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