From 4fffe5036fc49b5f508a44f36186a262773a5175 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Mon, 23 Jun 2025 10:23:08 -0700 Subject: [PATCH 1/7] generate GetBucketRequestPayment, GetBucketTagging, GetObjectAttributes, GetObjectLegalHold, GetObjectLockConfiguration --- .../816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json | 11 ++ .../Customizations.cs | 18 +- .../GeneratorDriver.cs | 1 - generator/ServiceClientGeneratorLib/Member.cs | 3 +- .../ServiceClientGeneratorLib/ServiceModel.cs | 16 +- .../ServiceModels/s3/s3.customizations.json | 7 + .../Custom/Model/GetBucketTaggingResponse.cs | 47 ----- ...etBucketRequestPaymentRequestMarshaller.cs | 71 ------- .../GetBucketTaggingRequestMarshaller.cs | 72 ------- .../{Custom => Generated}/Model/Checksum.cs | 91 ++++----- .../Services/S3/Generated/Model/Condition.cs | 97 +++++++++ .../Model/DefaultRetention.cs | 30 ++- .../S3/Generated/Model/ErrorDocument.cs | 66 +++++++ .../Model/GetBucketRequestPaymentRequest.cs | 43 ++-- .../Model/GetBucketRequestPaymentResponse.cs | 30 ++- .../Model/GetBucketTaggingRequest.cs | 49 ++--- .../Model/GetBucketTaggingResponse.cs | 64 ++++++ .../Model/GetObjectAttributesParts.cs} | 35 ++-- .../Model/GetObjectAttributesRequest.cs | 186 +++++++++++------- .../Model/GetObjectAttributesResponse.cs | 31 +-- .../Model/GetObjectLegalHoldRequest.cs | 75 +++---- .../Model/GetObjectLegalHoldResponse.cs | 4 +- .../GetObjectLockConfigurationRequest.cs | 48 +++-- .../GetObjectLockConfigurationResponse.cs | 2 + .../ChecksumUnmarshaller.cs | 35 ++-- .../DefaultRetentionUnmarshaller.cs | 17 +- ...etBucketRequestPaymentRequestMarshaller.cs | 93 +++++++++ ...ucketRequestPaymentResponseUnmarshaller.cs | 97 +++++---- .../GetBucketTaggingRequestMarshaller.cs | 93 +++++++++ .../GetBucketTaggingResponseUnmarshaller.cs | 98 +++++---- .../GetObjectAttributesPartsUnmarshaller.cs | 29 +-- .../GetObjectAttributesRequestMarshaller.cs | 76 ++++--- ...GetObjectAttributesResponseUnmarshaller.cs | 63 ++++-- .../GetObjectLegalHoldRequestMarshaller.cs | 51 ++--- .../GetObjectLegalHoldResponseUnmarshaller.cs | 43 +++- ...bjectLockConfigurationRequestMarshaller.cs | 41 ++-- ...ctLockConfigurationResponseUnmarshaller.cs | 43 +++- .../NoSuchKeyExceptionUnmarshaller.cs | 84 ++++++++ .../ObjectLockConfigurationUnmarshaller.cs | 13 +- .../ObjectLockLegalHoldUnmarshaller.cs | 13 +- .../ObjectLockRuleUnmarshaller.cs | 13 +- .../ObjectPartUnmarshaller.cs | 23 ++- .../S3/Generated/Model/NoSuchKeyException.cs | 120 +++++++++++ .../Model/ObjectLockConfiguration.cs | 10 +- .../Model/ObjectLockLegalHold.cs | 5 +- .../Model/ObjectLockRule.cs | 8 +- .../{Custom => Generated}/Model/ObjectPart.cs | 41 ++-- 47 files changed, 1477 insertions(+), 729 deletions(-) create mode 100644 generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json delete mode 100644 sdk/src/Services/S3/Custom/Model/GetBucketTaggingResponse.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketRequestPaymentRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketTaggingRequestMarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Checksum.cs (50%) create mode 100644 sdk/src/Services/S3/Generated/Model/Condition.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/DefaultRetention.cs (74%) create mode 100644 sdk/src/Services/S3/Generated/Model/ErrorDocument.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketRequestPaymentRequest.cs (68%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketRequestPaymentResponse.cs (60%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketTaggingRequest.cs (69%) create mode 100644 sdk/src/Services/S3/Generated/Model/GetBucketTaggingResponse.cs rename sdk/src/Services/S3/{Custom/Model/GetObjectAttributesPart.cs => Generated/Model/GetObjectAttributesParts.cs} (79%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectAttributesRequest.cs (66%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectAttributesResponse.cs (83%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectLegalHoldRequest.cs (58%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectLegalHoldResponse.cs (92%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectLockConfigurationRequest.cs (61%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectLockConfigurationResponse.cs (96%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ChecksumUnmarshaller.cs (91%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/DefaultRetentionUnmarshaller.cs (88%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketRequestPaymentRequestMarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetBucketRequestPaymentResponseUnmarshaller.cs (52%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketTaggingRequestMarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetBucketTaggingResponseUnmarshaller.cs (53%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectAttributesPartsUnmarshaller.cs (85%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectAttributesRequestMarshaller.cs (67%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectAttributesResponseUnmarshaller.cs (66%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectLegalHoldRequestMarshaller.cs (65%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectLegalHoldResponseUnmarshaller.cs (68%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectLockConfigurationRequestMarshaller.cs (70%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectLockConfigurationResponseUnmarshaller.cs (69%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/NoSuchKeyExceptionUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ObjectLockConfigurationUnmarshaller.cs (93%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ObjectLockLegalHoldUnmarshaller.cs (92%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ObjectLockRuleUnmarshaller.cs (91%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ObjectPartUnmarshaller.cs (90%) create mode 100644 sdk/src/Services/S3/Generated/Model/NoSuchKeyException.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/ObjectLockConfiguration.cs (76%) rename sdk/src/Services/S3/{Custom => Generated}/Model/ObjectLockLegalHold.cs (90%) rename sdk/src/Services/S3/{Custom => Generated}/Model/ObjectLockRule.cs (78%) rename sdk/src/Services/S3/{Custom => Generated}/Model/ObjectPart.cs (79%) diff --git a/generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json b/generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json new file mode 100644 index 000000000000..64ad3f74029a --- /dev/null +++ b/generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json @@ -0,0 +1,11 @@ +{ + "services": [ + { + "serviceName": "S3", + "type": "patch", + "changeLogMessages": [ + "Generate GetBucketRequestPayment, GetBucketTagging, and GetObjectAttributes" + ] + } + ] +} \ No newline at end of file diff --git a/generator/ServiceClientGeneratorLib/Customizations.cs b/generator/ServiceClientGeneratorLib/Customizations.cs index c4e1d6fb0699..50971a86f964 100644 --- a/generator/ServiceClientGeneratorLib/Customizations.cs +++ b/generator/ServiceClientGeneratorLib/Customizations.cs @@ -424,7 +424,7 @@ public class CustomizationsModel public const string OverrideContentTypeKey = "overrideContentType"; public const string StopPaginationOnSameTokenKey = "stopPaginationOnSameToken"; public const string OriginalMemberKey = "originalMember"; - + public const string TreatEnumsAsEnums = "treatEnumsAsEnums"; JsonData _documentRoot; SimpleMethodFormsModel _simpleMethodsModel; @@ -600,6 +600,22 @@ public List NoArgOverloads } } + /// + /// For Lists of enums, the generator automatically treats the enum as a string via passing in true to "treatEnumAsString". + /// This customization overrides that so that the enum is treated as an enum. + /// "treatEnumsAsEnums":{ + /// "ObjectAttributesList": true + /// } + /// + /// + /// + public bool GetTreatEnumAsEnum(string shapeName) + { + var data = _documentRoot[TreatEnumsAsEnums]; + if (data == null) return false; + return data[shapeName] == null ? false : true; + } + private HashSet _resultGenerationSuppressions = null; /// diff --git a/generator/ServiceClientGeneratorLib/GeneratorDriver.cs b/generator/ServiceClientGeneratorLib/GeneratorDriver.cs index f48eddba33ef..b5354aaf981a 100644 --- a/generator/ServiceClientGeneratorLib/GeneratorDriver.cs +++ b/generator/ServiceClientGeneratorLib/GeneratorDriver.cs @@ -211,7 +211,6 @@ public void Execute() this.ExecuteGenerator(new ServiceEnumerations(), enumFileName); } - // Any paginators for the service // skip paginators for s3 until we're at the end of s3 client generation if (Configuration.ServiceModel.HasPaginators && Configuration.ServiceId != "S3") diff --git a/generator/ServiceClientGeneratorLib/Member.cs b/generator/ServiceClientGeneratorLib/Member.cs index 690bf71b1214..fd76ab51bf49 100644 --- a/generator/ServiceClientGeneratorLib/Member.cs +++ b/generator/ServiceClientGeneratorLib/Member.cs @@ -583,7 +583,8 @@ private string DetermineType(JsonData extendedData, bool treatEnumsAsString, boo var valueType = DetermineType(memberShape["value"], true, false); return string.Format("Dictionary<{0}, {1}>", keyType, valueType); case "list": - var listType = DetermineType(memberShape["member"], true, false); + // if customization exists to treat the enum as an enum instead of a string, we pass in false + var listType = this.model.Customizations.GetTreatEnumAsEnum(this.Extends) ? DetermineType(memberShape["member"], false, false) : DetermineType(memberShape["member"], true, false) ; return string.Format("List<{0}>", listType); case "decimal": diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 1bde7fdedca1..5fd520952705 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -493,13 +493,13 @@ public List S3AllowListOperations new Operation(this, "GetBucketPolicy", DocumentRoot[OperationsKey]["GetBucketPolicy"]), new Operation(this, "GetBucketPolicyStatus", DocumentRoot[OperationsKey]["GetBucketPolicyStatus"]), new Operation(this, "GetBucketReplication", DocumentRoot[OperationsKey]["GetBucketReplication"]), - //new Operation(this, "GetBucketRequestPayment", DocumentRoot[OperationsKey]["GetBucketRequestPayment"]), - //new Operation(this, "GetBucketTagging", DocumentRoot[OperationsKey]["GetBucketTagging"]), + new Operation(this, "GetBucketRequestPayment", DocumentRoot[OperationsKey]["GetBucketRequestPayment"]), + new Operation(this, "GetBucketTagging", DocumentRoot[OperationsKey]["GetBucketTagging"]), //new Operation(this, "GetBucketVersioning", DocumentRoot[OperationsKey]["GetBucketVersioning"]), //new Operation(this, "GetBucketWebsite", DocumentRoot[OperationsKey]["GetBucketWebsite"]), - //new Operation(this, "GetObjectAttributes", DocumentRoot[OperationsKey]["GetObjectAttributes"]), - //new Operation(this, "GetObjectLegalHold", DocumentRoot[OperationsKey]["GetObjectLegalHold"]), - //new Operation(this, "GetObjectLockConfiguration", DocumentRoot[OperationsKey]["GetObjectLockConfiguration"]), + new Operation(this, "GetObjectAttributes", DocumentRoot[OperationsKey]["GetObjectAttributes"]), + new Operation(this, "GetObjectLegalHold", DocumentRoot[OperationsKey]["GetObjectLegalHold"]), + new Operation(this, "GetObjectLockConfiguration", DocumentRoot[OperationsKey]["GetObjectLockConfiguration"]), //new Operation(this, "GetObjectRetention", DocumentRoot[OperationsKey]["GetObjectRetention"]), //new Operation(this, "GetObjectTagging", DocumentRoot[OperationsKey]["GetObjectTagging"]), //new Operation(this, "GetPublicAccessBlock", DocumentRoot[OperationsKey]["GetPublicAccessBlock"]), @@ -542,7 +542,8 @@ public List S3AddParametersList _s3AddParametersList = new List { "ListBuckets", - "ListDirectoryBuckets" + "ListDirectoryBuckets", + "GetObjectLegalHold" }; } return _s3AddParametersList; @@ -567,7 +568,8 @@ public List S3RequestMarshallerThrowGenericExceptionList { _s3RequestMarshallerThrowAmazonS3ExceptionList = new List() { - "CreateSession" + "CreateSession", + "GetObjectAttributes" }; } return _s3RequestMarshallerThrowAmazonS3ExceptionList; diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 36338abc51fb..c3e1615127d2 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -381,6 +381,13 @@ }, "StorageClass":{ "renameShape": "S3StorageClass" + }, + "Payer":{ + "renameShape": "string" } + + }, + "treatEnumsAsEnums":{ + "ObjectAttributesList": true } } diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketTaggingResponse.cs b/sdk/src/Services/S3/Custom/Model/GetBucketTaggingResponse.cs deleted file mode 100644 index a5d402eb585a..000000000000 --- a/sdk/src/Services/S3/Custom/Model/GetBucketTaggingResponse.cs +++ /dev/null @@ -1,47 +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 GetBucketTagging response and response metadata. - /// - public class GetBucketTaggingResponse : AmazonWebServiceResponse - { - private List tagSet = AWSConfigs.InitializeCollections ? new List() : null; - - /// - /// The collection of tags. - /// - public List TagSet - { - get { return this.tagSet; } - set { this.tagSet = value; } - } - - // Check to see if TagSet property is set - internal bool IsSetTagSet() - { - return this.tagSet != null && (this.tagSet.Count > 0 || !AWSConfigs.InitializeCollections); - } - } -} - diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketRequestPaymentRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketRequestPaymentRequestMarshaller.cs deleted file mode 100644 index 8a54add8e39a..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketRequestPaymentRequestMarshaller.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 -{ - /// - /// Get Bucket Request Payment Request Marshaller - /// - public class GetBucketRequestPaymentRequestMarshaller : IMarshaller ,IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((GetBucketRequestPaymentRequest)input); - } - - public IRequest Marshall(GetBucketRequestPaymentRequest getBucketRequestPaymentRequest) - { - IRequest request = new DefaultRequest(getBucketRequestPaymentRequest, "AmazonS3"); - - request.HttpMethod = "GET"; - - if (getBucketRequestPaymentRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getBucketRequestPaymentRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(getBucketRequestPaymentRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetBucketRequestPaymentRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("requestPayment"); - request.UseQueryString = true; - - return request; - } - - private static GetBucketRequestPaymentRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static GetBucketRequestPaymentRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketRequestPaymentRequestMarshaller(); - } - return _instance; - } - } - } -} - diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketTaggingRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketTaggingRequestMarshaller.cs deleted file mode 100644 index d59ff63f60d2..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketTaggingRequestMarshaller.cs +++ /dev/null @@ -1,72 +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 -{ - /// - /// Get Bucket Tagging Request Marshaller - /// - public class GetBucketTaggingRequestMarshaller : IMarshaller ,IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((GetBucketTaggingRequest)input); - } - - public IRequest Marshall(GetBucketTaggingRequest getBucketTaggingRequest) - { - IRequest request = new DefaultRequest(getBucketTaggingRequest, "AmazonS3"); - - request.Suppress404Exceptions = true; - request.HttpMethod = "GET"; - - if (getBucketTaggingRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getBucketTaggingRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(getBucketTaggingRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetBucketTaggingRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("tagging"); - request.UseQueryString = true; - - return request; - } - - private static GetBucketTaggingRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static GetBucketTaggingRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketTaggingRequestMarshaller(); - } - return _instance; - } - } - } -} - diff --git a/sdk/src/Services/S3/Custom/Model/Checksum.cs b/sdk/src/Services/S3/Generated/Model/Checksum.cs similarity index 50% rename from sdk/src/Services/S3/Custom/Model/Checksum.cs rename to sdk/src/Services/S3/Generated/Model/Checksum.cs index e40f46eec80d..f516a858207e 100644 --- a/sdk/src/Services/S3/Custom/Model/Checksum.cs +++ b/sdk/src/Services/S3/Generated/Model/Checksum.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,6 +13,9 @@ * 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; @@ -23,6 +26,7 @@ using Amazon.Runtime; using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// @@ -35,17 +39,17 @@ public partial class Checksum private string _checksumCRC64NVME; private string _checksumSHA1; private string _checksumSHA256; - private ChecksumType checksumType; + private ChecksumType _checksumType; /// /// Gets and sets the property ChecksumCRC32. /// - /// The Base64 encoded, 32-bit CRC-32 checksum of the object. This checksum is only present - /// if the checksum was uploaded with the object. When you use an API operation on an object that - /// was uploaded using multipart uploads, this value may not be a direct checksum value - /// of the full object. Instead, it's a calculation based on the checksum values of each - /// individual part. For more information about how checksums are calculated with multipart - /// uploads, see + /// The Base64 encoded, 32-bit CRC32 checksum of the object. This checksum is only + /// be present if the checksum was uploaded with the object. When you use an API operation + /// on an object that was uploaded using multipart uploads, this value may not be a direct + /// checksum value of the full object. Instead, it's a calculation based on the checksum + /// values of each individual part. For more information about how checksums are calculated + /// with multipart uploads, see /// Checking object integrity in the Amazon S3 User Guide. /// /// @@ -64,12 +68,12 @@ internal bool IsSetChecksumCRC32() /// /// Gets and sets the property ChecksumCRC32C. /// - /// The Base64 encoded, 32-bit CRC-32C checksum of the object. This checksum is only present - /// if the checksum was uploaded with the object. When you use an API operation on an object that - /// was uploaded using multipart uploads, this value may not be a direct checksum value - /// of the full object. Instead, it's a calculation based on the checksum values of each - /// individual part. For more information about how checksums are calculated with multipart - /// uploads, see + /// The Base64 encoded, 32-bit CRC32C checksum of the object. This checksum is + /// only present if the checksum was uploaded with the object. When you use an API operation + /// on an object that was uploaded using multipart uploads, this value may not be a direct + /// checksum value of the full object. Instead, it's a calculation based on the checksum + /// values of each individual part. For more information about how checksums are calculated + /// with multipart uploads, see /// Checking object integrity in the Amazon S3 User Guide. /// /// @@ -88,13 +92,12 @@ internal bool IsSetChecksumCRC32C() /// /// Gets and sets the property ChecksumCRC64NVME. /// - /// The Base64 encoded, 64-bit CRC-64NVME checksum of the object. This checksum is only present - /// if the checksum was uploaded with the object. When you use an API operation on an object that - /// was uploaded using multipart uploads, this value may not be a direct checksum value - /// of the full object. Instead, it's a calculation based on the checksum values of each - /// individual part. For more information about how checksums are calculated with multipart - /// uploads, see - /// Checking object integrity in the Amazon S3 User Guide. + /// The Base64 encoded, 64-bit CRC64NVME checksum of the object. This checksum + /// is present if the object was uploaded with the CRC64NVME checksum algorithm, + /// or if the object was uploaded without a checksum (and Amazon S3 added the default + /// checksum, CRC64NVME, to the uploaded object). For more information, see Checking + /// object integrity in the Amazon S3 User Guide. /// /// public string ChecksumCRC64NVME @@ -112,12 +115,12 @@ internal bool IsSetChecksumCRC64NVME() /// /// Gets and sets the property ChecksumSHA1. /// - /// The Base64 encoded, 160-bit SHA-1 digest of the object. This will only be present - /// if it was uploaded with the object. When you use the API operation on an object that - /// was uploaded using multipart uploads, this value may not be a direct checksum value - /// of the full object. Instead, it's a calculation based on the checksum values of each - /// individual part. For more information about how checksums are calculated with multipart - /// uploads, see + /// The Base64 encoded, 160-bit SHA1 digest of the object. This will only be present + /// if the object was uploaded with the object. When you use the API operation on an object + /// that was uploaded using multipart uploads, this value may not be a direct checksum + /// value of the full object. Instead, it's a calculation based on the checksum values + /// of each individual part. For more information about how checksums are calculated with + /// multipart uploads, see /// Checking object integrity in the Amazon S3 User Guide. /// /// @@ -136,12 +139,12 @@ internal bool IsSetChecksumSHA1() /// /// Gets and sets the property ChecksumSHA256. /// - /// The Base64 encoded, 256-bit SHA-256 digest of the object. This will only be present - /// if it was uploaded with the object. When you use an API operation on an object that - /// was uploaded using multipart uploads, this value may not be a direct checksum value - /// of the full object. Instead, it's a calculation based on the checksum values of each - /// individual part. For more information about how checksums are calculated with multipart - /// uploads, see + /// The Base64 encoded, 256-bit SHA256 digest of the object. This will only be + /// present if the object was uploaded with the object. When you use an API operation + /// on an object that was uploaded using multipart uploads, this value may not be a direct + /// checksum value of the full object. Instead, it's a calculation based on the checksum + /// values of each individual part. For more information about how checksums are calculated + /// with multipart uploads, see /// Checking object integrity in the Amazon S3 User Guide. /// /// @@ -158,26 +161,24 @@ internal bool IsSetChecksumSHA256() } /// - /// Gets and sets the property ChecksumType. + /// Gets and sets the property ChecksumType. /// - /// The checksum type that is used to calculate the object’s checksum value. - /// For more information, see - /// Checking object integrity in the Amazon S3 User Guide. + /// The checksum type that is used to calculate the object’s checksum value. For more + /// information, see Checking + /// object integrity in the Amazon S3 User Guide. /// /// public ChecksumType ChecksumType { - get { return this.checksumType; } - set { this.checksumType = value; } + get { return this._checksumType; } + set { this._checksumType = value; } } - /// - /// Checks to see if ChecksumType is set. - /// - /// true, if ChecksumType property is set. + // Check to see if ChecksumType property is set internal bool IsSetChecksumType() { - return checksumType != null; + return this._checksumType != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Condition.cs b/sdk/src/Services/S3/Generated/Model/Condition.cs new file mode 100644 index 000000000000..7eda2458229e --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Condition.cs @@ -0,0 +1,97 @@ +/* + * 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 +{ + /// + /// A container for describing a condition that must be met for the specified redirect + /// to apply. For example, 1. If request is for pages in the /docs folder, redirect + /// to the /documents folder. 2. If request results in HTTP error 4xx, redirect + /// request to another host where you might process the error. + /// + public partial class Condition + { + private string _httpErrorCodeReturnedEquals; + private string _keyPrefixEquals; + + /// + /// Gets and sets the property HttpErrorCodeReturnedEquals. + /// + /// The HTTP error code when the redirect is applied. In the event of an error, if the + /// error code equals this value, then the specified redirect is applied. Required when + /// parent element Condition is specified and sibling KeyPrefixEquals is + /// not specified. If both are specified, then both must be true for the redirect to be + /// applied. + /// + /// + public string HttpErrorCodeReturnedEquals + { + get { return this._httpErrorCodeReturnedEquals; } + set { this._httpErrorCodeReturnedEquals = value; } + } + + // Check to see if HttpErrorCodeReturnedEquals property is set + internal bool IsSetHttpErrorCodeReturnedEquals() + { + return this._httpErrorCodeReturnedEquals != null; + } + + /// + /// Gets and sets the property KeyPrefixEquals. + /// + /// The object key name prefix when the redirect is applied. For example, to redirect + /// requests for ExamplePage.html, the key prefix will be ExamplePage.html. + /// To redirect request for all pages with the prefix docs/, the key prefix will + /// be /docs, which identifies all objects in the docs/ folder. Required + /// when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals + /// is not specified. If both conditions are specified, both must be true for the redirect + /// to be applied. + /// + /// + /// + /// Replacement must be made for object keys containing special characters (such as carriage + /// returns) when using XML requests. For more information, see + /// XML related object key constraints. + /// + /// + /// + public string KeyPrefixEquals + { + get { return this._keyPrefixEquals; } + set { this._keyPrefixEquals = value; } + } + + // Check to see if KeyPrefixEquals property is set + internal bool IsSetKeyPrefixEquals() + { + return this._keyPrefixEquals != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/DefaultRetention.cs b/sdk/src/Services/S3/Generated/Model/DefaultRetention.cs similarity index 74% rename from sdk/src/Services/S3/Custom/Model/DefaultRetention.cs rename to sdk/src/Services/S3/Generated/Model/DefaultRetention.cs index 2a5f31ccb49e..efe344e5e88e 100644 --- a/sdk/src/Services/S3/Custom/Model/DefaultRetention.cs +++ b/sdk/src/Services/S3/Generated/Model/DefaultRetention.cs @@ -21,20 +21,28 @@ 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 container element for optionally specifying the default Object Lock retention settings for - /// new objects placed in the specified bucket. - ///
    - ///
  • The DefaultRetention settings require both a mode and a period.
  • - ///
  • The DefaultRetention period can be either Days or Years but you must - /// select one. You cannot specify Days and Years at the same time.
  • - ///
+ /// The container element for optionally specifying the default Object Lock retention + /// settings for new objects placed in the specified bucket. + /// + ///
  • + /// + /// The DefaultRetention settings require both a mode and a period. + /// + ///
  • + /// + /// The DefaultRetention period can be either Days or Years but you + /// must select one. You cannot specify Days and Years at the same time. + /// + ///
///
public partial class DefaultRetention { @@ -45,7 +53,8 @@ public partial class DefaultRetention /// /// Gets and sets the property Days. /// - /// The number of days that you want to specify for the default retention period. + /// The number of days that you want to specify for the default retention period. Must + /// be used with Mode. /// /// public int? Days @@ -64,7 +73,7 @@ internal bool IsSetDays() /// Gets and sets the property Mode. /// /// The default Object Lock retention mode you want to apply to new objects placed in - /// the specified bucket. + /// the specified bucket. Must be used with either Days or Years. /// ///
public ObjectLockRetentionMode Mode @@ -82,7 +91,8 @@ internal bool IsSetMode() /// /// Gets and sets the property Years. /// - /// The number of years that you want to specify for the default retention period. + /// The number of years that you want to specify for the default retention period. Must + /// be used with Mode. /// /// public int? Years diff --git a/sdk/src/Services/S3/Generated/Model/ErrorDocument.cs b/sdk/src/Services/S3/Generated/Model/ErrorDocument.cs new file mode 100644 index 000000000000..2c43c09c6fe1 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/ErrorDocument.cs @@ -0,0 +1,66 @@ +/* + * 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 error information. + /// + public partial class ErrorDocument + { + private string _key; + + /// + /// Gets and sets the property Key. + /// + /// The object key name to use when a 4XX class error occurs. + /// + /// + /// + /// Replacement must be made for object keys containing special characters (such as carriage + /// returns) when using XML requests. For more information, see + /// XML related object key constraints. + /// + /// + /// + [AWSProperty(Required=true, Min=1)] + public string Key + { + get { return this._key; } + set { this._key = value; } + } + + // Check to see if Key property is set + internal bool IsSetKey() + { + return this._key != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketRequestPaymentRequest.cs b/sdk/src/Services/S3/Generated/Model/GetBucketRequestPaymentRequest.cs similarity index 68% rename from sdk/src/Services/S3/Custom/Model/GetBucketRequestPaymentRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketRequestPaymentRequest.cs index 1a90bcdef438..c9b6a8fe725c 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketRequestPaymentRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketRequestPaymentRequest.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 GetBucketRequestPayment 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 /// /// /// - /// The following operations are related to GetBucketRequestPayment: + /// The following operations are related to GetBucketRequestPayment: /// ///
  • /// @@ -48,22 +54,25 @@ namespace Amazon.S3.Model ///
public partial class GetBucketRequestPaymentRequest : AmazonWebServiceRequest { - private string bucketName; - private string expectedBucketOwner; + private string _bucketName; + private string _expectedBucketOwner; /// - /// The name of the bucket. + /// Gets and sets the property BucketName. + /// + /// The name of the bucket for which to get the payment request configuration + /// /// 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; } /// @@ -71,24 +80,20 @@ internal bool IsSetBucketName() /// /// 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 this._expectedBucketOwner != null; } } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketRequestPaymentResponse.cs b/sdk/src/Services/S3/Generated/Model/GetBucketRequestPaymentResponse.cs similarity index 60% rename from sdk/src/Services/S3/Custom/Model/GetBucketRequestPaymentResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketRequestPaymentResponse.cs index 74ceed71244d..c8eef0beed9c 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketRequestPaymentResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketRequestPaymentResponse.cs @@ -12,37 +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 { /// - /// Returns information about the GetBucketRequestPayment response and response metadata. + /// This is the response object from the GetBucketRequestPayment operation. /// - public class GetBucketRequestPaymentResponse : AmazonWebServiceResponse + public partial class GetBucketRequestPaymentResponse : AmazonWebServiceResponse { - private string payer; + private String _payer; /// + /// Gets and sets the property Payer. + /// /// Specifies who pays for the download and request fees. - /// + /// /// - public string Payer + 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 diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketTaggingRequest.cs b/sdk/src/Services/S3/Generated/Model/GetBucketTaggingRequest.cs similarity index 69% rename from sdk/src/Services/S3/Custom/Model/GetBucketTaggingRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketTaggingRequest.cs index c8546a028d71..4c03ec88a461 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketTaggingRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketTaggingRequest.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 GetBucketTagging operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -35,17 +41,17 @@ namespace Amazon.S3.Model /// /// /// - /// To use this operation, you must have permission to perform the s3:GetBucketTagging + /// To use this operation, you must have permission to perform the s3:GetBucketTagging /// action. By default, the bucket owner has this permission and can grant this permission /// to others. /// /// /// - /// GetBucketTagging has the following special error: + /// GetBucketTagging has the following special error: /// ///
  • /// - /// Error code: NoSuchTagSet + /// Error code: NoSuchTagSet /// ///
    • /// @@ -53,7 +59,7 @@ namespace Amazon.S3.Model /// ///
/// - /// The following operations are related to GetBucketTagging: + /// The following operations are related to GetBucketTagging: /// ///
  • /// @@ -69,22 +75,25 @@ namespace Amazon.S3.Model ///
public partial class GetBucketTaggingRequest : AmazonWebServiceRequest { - private string bucketName; - private string expectedBucketOwner; + private string _bucketName; + private string _expectedBucketOwner; /// - /// The name of the bucket to be queried. + /// Gets and sets the property BucketName. + /// + /// The name of the bucket for which to get the tagging information. + /// /// 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; } /// @@ -92,24 +101,20 @@ internal bool IsSetBucketName() /// /// 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 this._expectedBucketOwner != null; } } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/GetBucketTaggingResponse.cs b/sdk/src/Services/S3/Generated/Model/GetBucketTaggingResponse.cs new file mode 100644 index 000000000000..134e6f62ec61 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/GetBucketTaggingResponse.cs @@ -0,0 +1,64 @@ +/* + * 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 GetBucketTagging operation. + /// + public partial class GetBucketTaggingResponse : AmazonWebServiceResponse + { + private List _tagSet = AWSConfigs.InitializeCollections ? new List() : null; + + /// + /// Gets and sets the property TagSet. + /// + /// Contains the tag set. + /// + /// + /// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned + /// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller + /// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous + /// SDK behavior set the AWSConfigs.InitializeCollections static property to true. + /// + [AWSProperty(Required=true)] + public List TagSet + { + get { return this._tagSet; } + set { this._tagSet = value; } + } + + // Check to see if TagSet property is set + internal bool IsSetTagSet() + { + return this._tagSet != null && (this._tagSet.Count > 0 || !AWSConfigs.InitializeCollections); + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectAttributesPart.cs b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesParts.cs similarity index 79% rename from sdk/src/Services/S3/Custom/Model/GetObjectAttributesPart.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectAttributesParts.cs index 00a8270fe8df..d0aa360fdc0c 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectAttributesPart.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesParts.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,6 +13,9 @@ * 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; @@ -23,6 +26,7 @@ using Amazon.Runtime; using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// @@ -40,9 +44,9 @@ public partial class GetObjectAttributesParts /// /// Gets and sets the property IsTruncated. /// - /// Indicates whether the returned list of parts is truncated. A value of true indicates - /// that the list was truncated. A list can be truncated if the number of parts exceeds - /// the limit returned in the MaxParts element. + /// Indicates whether the returned list of parts is truncated. A value of true + /// indicates that the list was truncated. A list can be truncated if the number of parts + /// exceeds the limit returned in the MaxParts element. /// /// public bool? IsTruncated @@ -54,7 +58,7 @@ public bool? IsTruncated // Check to see if IsTruncated property is set internal bool IsSetIsTruncated() { - return this._isTruncated.HasValue; + return this._isTruncated.HasValue; } /// @@ -72,14 +76,15 @@ public int? MaxParts // Check to see if MaxParts property is set internal bool IsSetMaxParts() { - return this._maxParts.HasValue; + return this._maxParts.HasValue; } /// /// Gets and sets the property NextPartNumberMarker. /// /// When a list is truncated, this element specifies the last part in the list, as well - /// as the value to use for the part-number-marker request parameter in a subsequent request. + /// as the value to use for the PartNumberMarker request parameter in a subsequent + /// request. /// /// public int? NextPartNumberMarker @@ -91,7 +96,7 @@ public int? NextPartNumberMarker // Check to see if NextPartNumberMarker property is set internal bool IsSetNextPartNumberMarker() { - return this._nextPartNumberMarker.HasValue; + return this._nextPartNumberMarker.HasValue; } /// @@ -109,14 +114,14 @@ public int? PartNumberMarker // Check to see if PartNumberMarker property is set internal bool IsSetPartNumberMarker() { - return this._partNumberMarker.HasValue; + return this._partNumberMarker.HasValue; } /// /// Gets and sets the property Parts. /// /// A container for elements related to a particular part. A response can contain zero - /// or more Parts elements. + /// or more Parts elements. /// ///
  • /// @@ -132,6 +137,11 @@ internal bool IsSetPartNumberMarker() /// returns the Part element. /// ///
+ /// + /// 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 Parts { @@ -142,7 +152,7 @@ public List Parts // Check to see if Parts property is set internal bool IsSetParts() { - return this._parts != null && (this._parts.Count > 0 || !AWSConfigs.InitializeCollections); + return this._parts != null && (this._parts.Count > 0 || !AWSConfigs.InitializeCollections); } /// @@ -160,7 +170,8 @@ public int? TotalPartsCount // Check to see if TotalPartsCount property is set internal bool IsSetTotalPartsCount() { - return this._totalPartsCount.HasValue; + return this._totalPartsCount.HasValue; } + } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectAttributesRequest.cs b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs similarity index 66% rename from sdk/src/Services/S3/Custom/Model/GetObjectAttributesRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs index b2d0dea14e78..09383475b539 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectAttributesRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.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,6 +13,9 @@ * 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; @@ -23,38 +26,61 @@ using Amazon.Runtime; using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// /// Container for the parameters to the GetObjectAttributes operation. - /// Retrieves all the metadata from an object without returning the object itself. This - /// operation is useful if you're interested only in an object's metadata. + /// Retrieves all of the metadata from an object without returning the object itself. + /// This operation is useful if you're interested only in an object's metadata. /// /// /// /// GetObjectAttributes combines the functionality of HeadObject and ListParts. - /// All of the data returned with each of those individual calls can be returned with + /// All of the data returned with both of those individual calls can be returned with /// a single call to GetObjectAttributes. /// /// /// /// Directory buckets - For directory buckets, you must make requests for this /// API operation to the Zonal endpoint. These endpoints support virtual-hosted-style - /// requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name - /// . Path-style requests are not supported. For more information, see Regional - /// and Zonal endpoints in the Amazon S3 User Guide. + /// requests in the format https://amzn-s3-demo-bucket.s3express-zone-id.region-code.amazonaws.com/key-name + /// . Path-style requests are not supported. For more information about endpoints + /// in Availability Zones, see Regional + /// and Zonal endpoints for directory buckets in Availability Zones in the Amazon + /// S3 User Guide. For more information about endpoints in Local Zones, see Concepts + /// for directory buckets in Local Zones in the Amazon S3 User Guide. /// ///
Permissions
  • /// /// General purpose bucket permissions - To use GetObjectAttributes, you - /// must have READ access to the object. The permissions that you need to use this operation - /// with depend on whether the bucket is versioned. If the bucket is versioned, you need - /// both the s3:GetObjectVersion and s3:GetObjectVersionAttributes permissions - /// for this operation. If the bucket is not versioned, you need the s3:GetObject - /// and s3:GetObjectAttributes permissions. For more information, see Specifying - /// Permissions in a Policy in the Amazon S3 User Guide. If the object that - /// you request does not exist, the error Amazon S3 returns depends on whether you also - /// have the s3:ListBucket permission. + /// must have READ access to the object. + /// + /// + /// + /// The other permissions that you need to use this operation depend on whether the bucket + /// is versioned and if a version ID is passed in the GetObjectAttributes request. + /// + /// + ///
    • + /// + /// If you pass a version ID in your request, you need both the s3:GetObjectVersion + /// and s3:GetObjectVersionAttributes permissions. + /// + ///
    • + /// + /// If you do not pass a version ID in your request, you need the s3:GetObject + /// and s3:GetObjectAttributes permissions. + /// + ///
    + /// + /// For more information, see Specifying + /// Permissions in a Policy in the Amazon S3 User Guide. + /// + /// + /// + /// If the object that you request does not exist, the error Amazon S3 returns depends + /// on whether you also have the s3:ListBucket permission. /// ///
    • /// @@ -81,6 +107,12 @@ namespace Amazon.S3.Model /// about authorization, see /// CreateSession . /// + /// + /// + /// If the object is encrypted with SSE-KMS, you must also have the kms:GenerateDataKey + /// and kms:Decrypt permissions in IAM identity-based policies and KMS key policies + /// for the KMS key. + /// ///
Encryption
/// /// Encryption request headers, like x-amz-server-side-encryption, should not be @@ -95,10 +127,11 @@ namespace Amazon.S3.Model /// /// /// - /// If you encrypt an object by using server-side encryption with customer-provided encryption - /// keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata - /// from the object, you must use the following headers to provide the encryption key - /// for the server to be able to retrieve the object's metadata. The headers are: + /// If you encrypted an object when you stored the object in Amazon S3 by using server-side + /// encryption with customer-provided encryption keys (SSE-C), then when you retrieve + /// the metadata from the object, you must use the following headers. These headers provide + /// the server with the encryption key required to retrieve the object's metadata. The + /// headers are: /// ///
  • /// @@ -120,8 +153,17 @@ namespace Amazon.S3.Model /// /// /// - /// Directory bucket permissions - For directory buckets, only server-side encryption - /// with Amazon S3 managed keys (SSE-S3) (AES256) is supported. + /// Directory bucket permissions - For directory buckets, there are only two supported + /// options for server-side encryption: server-side encryption with Amazon S3 managed + /// keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). + /// We recommend that the bucket's default encryption uses the desired encryption configuration + /// and you don't override the bucket default encryption in your CreateSession + /// requests or PUT object requests. Then, new objects are automatically encrypted + /// with the desired encryption settings. For more information, see Protecting + /// data with server-side encryption in the Amazon S3 User Guide. For more + /// information about the encryption overriding behaviors in directory buckets, see Specifying + /// server-side encryption with KMS for new object uploads. /// ///
Versioning
/// @@ -174,7 +216,7 @@ namespace Amazon.S3.Model /// ///
HTTP Host header syntax
/// - /// Directory buckets - The HTTP Host header syntax is Bucket_name.s3express-az_id.region.amazonaws.com. + /// Directory buckets - The HTTP Host header syntax is Bucket-name.s3express-zone-id.region-code.amazonaws.com. /// ///
/// @@ -240,38 +282,43 @@ public partial class GetObjectAttributesRequest : AmazonWebServiceRequest /// Gets and sets the property BucketName. /// /// The name of the bucket that contains the object. - /// - /// - /// Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted-style - /// requests in the format Bucket-name.s3express-zone-id.region-code.amazonaws.com. Path-style - /// requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket - /// names must follow the format bucket-base-name--zone-id--x-s3 (for example, amzn-s3-demo-bucket--usw2-az1--x-s3). For - /// information about bucket naming restrictions, see - /// Directory bucket naming rules in - /// the Amazon S3 User Guide. - /// - /// - /// Access points - When you use this action with an access point for general purpose buckets, you must provide the - /// alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an - /// access point for directory buckets, you must provide the access point name in place of the bucket name. When using the - /// access point ARN, you must direct requests to the access point hostname. The access point hostname takes the - /// form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an - /// access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more - /// information about access point ARNs, see - /// Using access points in - /// the Amazon S3 User Guide. - /// - /// + /// + /// + /// + /// Directory buckets - When you use this operation with a directory bucket, you + /// must use virtual-hosted-style requests in the format Bucket-name.s3express-zone-id.region-code.amazonaws.com. + /// Path-style requests are not supported. Directory bucket names must be unique in the + /// chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format + /// bucket-base-name--zone-id--x-s3 (for example, amzn-s3-demo-bucket--usw2-az1--x-s3). + /// For information about bucket naming restrictions, see Directory + /// bucket naming rules in the Amazon S3 User Guide. + /// + /// + /// + /// Access points - When you use this action with an access point for general + /// purpose buckets, you must provide the alias of the access point in place of the bucket + /// name or specify the access point ARN. When you use this action with an access point + /// for directory buckets, you must provide the access point name in place of the bucket + /// name. When using the access point ARN, you must direct requests to the access point + /// hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + /// When using this action with an access point through the Amazon Web Services SDKs, + /// you provide the access point ARN in place of the bucket name. For more information + /// about access point ARNs, see Using + /// access points in the Amazon S3 User Guide. + /// + /// /// /// Object Lambda access points are not supported by directory buckets. - /// - /// - /// - /// S3 on Outposts - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 - /// on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - /// you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more - /// information about S3 on Outposts, see What is S3 on Outposts? in - /// the Amazon S3 User Guide. + /// + /// + /// + /// S3 on Outposts - When you use this action with S3 on Outposts, you must direct + /// requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form + /// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. + /// When you use this action with S3 on Outposts, the destination bucket must be the Outposts + /// access point ARN or the access point alias. For more information about S3 on Outposts, + /// see What + /// is S3 on Outposts? in the Amazon S3 User Guide. /// ///
public string BucketName @@ -312,7 +359,7 @@ internal bool IsSetExpectedBucketOwner() /// The object key. /// ///
- [AWSProperty(Required = true, Min = 1)] + [AWSProperty(Required=true, Min=1)] public string Key { get { return this._key; } @@ -328,9 +375,9 @@ internal bool IsSetKey() /// /// Gets and sets the property MaxParts. /// - /// Sets the maximum number of parts to return. For more information, see - /// - /// Uploading and copying objects using multipart upload in Amazon S3 in the Amazon Simple Storage Service user guide. + /// Sets the maximum number of parts to return. For more information, see Uploading + /// and copying objects using multipart upload in Amazon S3 in the Amazon Simple + /// Storage Service user guide. /// /// public int? MaxParts @@ -342,7 +389,7 @@ public int? MaxParts // Check to see if MaxParts property is set internal bool IsSetMaxParts() { - return this._maxParts.HasValue; + return this._maxParts.HasValue; } /// @@ -351,7 +398,13 @@ internal bool IsSetMaxParts() /// Specifies the fields at the root level that you want returned in the response. Fields /// that you do not specify are not returned. /// + /// + /// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned + /// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller + /// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous + /// SDK behavior set the AWSConfigs.InitializeCollections static property to true. /// + [AWSProperty(Required=true)] public List ObjectAttributes { get { return this._objectAttributes; } @@ -361,15 +414,16 @@ public List ObjectAttributes // Check to see if ObjectAttributes property is set internal bool IsSetObjectAttributes() { - return this._objectAttributes != null && (this._objectAttributes.Count > 0 || !AWSConfigs.InitializeCollections); + return this._objectAttributes != null; } /// /// Gets and sets the property PartNumberMarker. /// - /// Specifies the part after which listing should begin. Only parts with higher part numbers will be listed. For more information, - /// see - /// Uploading and copying objects using multipart upload in Amazon S3 in the Amazon Simple Storage Service user guide. + /// Specifies the part after which listing should begin. Only parts with higher part numbers + /// will be listed. For more information, see Uploading + /// and copying objects using multipart upload in Amazon S3 in the Amazon Simple + /// Storage Service user guide. /// /// public int? PartNumberMarker @@ -381,7 +435,7 @@ public int? PartNumberMarker // Check to see if PartNumberMarker property is set internal bool IsSetPartNumberMarker() { - return this._partNumberMarker.HasValue; + return this._partNumberMarker.HasValue; } /// @@ -402,7 +456,7 @@ internal bool IsSetRequestPayer() /// /// Gets and sets the property SSECustomerAlgorithm. /// - /// Specifies the algorithm to use to when encrypting the object (for example, AES256). + /// Specifies the algorithm to use when encrypting the object (for example, AES256). /// /// /// @@ -436,6 +490,7 @@ internal bool IsSetSSECustomerAlgorithm() /// /// /// + [AWSProperty(Sensitive=true)] public string SSECustomerKey { get { return this._sseCustomerKey; } @@ -481,9 +536,8 @@ internal bool IsSetSSECustomerKeyMD5() /// /// /// S3 Versioning isn't enabled and supported for directory buckets. For this API operation, - /// only the null value of the version ID is supported by directory buckets. - /// You can only specify null to the versionId query parameter - /// in the request. + /// only the null value of the version ID is supported by directory buckets. You + /// can only specify null to the versionId query parameter in the request. /// /// /// diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectAttributesResponse.cs b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesResponse.cs similarity index 83% rename from sdk/src/Services/S3/Custom/Model/GetObjectAttributesResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectAttributesResponse.cs index bbc3123f42f7..1c9f990e51f2 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectAttributesResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesResponse.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,6 +13,9 @@ * 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; @@ -23,6 +26,7 @@ using Amazon.Runtime; using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// @@ -61,8 +65,10 @@ internal bool IsSetChecksum() /// /// Gets and sets the property DeleteMarker. /// - /// Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. - /// If false, this response header does not appear in the response. + /// Specifies whether the object retrieved was (true) or was not (false) + /// a delete marker. If false, this response header does not appear in the response. + /// To learn more about delete markers, see Working + /// with delete markers. /// /// /// @@ -79,7 +85,7 @@ public bool? DeleteMarker // Check to see if DeleteMarker property is set internal bool IsSetDeleteMarker() { - return this._deleteMarker.HasValue; + return this._deleteMarker.HasValue; } /// @@ -104,7 +110,7 @@ internal bool IsSetETag() /// /// Gets and sets the property LastModified. /// - /// Creation date of the object. + /// Date and time when the object was last modified. /// /// public DateTime? LastModified @@ -116,7 +122,7 @@ public DateTime? LastModified // Check to see if LastModified property is set internal bool IsSetLastModified() { - return this._lastModified.HasValue; + return this._lastModified.HasValue; } /// @@ -152,7 +158,7 @@ public long? ObjectSize // Check to see if ObjectSize property is set internal bool IsSetObjectSize() { - return this._objectSize.HasValue; + return this._objectSize.HasValue; } /// @@ -173,8 +179,8 @@ internal bool IsSetRequestCharged() /// /// Gets and sets the property StorageClass. /// - /// Provides storage class information of the object. Amazon S3 returns this header for - /// all objects except for S3 Standard storage class objects. + /// Provides the storage class information of the object. Amazon S3 returns this header + /// for all objects except for S3 Standard storage class objects. /// /// /// @@ -183,8 +189,9 @@ internal bool IsSetRequestCharged() /// /// /// - /// Directory buckets - Only the S3 Express One Zone storage class is supported - /// by directory buckets to store objects. + /// Directory buckets - Directory buckets only support EXPRESS_ONEZONE + /// (the S3 Express One Zone storage class) in Availability Zones and ONEZONE_IA + /// (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. /// /// /// @@ -203,7 +210,7 @@ internal bool IsSetStorageClass() /// /// Gets and sets the property VersionId. /// - /// Version of the object. + /// The version ID of the object. /// /// /// diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectLegalHoldRequest.cs b/sdk/src/Services/S3/Generated/Model/GetObjectLegalHoldRequest.cs similarity index 58% rename from sdk/src/Services/S3/Custom/Model/GetObjectLegalHoldRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectLegalHoldRequest.cs index cfbd8890023e..66ef275e576b 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectLegalHoldRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectLegalHoldRequest.cs @@ -21,17 +21,19 @@ 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 GetObjectLegalHold operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -44,7 +46,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following action is related to GetObjectLegalHold: + /// The following action is related to GetObjectLegalHold: /// ///
  • /// @@ -56,7 +58,7 @@ namespace Amazon.S3.Model public partial class GetObjectLegalHoldRequest : AmazonWebServiceRequest { private string _bucketName; - private string expectedBucketOwner; + private string _expectedBucketOwner; private string _key; private RequestPayer _requestPayer; private string _versionId; @@ -64,18 +66,21 @@ public partial class GetObjectLegalHoldRequest : AmazonWebServiceRequest /// /// Gets and sets the property BucketName. /// - /// The bucket name containing the object whose legal hold status you want to retrieve. - /// - /// - /// Access points - When you use this action with an access point for general purpose buckets, you must provide - /// the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action - /// with an access point for directory buckets, you must provide the access point name in place of the bucket name. When - /// using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes - /// the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action - /// with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket - /// name. For more information about access point ARNs, see - /// Using access points in - /// the Amazon S3 User Guide. + /// The bucket name containing the object whose legal hold status you want to retrieve. + /// + /// + /// + /// + /// Access points - When you use this action with an access point for general + /// purpose buckets, you must provide the alias of the access point in place of the bucket + /// name or specify the access point ARN. When you use this action with an access point + /// for directory buckets, you must provide the access point name in place of the bucket + /// name. When using the access point ARN, you must direct requests to the access point + /// hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + /// When using this action with an access point through the Amazon Web Services SDKs, + /// you provide the access point ARN in place of the bucket name. For more information + /// about access point ARNs, see Using + /// access points in the Amazon S3 User Guide. /// /// public string BucketName @@ -87,7 +92,7 @@ public string BucketName // Check to see if BucketName property is set internal bool IsSetBucketName() { - return !string.IsNullOrEmpty(this._bucketName); + return this._bucketName != null; } /// @@ -95,45 +100,28 @@ internal bool IsSetBucketName() /// /// 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 this._expectedBucketOwner != null; } /// /// Gets and sets the property Key. /// - /// The key name for the object whose Legal Hold status you want to retrieve. + /// The key name for the object whose legal hold status you want to retrieve. /// /// - /// - /// - /// This property will be used as part of the resource path of the HTTP request. In .NET the System.Uri class - /// is used to construct the uri for the request. The System.Uri class will canonicalize the uri string by compacting characters like "..". - /// For example an object key of "foo/../bar/file.txt" will be transformed into "bar/file.txt" because the ".." - /// is interpreted as use parent directory. - /// - /// - /// Starting with .NET 8, the AWS .NET SDK disables System.Uri's feature of canonicalizing the resource path. This allows S3 keys like - /// "foo/../bar/file.txt" to work correctly with the AWS .NET SDK. - /// - /// - /// For further information view the documentation for the Uri class: https://docs.microsoft.com/en-us/dotnet/api/system.uri - /// - /// + [AWSProperty(Required=true, Min=1)] public string Key { get { return this._key; } @@ -143,7 +131,7 @@ public string Key // Check to see if Key property is set internal bool IsSetKey() { - return !string.IsNullOrEmpty(this._key); + return this._key != null; } /// @@ -164,7 +152,7 @@ internal bool IsSetRequestPayer() /// /// Gets and sets the property VersionId. /// - /// The version ID of the object whose Legal Hold status you want to retrieve. + /// The version ID of the object whose legal hold status you want to retrieve. /// /// public string VersionId @@ -176,7 +164,8 @@ public string VersionId // Check to see if VersionId property is set internal bool IsSetVersionId() { - return !string.IsNullOrEmpty(this._versionId); + return this._versionId != null; } + } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectLegalHoldResponse.cs b/sdk/src/Services/S3/Generated/Model/GetObjectLegalHoldResponse.cs similarity index 92% rename from sdk/src/Services/S3/Custom/Model/GetObjectLegalHoldResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectLegalHoldResponse.cs index 6c3864a25222..d416d556dc62 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectLegalHoldResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectLegalHoldResponse.cs @@ -21,10 +21,12 @@ 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 { /// @@ -37,7 +39,7 @@ public partial class GetObjectLegalHoldResponse : AmazonWebServiceResponse /// /// Gets and sets the property LegalHold. /// - /// The current Legal Hold status for the specified object. + /// The current legal hold status for the specified object. /// /// public ObjectLockLegalHold LegalHold diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectLockConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/GetObjectLockConfigurationRequest.cs similarity index 61% rename from sdk/src/Services/S3/Custom/Model/GetObjectLockConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectLockConfigurationRequest.cs index 41f353dbbf03..717cae7da306 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectLockConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectLockConfigurationRequest.cs @@ -17,15 +17,23 @@ * 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 GetObjectLockConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -36,7 +44,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following action is related to GetObjectLockConfiguration: + /// The following action is related to GetObjectLockConfiguration: /// ///
    • /// @@ -48,23 +56,25 @@ namespace Amazon.S3.Model public partial class GetObjectLockConfigurationRequest : AmazonWebServiceRequest { private string _bucketName; - private string expectedBucketOwner; + private string _expectedBucketOwner; /// /// Gets and sets the property BucketName. /// /// The bucket whose Object Lock configuration you want to retrieve. - /// - /// - /// Access points - When you use this action with an access point for general purpose buckets, you must - /// provide the alias of the access point in place of the bucket name or specify the access point ARN. When you - /// use this action with an access point for directory buckets, you must provide the access point name in place - /// of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The - /// access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When - /// using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN - /// in place of the bucket name. For more information about access point ARNs, see - /// Using access points in - /// the Amazon S3 User Guide. + /// + /// + /// + /// Access points - When you use this action with an access point for general + /// purpose buckets, you must provide the alias of the access point in place of the bucket + /// name or specify the access point ARN. When you use this action with an access point + /// for directory buckets, you must provide the access point name in place of the bucket + /// name. When using the access point ARN, you must direct requests to the access point + /// hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + /// When using this action with an access point through the Amazon Web Services SDKs, + /// you provide the access point ARN in place of the bucket name. For more information + /// about access point ARNs, see Using + /// access points in the Amazon S3 User Guide. /// /// public string BucketName @@ -76,7 +86,7 @@ public string BucketName // Check to see if BucketName property is set internal bool IsSetBucketName() { - return !string.IsNullOrEmpty(this._bucketName); + return this._bucketName != null; } /// @@ -84,19 +94,19 @@ internal bool IsSetBucketName() /// /// 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); + return this._expectedBucketOwner != null; } } diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectLockConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/GetObjectLockConfigurationResponse.cs similarity index 96% rename from sdk/src/Services/S3/Custom/Model/GetObjectLockConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectLockConfigurationResponse.cs index c19856731402..6cea5537562a 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectLockConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectLockConfigurationResponse.cs @@ -21,10 +21,12 @@ 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 { /// diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ChecksumUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ChecksumUnmarshaller.cs similarity index 91% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ChecksumUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ChecksumUnmarshaller.cs index 3fbb5e918e4c..d79c0e98b3df 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ChecksumUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ChecksumUnmarshaller.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,6 +13,9 @@ * 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; @@ -27,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -37,17 +41,17 @@ public class ChecksumUnmarshaller : IXmlUnmarshaller /// Unmarshaller the response from the service to the response class. /// - /// Unmarshaller context - /// Unmarshalled Checksum object + /// + /// public Checksum Unmarshall(XmlUnmarshallerContext context) { Checksum unmarshalledObject = new Checksum(); 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) @@ -64,22 +68,22 @@ public Checksum Unmarshall(XmlUnmarshallerContext context) unmarshalledObject.ChecksumCRC32C = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("ChecksumSHA1", targetDepth)) + if (context.TestExpression("ChecksumCRC64NVME", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; - unmarshalledObject.ChecksumSHA1 = unmarshaller.Unmarshall(context); + unmarshalledObject.ChecksumCRC64NVME = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("ChecksumSHA256", targetDepth)) + if (context.TestExpression("ChecksumSHA1", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; - unmarshalledObject.ChecksumSHA256 = unmarshaller.Unmarshall(context); + unmarshalledObject.ChecksumSHA1 = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("ChecksumCRC64NVME", targetDepth)) + if (context.TestExpression("ChecksumSHA256", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; - unmarshalledObject.ChecksumCRC64NVME = unmarshaller.Unmarshall(context); + unmarshalledObject.ChecksumSHA256 = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ChecksumType", targetDepth)) @@ -93,11 +97,10 @@ public Checksum Unmarshall(XmlUnmarshallerContext context) { return unmarshalledObject; } - } + } return unmarshalledObject; } - - private static ChecksumUnmarshaller _instance = new ChecksumUnmarshaller(); + private static ChecksumUnmarshaller _instance = new ChecksumUnmarshaller(); /// /// Gets the singleton. diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DefaultRetentionUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DefaultRetentionUnmarshaller.cs similarity index 88% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DefaultRetentionUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DefaultRetentionUnmarshaller.cs index 46ff7a471ed7..82b819b636fc 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DefaultRetentionUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DefaultRetentionUnmarshaller.cs @@ -30,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -57,7 +58,7 @@ public DefaultRetention Unmarshall(XmlUnmarshallerContext context) { if (context.TestExpression("Days", targetDepth)) { - var unmarshaller = IntUnmarshaller.Instance; + var unmarshaller = NullableIntUnmarshaller.Instance; unmarshalledObject.Days = unmarshaller.Unmarshall(context); continue; } @@ -69,7 +70,7 @@ public DefaultRetention Unmarshall(XmlUnmarshallerContext context) } if (context.TestExpression("Years", targetDepth)) { - var unmarshaller = IntUnmarshaller.Instance; + var unmarshaller = NullableIntUnmarshaller.Instance; unmarshalledObject.Years = unmarshaller.Unmarshall(context); continue; } @@ -81,23 +82,17 @@ public DefaultRetention Unmarshall(XmlUnmarshallerContext context) } return unmarshalledObject; } - - private static DefaultRetentionUnmarshaller _instance; + private static DefaultRetentionUnmarshaller _instance = new DefaultRetentionUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static DefaultRetentionUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new DefaultRetentionUnmarshaller(); - } return _instance; } } - } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketRequestPaymentRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketRequestPaymentRequestMarshaller.cs new file mode 100644 index 000000000000..6413ed7e08e0 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketRequestPaymentRequestMarshaller.cs @@ -0,0 +1,93 @@ +/* + * 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 +{ + /// + /// GetBucketRequestPayment Request Marshaller + /// + public partial class GetBucketRequestPaymentRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((GetBucketRequestPaymentRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(GetBucketRequestPaymentRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + request.HttpMethod = "GET"; + request.AddSubResource("requestPayment"); + + 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.", "GetBucketRequestPaymentRequest.BucketName"); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + return request; + } + private static GetBucketRequestPaymentRequestMarshaller _instance = new GetBucketRequestPaymentRequestMarshaller(); + + internal static GetBucketRequestPaymentRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketRequestPaymentRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetBucketRequestPaymentRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketRequestPaymentResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketRequestPaymentResponseUnmarshaller.cs similarity index 52% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketRequestPaymentResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketRequestPaymentResponseUnmarshaller.cs index 4f4eaffe41c1..093489aeada9 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketRequestPaymentResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketRequestPaymentResponseUnmarshaller.cs @@ -12,60 +12,63 @@ * 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 CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// - /// Response Unmarshaller for GetBucketRequestPayment operation - /// + /// Response Unmarshaller for GetBucketRequestPayment operation + /// public class GetBucketRequestPaymentResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { GetBucketRequestPaymentResponse response = new GetBucketRequestPaymentResponse(); + UnmarshallResult(context,response); - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context,response); - continue; - } - } - - return response; - } - - private static void UnmarshallResult(XmlUnmarshallerContext context,GetBucketRequestPaymentResponse response) + } + + private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketRequestPaymentResponse response) { - int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - if (context.IsStartOfDocument) - targetDepth += 2; - + targetDepth += 1; + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Payer", targetDepth)) { - response.Payer = StringUnmarshaller.GetInstance().Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + response.Payer = unmarshaller.Unmarshall(context); continue; } } @@ -74,28 +77,50 @@ private static void UnmarshallResult(XmlUnmarshallerContext context,GetBucketReq 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; - return; + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); } - private static GetBucketRequestPaymentResponseUnmarshaller _instance; + private static GetBucketRequestPaymentResponseUnmarshaller _instance = new GetBucketRequestPaymentResponseUnmarshaller(); + + internal static GetBucketRequestPaymentResponseUnmarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + ///
    public static GetBucketRequestPaymentResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new GetBucketRequestPaymentResponseUnmarshaller(); - } return _instance; } } + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketTaggingRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketTaggingRequestMarshaller.cs new file mode 100644 index 000000000000..8d562a97974c --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketTaggingRequestMarshaller.cs @@ -0,0 +1,93 @@ +/* + * 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 +{ + /// + /// GetBucketTagging Request Marshaller + /// + public partial class GetBucketTaggingRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((GetBucketTaggingRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(GetBucketTaggingRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + request.HttpMethod = "GET"; + request.AddSubResource("tagging"); + + 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.", "GetBucketTaggingRequest.BucketName"); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + return request; + } + private static GetBucketTaggingRequestMarshaller _instance = new GetBucketTaggingRequestMarshaller(); + + internal static GetBucketTaggingRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketTaggingRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetBucketTaggingRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketTaggingResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketTaggingResponseUnmarshaller.cs similarity index 53% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketTaggingResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketTaggingResponseUnmarshaller.cs index fcdf2de6531d..0e29de00f097 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketTaggingResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketTaggingResponseUnmarshaller.cs @@ -12,63 +12,67 @@ * 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 CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// - /// Response Unmarshaller for GetBucketTagging operation - /// + /// Response Unmarshaller for GetBucketTagging operation + ///
    public class GetBucketTaggingResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + ///
    /// /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { GetBucketTaggingResponse response = new GetBucketTaggingResponse(); + UnmarshallResult(context,response); - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context,response); - continue; - } - } - - return response; - } - - private static void UnmarshallResult(XmlUnmarshallerContext context,GetBucketTaggingResponse response) + } + + private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketTaggingResponse response) { - int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - if (context.IsStartOfDocument) - targetDepth += 2; - + targetDepth += 1; + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { - if (context.TestExpression("Tag", targetDepth + 1)) + if (context.TestExpression("TagSet/Tag", targetDepth)) { if (response.TagSet == null) { response.TagSet = new List(); } - response.TagSet.Add(TagUnmarshaller.Instance.Unmarshall(context)); + var unmarshaller = TagUnmarshaller.Instance; + response.TagSet.Add(unmarshaller.Unmarshall(context)); continue; } } @@ -77,28 +81,50 @@ private static void UnmarshallResult(XmlUnmarshallerContext context,GetBucketTag 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; - return; + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); } - private static GetBucketTaggingResponseUnmarshaller _instance; + private static GetBucketTaggingResponseUnmarshaller _instance = new GetBucketTaggingResponseUnmarshaller(); + + internal static GetBucketTaggingResponseUnmarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + ///
public static GetBucketTaggingResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new GetBucketTaggingResponseUnmarshaller(); - } return _instance; } } + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesPartsUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesPartsUnmarshaller.cs similarity index 85% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesPartsUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesPartsUnmarshaller.cs index 37d8bd9cb6e5..9aae41ee60e3 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesPartsUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesPartsUnmarshaller.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,6 +13,9 @@ * 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; @@ -27,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -44,35 +48,35 @@ public GetObjectAttributesParts Unmarshall(XmlUnmarshallerContext context) GetObjectAttributesParts unmarshalledObject = new GetObjectAttributesParts(); 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("IsTruncated", targetDepth)) { - var unmarshaller = BoolUnmarshaller.Instance; + var unmarshaller = NullableBoolUnmarshaller.Instance; unmarshalledObject.IsTruncated = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("MaxParts", targetDepth)) { - var unmarshaller = IntUnmarshaller.Instance; + var unmarshaller = NullableIntUnmarshaller.Instance; unmarshalledObject.MaxParts = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextPartNumberMarker", targetDepth)) { - var unmarshaller = IntUnmarshaller.Instance; + var unmarshaller = NullableIntUnmarshaller.Instance; unmarshalledObject.NextPartNumberMarker = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("PartNumberMarker", targetDepth)) { - var unmarshaller = IntUnmarshaller.Instance; + var unmarshaller = NullableIntUnmarshaller.Instance; unmarshalledObject.PartNumberMarker = unmarshaller.Unmarshall(context); continue; } @@ -88,7 +92,7 @@ public GetObjectAttributesParts Unmarshall(XmlUnmarshallerContext context) } if (context.TestExpression("PartsCount", targetDepth)) { - var unmarshaller = IntUnmarshaller.Instance; + var unmarshaller = NullableIntUnmarshaller.Instance; unmarshalledObject.TotalPartsCount = unmarshaller.Unmarshall(context); continue; } @@ -97,11 +101,10 @@ public GetObjectAttributesParts Unmarshall(XmlUnmarshallerContext context) { return unmarshalledObject; } - } + } return unmarshalledObject; } - - private static GetObjectAttributesPartsUnmarshaller _instance = new GetObjectAttributesPartsUnmarshaller(); + private static GetObjectAttributesPartsUnmarshaller _instance = new GetObjectAttributesPartsUnmarshaller(); /// /// Gets the singleton. diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesRequestMarshaller.cs similarity index 67% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesRequestMarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesRequestMarshaller.cs index 89dbdd076cad..a018613e01b3 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesRequestMarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesRequestMarshaller.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,6 +13,9 @@ * 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; @@ -27,12 +30,13 @@ using Amazon.Runtime.Internal.Util; using System.Xml; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// /// GetObjectAttributes Request Marshaller /// - public class GetObjectAttributesRequestMarshaller : IMarshaller, IMarshaller + public partial class GetObjectAttributesRequestMarshaller : IMarshaller , IMarshaller { /// /// Marshaller the request object to the HTTP request. @@ -53,48 +57,62 @@ public IRequest Marshall(GetObjectAttributesRequest publicRequest) { var request = new DefaultRequest(publicRequest, "Amazon.S3"); request.HttpMethod = "GET"; - string uriResourcePath = "/{Key+}"; request.AddSubResource("attributes"); - - if (publicRequest.IsSetExpectedBucketOwner()) + + if (publicRequest.IsSetExpectedBucketOwner()) + { request.Headers["x-amz-expected-bucket-owner"] = publicRequest.ExpectedBucketOwner; - - if (publicRequest.IsSetMaxParts()) + } + + if (publicRequest.IsSetMaxParts()) + { request.Headers["x-amz-max-parts"] = StringUtils.FromInt(publicRequest.MaxParts); - - if (publicRequest.IsSetObjectAttributes()) - request.Headers["x-amz-object-attributes"] = StringUtils.FromList(publicRequest.ObjectAttributes); - - if (publicRequest.IsSetPartNumberMarker()) + } + + if (publicRequest.IsSetObjectAttributes()) + { + request.Headers["x-amz-object-attributes"] = StringUtils.FromList(publicRequest.ObjectAttributes); + } + + if (publicRequest.IsSetPartNumberMarker()) + { request.Headers["x-amz-part-number-marker"] = StringUtils.FromInt(publicRequest.PartNumberMarker); - - if (publicRequest.IsSetRequestPayer()) + } + + if (publicRequest.IsSetRequestPayer()) + { request.Headers["x-amz-request-payer"] = publicRequest.RequestPayer; - - if (publicRequest.IsSetSSECustomerAlgorithm()) + } + + if (publicRequest.IsSetSSECustomerAlgorithm()) + { request.Headers["x-amz-server-side-encryption-customer-algorithm"] = publicRequest.SSECustomerAlgorithm; - - if (publicRequest.IsSetSSECustomerKey()) + } + + if (publicRequest.IsSetSSECustomerKey()) + { request.Headers["x-amz-server-side-encryption-customer-key"] = publicRequest.SSECustomerKey; - - if (publicRequest.IsSetSSECustomerKeyMD5()) + } + + if (publicRequest.IsSetSSECustomerKeyMD5()) + { request.Headers["x-amz-server-side-encryption-customer-key-MD5"] = publicRequest.SSECustomerKeyMD5; - + } if (!publicRequest.IsSetBucketName()) throw new AmazonS3Exception("Request object does not have required field BucketName set"); - if (!publicRequest.IsSetKey()) throw new AmazonS3Exception("Request object does not have required field Key set"); - request.AddPathResource("{Key+}", S3Transforms.ToStringValue(publicRequest.Key)); - + request.AddPathResource("{Key+}", StringUtils.FromString(publicRequest.Key)); + if (publicRequest.IsSetVersionId()) - request.Parameters.Add("versionId", StringUtils.FromString(publicRequest.VersionId)); + request.AddSubResource("versionId", StringUtils.FromString(publicRequest.VersionId)); + request.ResourcePath = "/{Key+}"; - request.ResourcePath = uriResourcePath; request.UseQueryString = true; + PostMarshallCustomization(request, publicRequest); return request; } - private static GetObjectAttributesRequestMarshaller _instance = new GetObjectAttributesRequestMarshaller(); + private static GetObjectAttributesRequestMarshaller _instance = new GetObjectAttributesRequestMarshaller(); internal static GetObjectAttributesRequestMarshaller GetInstance() { @@ -111,5 +129,7 @@ public static GetObjectAttributesRequestMarshaller Instance return _instance; } } - } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetObjectAttributesRequest publicRequest); + } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesResponseUnmarshaller.cs similarity index 66% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesResponseUnmarshaller.cs index bec60873686f..ccced5c7a2a7 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectAttributesResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectAttributesResponseUnmarshaller.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,6 +13,9 @@ * 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; @@ -27,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -42,26 +46,29 @@ public class GetObjectAttributesResponseUnmarshaller : S3ReponseUnmarshaller public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { GetObjectAttributesResponse response = new GetObjectAttributesResponse(); - UnmarshallResult(context, response); + UnmarshallResult(context,response); if (context.ResponseData.IsHeaderPresent("x-amz-delete-marker")) - response.DeleteMarker = S3Transforms.ToBool(context.ResponseData.GetHeaderValue("x-amz-delete-marker")); + response.DeleteMarker = bool.Parse(context.ResponseData.GetHeaderValue("x-amz-delete-marker")); if (context.ResponseData.IsHeaderPresent("Last-Modified")) - response.LastModified = S3Transforms.ToDateTime(context.ResponseData.GetHeaderValue("Last-Modified")); + response.LastModified = DateTime.Parse(context.ResponseData.GetHeaderValue("Last-Modified"), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal); if (context.ResponseData.IsHeaderPresent("x-amz-request-charged")) response.RequestCharged = context.ResponseData.GetHeaderValue("x-amz-request-charged"); if (context.ResponseData.IsHeaderPresent("x-amz-version-id")) response.VersionId = context.ResponseData.GetHeaderValue("x-amz-version-id"); - + return response; - } + } private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectAttributesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - if (context.IsStartOfDocument) - targetDepth += 1; - + if (context.IsStartOfDocument) + targetDepth += 1; + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) @@ -86,7 +93,7 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectAt } if (context.TestExpression("ObjectSize", targetDepth)) { - var unmarshaller = LongUnmarshaller.Instance; + var unmarshaller = NullableLongUnmarshaller.Instance; response.ObjectSize = unmarshaller.Unmarshall(context); continue; } @@ -102,11 +109,43 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectAt return; } } - + return; } + - private static GetObjectAttributesResponseUnmarshaller _instance = new GetObjectAttributesResponseUnmarshaller(); + /// + /// 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)) + { + if (errorResponse.Code != null && errorResponse.Code.Equals("NoSuchKey")) + { + return NoSuchKeyExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); + } + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + private static GetObjectAttributesResponseUnmarshaller _instance = new GetObjectAttributesResponseUnmarshaller(); + + internal static GetObjectAttributesResponseUnmarshaller GetInstance() + { + return _instance; + } /// /// Gets the singleton. diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLegalHoldRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLegalHoldRequestMarshaller.cs similarity index 65% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLegalHoldRequestMarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLegalHoldRequestMarshaller.cs index 7d9373fdce38..696effbf580e 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLegalHoldRequestMarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLegalHoldRequestMarshaller.cs @@ -29,14 +29,14 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using System.Xml; -using Amazon.S3.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// /// GetObjectLegalHold Request Marshaller /// - public class GetObjectLegalHoldRequestMarshaller : IMarshaller , IMarshaller + public partial class GetObjectLegalHoldRequestMarshaller : IMarshaller , IMarshaller { /// /// Marshaller the request object to the HTTP request. @@ -55,46 +55,51 @@ public IRequest Marshall(AmazonWebServiceRequest input) /// public IRequest Marshall(GetObjectLegalHoldRequest publicRequest) { - var request = new DefaultRequest(publicRequest, "AmazonS3"); + var request = new DefaultRequest(publicRequest, "Amazon.S3"); request.HttpMethod = "GET"; - string uriResourcePath = "/{Key+}"; request.AddSubResource("legal-hold"); - if(publicRequest.IsSetRequestPayer()) - request.Headers.Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(publicRequest.RequestPayer.ToString())); - if (publicRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(publicRequest.ExpectedBucketOwner)); - if (!publicRequest.IsSetBucketName()) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "publicRequest.BucketName"); - if (!publicRequest.IsSetKey()) - throw new System.ArgumentException("Key is a required property and must be set before making this call.", "publicRequest.Key"); - request.AddPathResource("{Key+}", S3Transforms.ToStringValue(publicRequest.Key)); + if (publicRequest.IsSetExpectedBucketOwner()) + { + request.Headers["x-amz-expected-bucket-owner"] = publicRequest.ExpectedBucketOwner; + } + + if (publicRequest.IsSetRequestPayer()) + { + request.Headers["x-amz-request-payer"] = publicRequest.RequestPayer; + } + if (string.IsNullOrEmpty(publicRequest.BucketName)) + throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetObjectLegalHoldRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.Key)) + throw new System.ArgumentException("Key is a required property and must be set before making this call.", "GetObjectLegalHoldRequest.Key"); + request.AddPathResource("{Key+}", StringUtils.FromString(publicRequest.Key)); if (publicRequest.IsSetVersionId()) request.Parameters.Add("versionId", StringUtils.FromString(publicRequest.VersionId)); - request.ResourcePath = uriResourcePath; - + request.ResourcePath = "/{Key+}"; request.UseQueryString = true; + PostMarshallCustomization(request, publicRequest); return request; } - - private static GetObjectLegalHoldRequestMarshaller _instance; + private static GetObjectLegalHoldRequestMarshaller _instance = new GetObjectLegalHoldRequestMarshaller(); + + internal static GetObjectLegalHoldRequestMarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for marshaller - /// + /// Gets the singleton. + /// public static GetObjectLegalHoldRequestMarshaller Instance { get { - if (_instance == null) - { - _instance = new GetObjectLegalHoldRequestMarshaller(); - } return _instance; } } + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetObjectLegalHoldRequest publicRequest); } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLegalHoldResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLegalHoldResponseUnmarshaller.cs similarity index 68% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLegalHoldResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLegalHoldResponseUnmarshaller.cs index 14776f115a32..13b0e79b2164 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLegalHoldResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLegalHoldResponseUnmarshaller.cs @@ -30,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -54,7 +55,10 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectLe { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) @@ -74,8 +78,37 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectLe return; } - private static GetObjectLegalHoldResponseUnmarshaller _instance; - + + + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + private static GetObjectLegalHoldResponseUnmarshaller _instance = new GetObjectLegalHoldResponseUnmarshaller(); + + internal static GetObjectLegalHoldResponseUnmarshaller GetInstance() + { + return _instance; + } + /// /// Gets the singleton. /// @@ -83,10 +116,6 @@ public static GetObjectLegalHoldResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new GetObjectLegalHoldResponseUnmarshaller(); - } return _instance; } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLockConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLockConfigurationRequestMarshaller.cs similarity index 70% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLockConfigurationRequestMarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLockConfigurationRequestMarshaller.cs index 5a282dab2b16..a1fccf509fdd 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLockConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLockConfigurationRequestMarshaller.cs @@ -29,14 +29,14 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using System.Xml; -using Amazon.S3.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// /// GetObjectLockConfiguration Request Marshaller /// - public class GetObjectLockConfigurationRequestMarshaller : IMarshaller , IMarshaller + public partial class GetObjectLockConfigurationRequestMarshaller : IMarshaller , IMarshaller { /// /// Marshaller the request object to the HTTP request. @@ -55,38 +55,39 @@ public IRequest Marshall(AmazonWebServiceRequest input) /// public IRequest Marshall(GetObjectLockConfigurationRequest publicRequest) { - var request = new DefaultRequest(publicRequest, "AmazonS3"); + var request = new DefaultRequest(publicRequest, "Amazon.S3"); request.HttpMethod = "GET"; - - if (publicRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(publicRequest.ExpectedBucketOwner)); - - string uriResourcePath = "/"; request.AddSubResource("object-lock"); - if (!publicRequest.IsSetBucketName()) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "publicRequest.BucketName"); - request.ResourcePath = uriResourcePath; - + + 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.", "GetObjectLockConfigurationRequest.BucketName"); + request.ResourcePath = "/"; + PostMarshallCustomization(request, publicRequest); return request; } - - private static GetObjectLockConfigurationRequestMarshaller _instance; + private static GetObjectLockConfigurationRequestMarshaller _instance = new GetObjectLockConfigurationRequestMarshaller(); + + internal static GetObjectLockConfigurationRequestMarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for marshaller - /// + /// Gets the singleton. + /// public static GetObjectLockConfigurationRequestMarshaller Instance { get { - if (_instance == null) - { - _instance = new GetObjectLockConfigurationRequestMarshaller(); - } return _instance; } } + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetObjectLockConfigurationRequest publicRequest); } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLockConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLockConfigurationResponseUnmarshaller.cs similarity index 69% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLockConfigurationResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLockConfigurationResponseUnmarshaller.cs index b97586050867..e4e3bb39a265 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectLockConfigurationResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectLockConfigurationResponseUnmarshaller.cs @@ -30,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -54,7 +55,10 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectLo { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) @@ -74,8 +78,37 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectLo return; } - private static GetObjectLockConfigurationResponseUnmarshaller _instance; - + + + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + private static GetObjectLockConfigurationResponseUnmarshaller _instance = new GetObjectLockConfigurationResponseUnmarshaller(); + + internal static GetObjectLockConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + /// /// Gets the singleton. /// @@ -83,10 +116,6 @@ public static GetObjectLockConfigurationResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new GetObjectLockConfigurationResponseUnmarshaller(); - } return _instance; } } diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/NoSuchKeyExceptionUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/NoSuchKeyExceptionUnmarshaller.cs new file mode 100644 index 000000000000..4de29c1e5ec4 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/NoSuchKeyExceptionUnmarshaller.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.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 NoSuchKeyException operation + /// + public class NoSuchKeyExceptionUnmarshaller : IXmlErrorResponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public NoSuchKeyException Unmarshall(XmlUnmarshallerContext context) + { + throw new NotImplementedException(); + } + + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + /// + public NoSuchKeyException Unmarshall(XmlUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) + { + NoSuchKeyException response = new NoSuchKeyException(errorResponse.Message, errorResponse.InnerException, + errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); + + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + } + } + return response; + } + + private static NoSuchKeyExceptionUnmarshaller _instance = new NoSuchKeyExceptionUnmarshaller(); + + /// + /// Gets the singleton. + /// + public static NoSuchKeyExceptionUnmarshaller Instance + { + get + { + return _instance; + } + } + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockConfigurationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockConfigurationUnmarshaller.cs similarity index 93% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockConfigurationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockConfigurationUnmarshaller.cs index ea8a3872addb..09ada6eae663 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockConfigurationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockConfigurationUnmarshaller.cs @@ -30,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -75,23 +76,17 @@ public ObjectLockConfiguration Unmarshall(XmlUnmarshallerContext context) } return unmarshalledObject; } - - private static ObjectLockConfigurationUnmarshaller _instance; + private static ObjectLockConfigurationUnmarshaller _instance = new ObjectLockConfigurationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static ObjectLockConfigurationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new ObjectLockConfigurationUnmarshaller(); - } return _instance; } } - } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockLegalHoldUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockLegalHoldUnmarshaller.cs similarity index 92% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockLegalHoldUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockLegalHoldUnmarshaller.cs index 5a029b8d2ff1..9318264a2326 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockLegalHoldUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockLegalHoldUnmarshaller.cs @@ -30,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -69,23 +70,17 @@ public ObjectLockLegalHold Unmarshall(XmlUnmarshallerContext context) } return unmarshalledObject; } - - private static ObjectLockLegalHoldUnmarshaller _instance; + private static ObjectLockLegalHoldUnmarshaller _instance = new ObjectLockLegalHoldUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static ObjectLockLegalHoldUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new ObjectLockLegalHoldUnmarshaller(); - } return _instance; } } - } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockRuleUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockRuleUnmarshaller.cs similarity index 91% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockRuleUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockRuleUnmarshaller.cs index e9abd84c89f0..e8aaf18aa559 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockRuleUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockRuleUnmarshaller.cs @@ -30,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -69,23 +70,17 @@ public ObjectLockRule Unmarshall(XmlUnmarshallerContext context) } return unmarshalledObject; } - - private static ObjectLockRuleUnmarshaller _instance; + private static ObjectLockRuleUnmarshaller _instance = new ObjectLockRuleUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static ObjectLockRuleUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new ObjectLockRuleUnmarshaller(); - } return _instance; } } - } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectPartUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectPartUnmarshaller.cs similarity index 90% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectPartUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectPartUnmarshaller.cs index c4ea3727e554..aa8e38e33170 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectPartUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectPartUnmarshaller.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,6 +13,9 @@ * 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; @@ -27,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -44,10 +48,10 @@ public ObjectPart Unmarshall(XmlUnmarshallerContext context) ObjectPart unmarshalledObject = new ObjectPart(); 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) @@ -84,13 +88,13 @@ public ObjectPart Unmarshall(XmlUnmarshallerContext context) } if (context.TestExpression("PartNumber", targetDepth)) { - var unmarshaller = IntUnmarshaller.Instance; + var unmarshaller = NullableIntUnmarshaller.Instance; unmarshalledObject.PartNumber = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Size", targetDepth)) { - var unmarshaller = LongUnmarshaller.Instance; + var unmarshaller = NullableLongUnmarshaller.Instance; unmarshalledObject.Size = unmarshaller.Unmarshall(context); continue; } @@ -99,11 +103,10 @@ public ObjectPart Unmarshall(XmlUnmarshallerContext context) { return unmarshalledObject; } - } + } return unmarshalledObject; } - - private static ObjectPartUnmarshaller _instance = new ObjectPartUnmarshaller(); + private static ObjectPartUnmarshaller _instance = new ObjectPartUnmarshaller(); /// /// Gets the singleton. diff --git a/sdk/src/Services/S3/Generated/Model/NoSuchKeyException.cs b/sdk/src/Services/S3/Generated/Model/NoSuchKeyException.cs new file mode 100644 index 000000000000..5e5556afce6f --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/NoSuchKeyException.cs @@ -0,0 +1,120 @@ +/* + * 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 specified key does not exist. + /// + #if !NETSTANDARD + [Serializable] + #endif + public partial class NoSuchKeyException : AmazonS3Exception + { + + /// + /// Constructs a new NoSuchKeyException with the specified error + /// message. + /// + /// + /// Describes the error encountered. + /// + public NoSuchKeyException(string message) + : base(message) {} + + /// + /// Construct instance of NoSuchKeyException + /// + /// + /// + public NoSuchKeyException(string message, Exception innerException) + : base(message, innerException) {} + + /// + /// Construct instance of NoSuchKeyException + /// + /// + public NoSuchKeyException(Exception innerException) + : base(innerException) {} + + /// + /// Construct instance of NoSuchKeyException + /// + /// + /// + /// + /// + /// + /// + public NoSuchKeyException(string message, Exception innerException, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) + : base(message, innerException, errorType, errorCode, requestId, statusCode) {} + + /// + /// Construct instance of NoSuchKeyException + /// + /// + /// + /// + /// + /// + public NoSuchKeyException(string message, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) + : base(message, errorType, errorCode, requestId, statusCode) {} + + +#if !NETSTANDARD + /// + /// Constructs a new instance of the NoSuchKeyException class with serialized data. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + /// The parameter is null. + /// The class name is null or is zero (0). + protected NoSuchKeyException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) + : base(info, context) + { + } + + /// + /// Sets the with information about the exception. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + /// The parameter is a null reference (Nothing in Visual Basic). + [System.Security.SecurityCritical] + // These FxCop rules are giving false-positives for this method + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")] + public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) + { + base.GetObjectData(info, context); + } +#endif + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/ObjectLockConfiguration.cs b/sdk/src/Services/S3/Generated/Model/ObjectLockConfiguration.cs similarity index 76% rename from sdk/src/Services/S3/Custom/Model/ObjectLockConfiguration.cs rename to sdk/src/Services/S3/Generated/Model/ObjectLockConfiguration.cs index 68c1524fdf2f..bbcef9dbbcbd 100644 --- a/sdk/src/Services/S3/Custom/Model/ObjectLockConfiguration.cs +++ b/sdk/src/Services/S3/Generated/Model/ObjectLockConfiguration.cs @@ -21,10 +21,12 @@ 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 { /// @@ -38,7 +40,8 @@ public partial class ObjectLockConfiguration /// /// Gets and sets the property ObjectLockEnabled. /// - /// Indicates whether this object has an Object Lock configuration enabled. + /// Indicates whether this bucket has an Object Lock configuration enabled. Enable ObjectLockEnabled + /// when you apply ObjectLockConfiguration to a bucket. /// /// public ObjectLockEnabled ObjectLockEnabled @@ -56,7 +59,10 @@ internal bool IsSetObjectLockEnabled() /// /// Gets and sets the property Rule. /// - /// The Object Lock rule in place for the specified object. + /// Specifies the Object Lock rule for the specified object. Enable the this rule when + /// you apply ObjectLockConfiguration to a bucket. Bucket settings require both + /// a mode and a period. The period can be either Days or Years but you + /// must select one. You cannot specify Days and Years at the same time. /// /// public ObjectLockRule Rule diff --git a/sdk/src/Services/S3/Custom/Model/ObjectLockLegalHold.cs b/sdk/src/Services/S3/Generated/Model/ObjectLockLegalHold.cs similarity index 90% rename from sdk/src/Services/S3/Custom/Model/ObjectLockLegalHold.cs rename to sdk/src/Services/S3/Generated/Model/ObjectLockLegalHold.cs index 8f7073d04d52..f525471204b3 100644 --- a/sdk/src/Services/S3/Custom/Model/ObjectLockLegalHold.cs +++ b/sdk/src/Services/S3/Generated/Model/ObjectLockLegalHold.cs @@ -26,10 +26,11 @@ using Amazon.Runtime; using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// A Legal Hold configuration for an object. + /// A legal hold configuration for an object. /// public partial class ObjectLockLegalHold { @@ -38,7 +39,7 @@ public partial class ObjectLockLegalHold /// /// Gets and sets the property Status. /// - /// Indicates whether the specified object has a Legal Hold in place. + /// Indicates whether the specified object has a legal hold in place. /// /// public ObjectLockLegalHoldStatus Status diff --git a/sdk/src/Services/S3/Custom/Model/ObjectLockRule.cs b/sdk/src/Services/S3/Generated/Model/ObjectLockRule.cs similarity index 78% rename from sdk/src/Services/S3/Custom/Model/ObjectLockRule.cs rename to sdk/src/Services/S3/Generated/Model/ObjectLockRule.cs index 65edc3d33d82..16e693cc45de 100644 --- a/sdk/src/Services/S3/Custom/Model/ObjectLockRule.cs +++ b/sdk/src/Services/S3/Generated/Model/ObjectLockRule.cs @@ -21,10 +21,12 @@ 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 { /// @@ -37,8 +39,10 @@ public partial class ObjectLockRule /// /// Gets and sets the property DefaultRetention. /// - /// The default retention period that you want to apply to new objects placed in the specified - /// bucket. + /// The default Object Lock retention mode and period that you want to apply to new objects + /// placed in the specified bucket. Bucket settings require both a mode and a period. + /// The period can be either Days or Years but you must select one. You + /// cannot specify Days and Years at the same time. /// /// public DefaultRetention DefaultRetention diff --git a/sdk/src/Services/S3/Custom/Model/ObjectPart.cs b/sdk/src/Services/S3/Generated/Model/ObjectPart.cs similarity index 79% rename from sdk/src/Services/S3/Custom/Model/ObjectPart.cs rename to sdk/src/Services/S3/Generated/Model/ObjectPart.cs index b5345ebd5f90..ae8cddf006eb 100644 --- a/sdk/src/Services/S3/Custom/Model/ObjectPart.cs +++ b/sdk/src/Services/S3/Generated/Model/ObjectPart.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,6 +13,9 @@ * 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; @@ -23,10 +26,11 @@ using Amazon.Runtime; using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// Container for elements related to an individual part. + /// A container for elements related to an individual part. /// public partial class ObjectPart { @@ -41,8 +45,8 @@ public partial class ObjectPart /// /// Gets and sets the property ChecksumCRC32. /// - /// The Base64 encoded, 32-bit CRC-32 checksum of the part. This checksum is only present - /// if the multipart upload request was created with the CRC-32 checksum algorithm. + /// The Base64 encoded, 32-bit CRC32 checksum of the part. This checksum is present + /// if the multipart upload request was created with the CRC32 checksum algorithm. /// For more information, see Checking /// object integrity in the Amazon S3 User Guide. /// @@ -62,8 +66,8 @@ internal bool IsSetChecksumCRC32() /// /// Gets and sets the property ChecksumCRC32C. /// - /// The Base64 encoded, 32-bit CRC-32C checksum of the part. This checksum is only present - /// if the multipart upload request was created with the CRC-32C checksum algorithm. + /// The Base64 encoded, 32-bit CRC32C checksum of the part. This checksum is present + /// if the multipart upload request was created with the CRC32C checksum algorithm. /// For more information, see Checking /// object integrity in the Amazon S3 User Guide. /// @@ -83,10 +87,11 @@ internal bool IsSetChecksumCRC32C() /// /// Gets and sets the property ChecksumCRC64NVME. /// - /// The Base64 encoded, 64-bit CRC-64NVME checksum of the part. This checksum is only present - /// if the multipart upload request was created with the CRC-64NVME checksum algorithm, or if the object was uploaded without - /// a checksum (and Amazon S3 added the default checksum, CRC-64NVME, to the uploaded object). - /// For more information, see Checking + /// The Base64 encoded, 64-bit CRC64NVME checksum of the part. This checksum is + /// present if the multipart upload request was created with the CRC64NVME checksum + /// algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the + /// default checksum, CRC64NVME, to the uploaded object). For more information, + /// see Checking /// object integrity in the Amazon S3 User Guide. /// /// @@ -105,8 +110,8 @@ internal bool IsSetChecksumCRC64NVME() /// /// Gets and sets the property ChecksumSHA1. /// - /// The Base64 encoded, 160-bit SHA-1 checksum of the part. This checksum is only present - /// if the multipart upload request was created with the SHA-1 checksum algorithm. + /// The Base64 encoded, 160-bit SHA1 checksum of the part. This checksum is present + /// if the multipart upload request was created with the SHA1 checksum algorithm. /// For more information, see Checking /// object integrity in the Amazon S3 User Guide. /// @@ -126,10 +131,10 @@ internal bool IsSetChecksumSHA1() /// /// Gets and sets the property ChecksumSHA256. /// - /// The Base64 encoded, 256-bit SHA-256 checksum of the part. - /// This checksum is present if the multipart upload request was created with the SHA-256 checksum algorithm. - /// For more information, see - /// Checking object integrity in the Amazon S3 User Guide. + /// The Base64 encoded, 256-bit SHA256 checksum of the part. This checksum is present + /// if the multipart upload request was created with the SHA256 checksum algorithm. + /// For more information, see Checking + /// object integrity in the Amazon S3 User Guide. /// /// public string ChecksumSHA256 @@ -160,7 +165,7 @@ public int? PartNumber // Check to see if PartNumber property is set internal bool IsSetPartNumber() { - return this._partNumber.HasValue; + return this._partNumber.HasValue; } /// @@ -178,7 +183,7 @@ public long? Size // Check to see if Size property is set internal bool IsSetSize() { - return this._size.HasValue; + return this._size.HasValue; } } From a7917452fe92bbbcc55a0e297c71435334b20aef Mon Sep 17 00:00:00 2001 From: Peter Song Date: Mon, 23 Jun 2025 12:28:34 -0700 Subject: [PATCH 2/7] Generate GetObjectRetention and GetObjectTagging, GetPublicAccessBlock --- .../ServiceClientGeneratorLib/ServiceModel.cs | 9 +- .../ServiceModels/s3/s3.customizations.json | 7 + .../Custom/Model/GetObjectTaggingResponse.cs | 39 ---- .../GetObjectTaggingRequestMarshaller.cs | 84 -------- .../GetPublicAccessBlockRequestMarshaller.cs | 72 ------- .../Model/PublicAccessBlockConfiguration.cs | 203 ------------------ .../Model/GetObjectRetentionRequest.cs | 70 +++--- .../Model/GetObjectRetentionResponse.cs | 2 + .../Model/GetObjectTaggingRequest.cs | 126 +++++------ .../Model/GetObjectTaggingResponse.cs | 82 +++++++ .../Model/GetPublicAccessBlockRequest.cs | 58 ++--- .../Model/GetPublicAccessBlockResponse.cs | 24 ++- .../GetObjectRetentionRequestMarshaller.cs | 50 +++-- .../GetObjectRetentionResponseUnmarshaller.cs | 43 +++- .../GetObjectTaggingRequestMarshaller.cs | 105 +++++++++ .../GetObjectTaggingResponseUnmarshaller.cs | 96 ++++++--- .../GetPublicAccessBlockRequestMarshaller.cs | 93 ++++++++ ...etPublicAccessBlockResponseUnmarshaller.cs | 85 ++++++-- .../ObjectLockRetentionUnmarshaller.cs | 15 +- ...icAccessBlockConfigurationUnmarshaller.cs} | 68 +++--- .../Model/ObjectLockRetention.cs | 14 +- .../Model/PublicAccessBlockConfiguration.cs | 158 ++++++++++++++ 22 files changed, 842 insertions(+), 661 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/GetObjectTaggingResponse.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectTaggingRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetPublicAccessBlockRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/PublicAccessBlockConfiguration.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectRetentionRequest.cs (60%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectRetentionResponse.cs (96%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetObjectTaggingRequest.cs (51%) create mode 100644 sdk/src/Services/S3/Generated/Model/GetObjectTaggingResponse.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/GetPublicAccessBlockRequest.cs (64%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetPublicAccessBlockResponse.cs (65%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectRetentionRequestMarshaller.cs (66%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectRetentionResponseUnmarshaller.cs (68%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectTaggingRequestMarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetObjectTaggingResponseUnmarshaller.cs (50%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetPublicAccessBlockRequestMarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/GetPublicAccessBlockResponseUnmarshaller.cs (51%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ObjectLockRetentionUnmarshaller.cs (91%) rename sdk/src/Services/S3/{Custom/Model/Internal/MarshallTransformations/PublicBlockConfigurationUnmarshaller.cs => Generated/Model/Internal/MarshallTransformations/PublicAccessBlockConfigurationUnmarshaller.cs} (55%) rename sdk/src/Services/S3/{Custom => Generated}/Model/ObjectLockRetention.cs (82%) create mode 100644 sdk/src/Services/S3/Generated/Model/PublicAccessBlockConfiguration.cs diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 5fd520952705..3c8c1abae1f2 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -500,9 +500,9 @@ public List S3AllowListOperations new Operation(this, "GetObjectAttributes", DocumentRoot[OperationsKey]["GetObjectAttributes"]), new Operation(this, "GetObjectLegalHold", DocumentRoot[OperationsKey]["GetObjectLegalHold"]), new Operation(this, "GetObjectLockConfiguration", DocumentRoot[OperationsKey]["GetObjectLockConfiguration"]), - //new Operation(this, "GetObjectRetention", DocumentRoot[OperationsKey]["GetObjectRetention"]), - //new Operation(this, "GetObjectTagging", DocumentRoot[OperationsKey]["GetObjectTagging"]), - //new Operation(this, "GetPublicAccessBlock", DocumentRoot[OperationsKey]["GetPublicAccessBlock"]), + new Operation(this, "GetObjectRetention", DocumentRoot[OperationsKey]["GetObjectRetention"]), + new Operation(this, "GetObjectTagging", DocumentRoot[OperationsKey]["GetObjectTagging"]), + new Operation(this, "GetPublicAccessBlock", DocumentRoot[OperationsKey]["GetPublicAccessBlock"]), //new Operation(this, "HeadBucket", DocumentRoot[OperationsKey]["HeadBucket"]), //new Operation(this, "ListBucketAnalyticsConfigurations", DocumentRoot[OperationsKey]["ListBucketAnalyticsConfigurations"]), //new Operation(this, "ListBucketIntelligentTieringConfigurations", DocumentRoot[OperationsKey]["ListBucketIntelligentTieringConfigurations"]), @@ -543,7 +543,8 @@ public List S3AddParametersList { "ListBuckets", "ListDirectoryBuckets", - "GetObjectLegalHold" + "GetObjectLegalHold", + "GetObjectRetention" }; } return _s3AddParametersList; diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index c3e1615127d2..e741ada70ed1 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -137,6 +137,13 @@ } ] }, + "GetObjectTaggingOutput":{ + "modify":[ + { + "TagSet": {"emitPropertyName": "Tagging"} + } + ] + }, "LifecycleRule": { "modify": [ { diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectTaggingResponse.cs b/sdk/src/Services/S3/Custom/Model/GetObjectTaggingResponse.cs deleted file mode 100644 index 95b61a78c786..000000000000 --- a/sdk/src/Services/S3/Custom/Model/GetObjectTaggingResponse.cs +++ /dev/null @@ -1,39 +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.Runtime; - -namespace Amazon.S3.Model -{ - /// - /// Returns information about the GetObjectTagging response and response metadata. - /// - public partial class GetObjectTaggingResponse : AmazonWebServiceResponse - { - private List tagging = AWSConfigs.InitializeCollections ? new List() : null; - - /// - /// Gets or sets tag-set for a given object - /// - public List Tagging - { - get { return this.tagging; } - set { this.tagging = value; } - } - } -} - diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectTaggingRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectTaggingRequestMarshaller.cs deleted file mode 100644 index cd16ab08d466..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectTaggingRequestMarshaller.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.S3.Util; -using System.Globalization; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// GetObjectTaggingRequest Marshaller - /// - public class GetObjectTaggingRequestMarshaller : IMarshaller ,IMarshaller - { - /// - /// Marshall GetObjectTaggingRequest into an http request. - /// - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((GetObjectTaggingRequest)input); - } - - /// - /// Marshall GetObjectTaggingRequest into an http request. - /// - public IRequest Marshall(GetObjectTaggingRequest getObjectTaggingRequest) - { - IRequest request = new DefaultRequest(getObjectTaggingRequest, "AmazonS3"); - - request.HttpMethod = "GET"; - - if (getObjectTaggingRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getObjectTaggingRequest.ExpectedBucketOwner)); - if (getObjectTaggingRequest.IsSetRequestPayer()) - request.Headers.Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(getObjectTaggingRequest.RequestPayer)); - - request.UseQueryString = true; - - if (string.IsNullOrEmpty(getObjectTaggingRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetObjectTaggingRequest.BucketName"); - if (string.IsNullOrEmpty(getObjectTaggingRequest.Key)) - throw new System.ArgumentException("Key is a required property and must be set before making this call.", "GetObjectTaggingRequest.Key"); - request.AddPathResource("{Key+}", S3Transforms.ToStringValue(getObjectTaggingRequest.Key)); - request.ResourcePath = "/{Key+}"; - - request.AddSubResource("tagging"); - - if (getObjectTaggingRequest.IsSetVersionId()) - request.AddSubResource("versionId", getObjectTaggingRequest.VersionId); - - return request; - } - - private static GetObjectTaggingRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static GetObjectTaggingRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetObjectTaggingRequestMarshaller(); - } - return _instance; - } - } - } -} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetPublicAccessBlockRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetPublicAccessBlockRequestMarshaller.cs deleted file mode 100644 index 9c0ad6577031..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetPublicAccessBlockRequestMarshaller.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.S3.Util; -using System.Globalization; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// GetPublicAccessBlockRequestMarshaller - /// - public class GetPublicAccessBlockRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((GetPublicAccessBlockRequest)input); - } - - public IRequest Marshall(GetPublicAccessBlockRequest getPublicAccessBlockRequest) - { - IRequest request = new DefaultRequest(getPublicAccessBlockRequest, "AmazonS3"); - - request.HttpMethod = "GET"; - - if (getPublicAccessBlockRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getPublicAccessBlockRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(getPublicAccessBlockRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "getPublicAccessBlockRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("publicAccessBlock"); - request.UseQueryString = true; - - return request; - } - - private static GetPublicAccessBlockRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static GetPublicAccessBlockRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetPublicAccessBlockRequestMarshaller(); - } - return _instance; - } - } - } -} - diff --git a/sdk/src/Services/S3/Custom/Model/PublicAccessBlockConfiguration.cs b/sdk/src/Services/S3/Custom/Model/PublicAccessBlockConfiguration.cs deleted file mode 100644 index f29bcadab141..000000000000 --- a/sdk/src/Services/S3/Custom/Model/PublicAccessBlockConfiguration.cs +++ /dev/null @@ -1,203 +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 container element for all Public Access Block configuration options. You can enable - /// the configuration options in any combination. - /// - /// - /// - /// Amazon S3 considers a bucket policy public unless at least one of the following conditions - /// is true: - /// - ///
  1. - /// - /// The policy limits access to a set of CIDRs using aws:SourceIp. For more - /// information on CIDR, see http://www.rfc-editor.org/rfc/rfc4632.txt - /// - /// - ///
  2. - /// - /// The policy grants permissions, not including any "bad actions," to one of the following: - /// - ///
    • - /// - /// A fixed AWS principal, user, role, or service principal - /// - ///
    • - /// - /// A fixed aws:SourceArn - /// - ///
    • - /// - /// A fixed aws:SourceVpc - /// - ///
    • - /// - /// A fixed aws:SourceVpce - /// - ///
    • - /// - /// A fixed aws:SourceOwner - /// - ///
    • - /// - /// A fixed aws:SourceAccount - /// - ///
    • - /// - /// A fixed value of s3:x-amz-server-side-encryption-aws-kms-key-id - /// - ///
    • - /// - /// A fixed value of aws:userid outside the pattern "AROLEID:*" - /// - ///
- /// - /// "Bad actions" are those that could expose the data inside a bucket to reads or writes - /// by the public. These actions are s3:Get*, s3:List*, s3:AbortMultipartUpload, - /// s3:Delete*, s3:Put*, and s3:RestoreObject. - /// - /// - /// - /// The star notation for bad actions indicates that all matching operations are considered - /// bad actions. For example, because s3:Get* is a bad action, s3:GetObject, - /// s3:GetObjectVersion, and s3:GetObjectAcl are all bad actions. - /// - ///
- public class PublicAccessBlockConfiguration - { - private bool? blockPublicAcls; - private bool? ignorePublicAcls; - private bool? blockPublicPolicy; - private bool? restrictPublicBuckets; - - /// - /// Gets and sets the property BlockPublicAcls. - /// - /// Specifies whether Amazon S3 should block public ACLs for this bucket. Setting this - /// element to TRUE causes the following behavior: - /// - ///
  • - /// - /// PUT Bucket acl and PUT Object acl calls will fail if the specified ACL allows public - /// access. - /// - ///
  • - /// - /// PUT Object calls will fail if the request includes an object ACL. - /// - ///
- /// - /// Note that enabling this setting doesn't affect existing policies or ACLs. - /// - ///
- public bool? BlockPublicAcls - { - get { return this.blockPublicAcls; } - set { this.blockPublicAcls = value; } - } - - // Check to see if BlockPublicAcls property is set - internal bool IsSetBlockPublicAcls() - { - return this.blockPublicAcls.HasValue; - } - - /// - /// Gets and sets the property IgnorePublicAcls. - /// - /// Specifies whether Amazon S3 should ignore public ACLs for this bucket. Setting this - /// element to TRUE causes Amazon S3 to ignore all public ACLs on this bucket - /// and any objects that it contains. - /// - /// - /// - /// Note that enabling this setting doesn't affect the persistence of any existing ACLs - /// and doesn't prevent new public ACLs from being set. - /// - /// - public bool? IgnorePublicAcls - { - get { return this.ignorePublicAcls; } - set { this.ignorePublicAcls = value; } - } - - // Check to see if IgnorePublicAcls property is set - internal bool IsSetIgnorePublicAcls() - { - return this.ignorePublicAcls.HasValue; - } - - /// - /// Gets and sets the property BlockPublicPolicy. - /// - /// Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting - /// this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy - /// if the specified bucket policy allows public access. - /// - /// - /// - /// Note that enabling this setting doesn't affect existing bucket policies. - /// - /// - public bool? BlockPublicPolicy - { - get { return this.blockPublicPolicy; } - set { this.blockPublicPolicy = value; } - } - - // Check to see if BlockPublicPolicy property is set - internal bool IsSetBlockPublicPolicy() - { - return this.blockPublicPolicy.HasValue; - } - - /// - /// Gets and sets the property RestrictPublicBuckets. - /// - /// Specifies whether Amazon S3 should restrict public bucket policies for this bucket. - /// Setting this element to TRUE restricts access to this bucket to only - /// Amazon Web Service principals and authorized users within this account if the bucket - /// has a public policy. - /// - /// - /// - /// Enabling this setting doesn't affect previously stored bucket policies, except that - /// public and cross-account access within any public bucket policy, including non-public - /// delegation to specific accounts, is blocked. - /// - /// - public bool? RestrictPublicBuckets - { - get { return this.restrictPublicBuckets; } - set { this.restrictPublicBuckets = value; } - } - - // Check to see if RestrictPublicBuckets property is set - internal bool IsSetRestrictPublicBuckets() - { - return this.restrictPublicBuckets.HasValue; - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectRetentionRequest.cs b/sdk/src/Services/S3/Generated/Model/GetObjectRetentionRequest.cs similarity index 60% rename from sdk/src/Services/S3/Custom/Model/GetObjectRetentionRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectRetentionRequest.cs index 1700c38fad44..2bcba8a88792 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectRetentionRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectRetentionRequest.cs @@ -21,17 +21,19 @@ 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 GetObjectRetention operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -44,7 +46,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following action is related to GetObjectRetention: + /// The following action is related to GetObjectRetention: /// ///
  • /// @@ -56,7 +58,7 @@ namespace Amazon.S3.Model public partial class GetObjectRetentionRequest : AmazonWebServiceRequest { private string _bucketName; - private string expectedBucketOwner; + private string _expectedBucketOwner; private string _key; private RequestPayer _requestPayer; private string _versionId; @@ -64,18 +66,21 @@ public partial class GetObjectRetentionRequest : AmazonWebServiceRequest /// /// Gets and sets the property BucketName. /// - /// The bucket name containing the object whose retention settings you want to retrieve. - /// - /// - /// Access points - When you use this action with an access point for general purpose buckets, you must provide - /// the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action - /// with an access point for directory buckets, you must provide the access point name in place of the bucket name. When - /// using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes - /// the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action - /// with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket - /// name. For more information about access point ARNs, see - /// Using access points in - /// the Amazon S3 User Guide. + /// The bucket name containing the object whose retention settings you want to retrieve. + /// + /// + /// + /// + /// Access points - When you use this action with an access point for general + /// purpose buckets, you must provide the alias of the access point in place of the bucket + /// name or specify the access point ARN. When you use this action with an access point + /// for directory buckets, you must provide the access point name in place of the bucket + /// name. When using the access point ARN, you must direct requests to the access point + /// hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + /// When using this action with an access point through the Amazon Web Services SDKs, + /// you provide the access point ARN in place of the bucket name. For more information + /// about access point ARNs, see Using + /// access points in the Amazon S3 User Guide. /// /// public string BucketName @@ -87,7 +92,7 @@ public string BucketName // Check to see if BucketName property is set internal bool IsSetBucketName() { - return !string.IsNullOrEmpty(this._bucketName); + return this._bucketName != null; } /// @@ -95,22 +100,19 @@ internal bool IsSetBucketName() /// /// 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 this._expectedBucketOwner != null; } /// @@ -119,21 +121,7 @@ internal bool IsSetExpectedBucketOwner() /// The key name for the object whose retention settings you want to retrieve. /// /// - /// - /// - /// This property will be used as part of the resource path of the HTTP request. In .NET the System.Uri class - /// is used to construct the uri for the request. The System.Uri class will canonicalize the uri string by compacting characters like "..". - /// For example an object key of "foo/../bar/file.txt" will be transformed into "bar/file.txt" because the ".." - /// is interpreted as use parent directory. - /// - /// - /// Starting with .NET 8, the AWS .NET SDK disables System.Uri's feature of canonicalizing the resource path. This allows S3 keys like - /// "foo/../bar/file.txt" to work correctly with the AWS .NET SDK. - /// - /// - /// For further information view the documentation for the Uri class: https://docs.microsoft.com/en-us/dotnet/api/system.uri - /// - /// + [AWSProperty(Required=true, Min=1)] public string Key { get { return this._key; } @@ -143,7 +131,7 @@ public string Key // Check to see if Key property is set internal bool IsSetKey() { - return !string.IsNullOrEmpty(this._key); + return this._key != null; } /// @@ -176,7 +164,7 @@ public string VersionId // Check to see if VersionId property is set internal bool IsSetVersionId() { - return !string.IsNullOrEmpty(this._versionId); + return this._versionId != null; } } diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectRetentionResponse.cs b/sdk/src/Services/S3/Generated/Model/GetObjectRetentionResponse.cs similarity index 96% rename from sdk/src/Services/S3/Custom/Model/GetObjectRetentionResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectRetentionResponse.cs index 93f34fdf4071..ea4539b62909 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectRetentionResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectRetentionResponse.cs @@ -21,10 +21,12 @@ 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 { /// diff --git a/sdk/src/Services/S3/Custom/Model/GetObjectTaggingRequest.cs b/sdk/src/Services/S3/Generated/Model/GetObjectTaggingRequest.cs similarity index 51% rename from sdk/src/Services/S3/Custom/Model/GetObjectTaggingRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetObjectTaggingRequest.cs index 69ce502e0b1c..670bea766a42 100644 --- a/sdk/src/Services/S3/Custom/Model/GetObjectTaggingRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectTaggingRequest.cs @@ -13,16 +13,27 @@ * permissions and limitations under the License. */ -using Amazon.Runtime; +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// /// Container for the parameters to the GetObjectTagging operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -31,11 +42,11 @@ namespace Amazon.S3.Model /// /// /// - /// To use this operation, you must have permission to perform the s3:GetObjectTagging + /// To use this operation, you must have permission to perform the s3:GetObjectTagging /// action. By default, the GET action returns information about current version of an /// object. For a versioned bucket, you can have multiple versions of an object in your /// bucket. To retrieve tags of any other version, use the versionId query parameter. - /// You also need permission for the s3:GetObjectVersionTagging action. + /// You also need permission for the s3:GetObjectVersionTagging action. /// /// /// @@ -49,7 +60,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following actions are related to GetObjectTagging: + /// The following actions are related to GetObjectTagging: /// ///
    • /// @@ -70,46 +81,51 @@ namespace Amazon.S3.Model ///
    public partial class GetObjectTaggingRequest : AmazonWebServiceRequest { - private string bucketName; - private string expectedBucketOwner; - private string key; - private RequestPayer requestPayer; - private string versionId; + private string _bucketName; + private string _expectedBucketOwner; + private string _key; + private RequestPayer _requestPayer; + private string _versionId; /// /// Gets and sets the property BucketName. /// /// The bucket name containing the object for which to get the tagging information. - /// - /// - /// Access points - When you use this action with an access point for general purpose buckets, you - /// must provide the alias of the access point in place of the bucket name or specify the access point - /// ARN. When you use this action with an access point for directory buckets, you must provide the access - /// point name in place of the bucket name. When using the access point ARN, you must direct requests to - /// the access point hostname. The access point hostname takes the - /// form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - /// action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in - /// place of the bucket name. For more information about access point ARNs, see - /// Using access points in - /// the Amazon S3 User Guide. S3 on Outposts - When you use this action with S3 on - /// Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes - /// the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - /// you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or - /// the access point alias. For more information about S3 on Outposts, see - /// What is S3 on Outposts? in - /// the Amazon S3 User Guide. + /// + /// + /// + /// Access points - When you use this action with an access point for general + /// purpose buckets, you must provide the alias of the access point in place of the bucket + /// name or specify the access point ARN. When you use this action with an access point + /// for directory buckets, you must provide the access point name in place of the bucket + /// name. When using the access point ARN, you must direct requests to the access point + /// hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + /// When using this action with an access point through the Amazon Web Services SDKs, + /// you provide the access point ARN in place of the bucket name. For more information + /// about access point ARNs, see Using + /// access points in the Amazon S3 User Guide. + /// + /// + /// + /// S3 on Outposts - When you use this action with S3 on Outposts, you must direct + /// requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form + /// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. + /// When you use this action with S3 on Outposts, the destination bucket must be the Outposts + /// access point ARN or the access point alias. For more information about S3 on Outposts, + /// see What + /// is S3 on Outposts? in the Amazon S3 User Guide. /// /// 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; } /// @@ -117,19 +133,19 @@ internal bool IsSetBucketName() /// /// 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); + return this._expectedBucketOwner != null; } /// @@ -138,47 +154,32 @@ internal bool IsSetExpectedBucketOwner() /// Object key for which to get the tagging information. /// /// - /// - /// - /// This property will be used as part of the resource path of the HTTP request. In .NET the System.Uri class - /// is used to construct the uri for the request. The System.Uri class will canonicalize the uri string by compacting characters like "..". - /// For example an object key of "foo/../bar/file.txt" will be transformed into "bar/file.txt" because the ".." - /// is interpreted as use parent directory. - /// - /// - /// Starting with .NET 8, the AWS .NET SDK disables System.Uri's feature of canonicalizing the resource path. This allows S3 keys like - /// "foo/../bar/file.txt" to work correctly with the AWS .NET SDK. - /// - /// - /// For further information view the documentation for the Uri class: https://docs.microsoft.com/en-us/dotnet/api/system.uri - /// - /// + [AWSProperty(Required=true, Min=1)] public string Key { - get { return this.key; } - set { this.key = value; } + get { return this._key; } + set { this._key = value; } } // Check to see if Key property is set internal bool IsSetKey() { - return !string.IsNullOrEmpty(this.key); + return this._key != null; } /// - /// Confirms that the requester knows that they will be charged for the request. - /// Bucket owners need not specify this parameter in their requests. + /// Gets and sets the property RequestPayer. /// public RequestPayer RequestPayer { - get { return this.requestPayer; } - set { this.requestPayer = value; } + get { return this._requestPayer; } + set { this._requestPayer = value; } } // Check to see if RequestPayer property is set internal bool IsSetRequestPayer() { - return requestPayer != null; + return this._requestPayer != null; } /// @@ -189,16 +190,15 @@ internal bool IsSetRequestPayer() /// public string VersionId { - get { return this.versionId; } - set { this.versionId = value; } + get { return this._versionId; } + set { this._versionId = value; } } // Check to see if VersionId property is set internal bool IsSetVersionId() { - return !string.IsNullOrEmpty(this.versionId); + return this._versionId != null; } } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/GetObjectTaggingResponse.cs b/sdk/src/Services/S3/Generated/Model/GetObjectTaggingResponse.cs new file mode 100644 index 000000000000..12926f185df0 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/GetObjectTaggingResponse.cs @@ -0,0 +1,82 @@ +/* + * 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 GetObjectTagging operation. + /// + public partial class GetObjectTaggingResponse : AmazonWebServiceResponse + { + private List _tagging = AWSConfigs.InitializeCollections ? new List() : null; + private string _versionId; + + /// + /// Gets and sets the property Tagging. + /// + /// Contains the tag set. + /// + /// + /// 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 Tagging + { + get { return this._tagging; } + set { this._tagging = value; } + } + + // Check to see if Tagging property is set + internal bool IsSetTagging() + { + return this._tagging != null && (this._tagging.Count > 0 || !AWSConfigs.InitializeCollections); + } + + /// + /// Gets and sets the property VersionId. + /// + /// The versionId of the object for which you got the tagging information. + /// + /// + public string VersionId + { + get { return this._versionId; } + set { this._versionId = value; } + } + + // Check to see if VersionId property is set + internal bool IsSetVersionId() + { + return this._versionId != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetPublicAccessBlockRequest.cs b/sdk/src/Services/S3/Generated/Model/GetPublicAccessBlockRequest.cs similarity index 64% rename from sdk/src/Services/S3/Custom/Model/GetPublicAccessBlockRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetPublicAccessBlockRequest.cs index 000b2243e732..71234e82a3c1 100644 --- a/sdk/src/Services/S3/Custom/Model/GetPublicAccessBlockRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetPublicAccessBlockRequest.cs @@ -12,38 +12,43 @@ * 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 GetPublicAccessBlock operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// - /// Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. - /// To use this operation, you must have the s3:GetBucketPublicAccessBlock - /// permission. For more information about Amazon S3 permissions, see Specifying + /// Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. To use + /// this operation, you must have the s3:GetBucketPublicAccessBlock permission. + /// For more information about Amazon S3 permissions, see Specifying /// Permissions in a Policy. /// /// /// - /// When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket - /// or an object, it checks the PublicAccessBlock configuration for both - /// the bucket (or the bucket that contains the object) and the bucket owner's account. - /// If the PublicAccessBlock settings are different between the bucket and - /// the account, Amazon S3 uses the most restrictive combination of the bucket-level and - /// account-level settings. + /// When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or + /// an object, it checks the PublicAccessBlock configuration for both the bucket + /// (or the bucket that contains the object) and the bucket owner's account. If the PublicAccessBlock + /// settings are different between the bucket and the account, Amazon S3 uses the most + /// restrictive combination of the bucket-level and account-level settings. /// /// /// @@ -53,7 +58,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following operations are related to GetPublicAccessBlock: + /// The following operations are related to GetPublicAccessBlock: /// ///
    • /// @@ -79,26 +84,26 @@ namespace Amazon.S3.Model ///
    public partial class GetPublicAccessBlockRequest : AmazonWebServiceRequest { - private string bucketName; - private string expectedBucketOwner; + private string _bucketName; + private string _expectedBucketOwner; /// /// Gets and sets the property BucketName. /// - /// The name of the Amazon S3 bucket whose Public Access Block configuration you want - /// to retrieve. + /// The name of the Amazon S3 bucket whose PublicAccessBlock configuration you + /// want to retrieve. /// /// public string BucketName { - get { return this.bucketName; } - set { this.bucketName = value; } + get { return this._bucketName; } + set { this._bucketName = value; } } // Check to see if BucketName property is set internal bool IsSetBucketName() { - return this.BucketName != null; + return this._bucketName != null; } /// @@ -106,23 +111,20 @@ internal bool IsSetBucketName() /// /// 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 this._expectedBucketOwner != null; } + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetPublicAccessBlockResponse.cs b/sdk/src/Services/S3/Generated/Model/GetPublicAccessBlockResponse.cs similarity index 65% rename from sdk/src/Services/S3/Custom/Model/GetPublicAccessBlockResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetPublicAccessBlockResponse.cs index 47e5efbc65ac..888c610eede6 100644 --- a/sdk/src/Services/S3/Custom/Model/GetPublicAccessBlockResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetPublicAccessBlockResponse.cs @@ -12,15 +12,21 @@ * 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 { /// @@ -28,22 +34,26 @@ namespace Amazon.S3.Model /// public partial class GetPublicAccessBlockResponse : AmazonWebServiceResponse { - private PublicAccessBlockConfiguration publicAccessBlockConfiguration; + private PublicAccessBlockConfiguration _publicAccessBlockConfiguration; /// - /// The Public Access Block configuration currently in effect for this Amazon S3 bucket. + /// Gets and sets the property PublicAccessBlockConfiguration. + /// + /// The PublicAccessBlock configuration currently in effect for this Amazon S3 + /// bucket. + /// /// public PublicAccessBlockConfiguration PublicAccessBlockConfiguration { - get { return this.publicAccessBlockConfiguration; } - set { this.publicAccessBlockConfiguration = value; } + get { return this._publicAccessBlockConfiguration; } + set { this._publicAccessBlockConfiguration = value; } } // Check to see if PublicAccessBlockConfiguration property is set internal bool IsSetPublicAccessBlockConfiguration() { - return this.publicAccessBlockConfiguration != null; + return this._publicAccessBlockConfiguration != null; } + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectRetentionRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectRetentionRequestMarshaller.cs similarity index 66% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectRetentionRequestMarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectRetentionRequestMarshaller.cs index 9bf7d068caa0..1819157e465b 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectRetentionRequestMarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectRetentionRequestMarshaller.cs @@ -29,14 +29,14 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using System.Xml; -using Amazon.S3.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// /// GetObjectRetention Request Marshaller /// - public class GetObjectRetentionRequestMarshaller : IMarshaller , IMarshaller + public partial class GetObjectRetentionRequestMarshaller : IMarshaller , IMarshaller { /// /// Marshaller the request object to the HTTP request. @@ -55,47 +55,51 @@ public IRequest Marshall(AmazonWebServiceRequest input) /// public IRequest Marshall(GetObjectRetentionRequest publicRequest) { - var request = new DefaultRequest(publicRequest, "AmazonS3"); + var request = new DefaultRequest(publicRequest, "Amazon.S3"); request.HttpMethod = "GET"; request.AddSubResource("retention"); - if(publicRequest.IsSetRequestPayer()) - request.Headers.Add(S3Constants.AmzHeaderRequestPayer, S3Transforms.ToStringValue(publicRequest.RequestPayer.ToString())); - - if (publicRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(publicRequest.ExpectedBucketOwner)); - - if (!publicRequest.IsSetBucketName()) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "publicRequest.BucketName"); - if (!publicRequest.IsSetKey()) - throw new System.ArgumentException("Key is a required property and must be set before making this call.", "publicRequest.Key"); - request.AddPathResource("{Key+}", S3Transforms.ToStringValue(publicRequest.Key)); + if (publicRequest.IsSetExpectedBucketOwner()) + { + request.Headers["x-amz-expected-bucket-owner"] = publicRequest.ExpectedBucketOwner; + } + + if (publicRequest.IsSetRequestPayer()) + { + request.Headers["x-amz-request-payer"] = publicRequest.RequestPayer; + } + if (string.IsNullOrEmpty(publicRequest.BucketName)) + throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetObjectRetentionRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.Key)) + throw new System.ArgumentException("Key is a required property and must be set before making this call.", "GetObjectRetentionRequest.Key"); + request.AddPathResource("{Key+}", StringUtils.FromString(publicRequest.Key)); if (publicRequest.IsSetVersionId()) request.Parameters.Add("versionId", StringUtils.FromString(publicRequest.VersionId)); request.ResourcePath = "/{Key+}"; - request.UseQueryString = true; + PostMarshallCustomization(request, publicRequest); return request; } - - private static GetObjectRetentionRequestMarshaller _instance; + private static GetObjectRetentionRequestMarshaller _instance = new GetObjectRetentionRequestMarshaller(); + + internal static GetObjectRetentionRequestMarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for marshaller - /// + /// Gets the singleton. + /// public static GetObjectRetentionRequestMarshaller Instance { get { - if (_instance == null) - { - _instance = new GetObjectRetentionRequestMarshaller(); - } return _instance; } } + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetObjectRetentionRequest publicRequest); } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectRetentionResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectRetentionResponseUnmarshaller.cs similarity index 68% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectRetentionResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectRetentionResponseUnmarshaller.cs index e4a9bee6805a..d9994475206c 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectRetentionResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectRetentionResponseUnmarshaller.cs @@ -30,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -54,7 +55,10 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectRe { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) @@ -74,8 +78,37 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectRe return; } - private static GetObjectRetentionResponseUnmarshaller _instance; - + + + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + private static GetObjectRetentionResponseUnmarshaller _instance = new GetObjectRetentionResponseUnmarshaller(); + + internal static GetObjectRetentionResponseUnmarshaller GetInstance() + { + return _instance; + } + /// /// Gets the singleton. /// @@ -83,10 +116,6 @@ public static GetObjectRetentionResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new GetObjectRetentionResponseUnmarshaller(); - } return _instance; } } diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectTaggingRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectTaggingRequestMarshaller.cs new file mode 100644 index 000000000000..5de400bd8691 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectTaggingRequestMarshaller.cs @@ -0,0 +1,105 @@ +/* + * 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 +{ + /// + /// GetObjectTagging Request Marshaller + /// + public partial class GetObjectTaggingRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((GetObjectTaggingRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(GetObjectTaggingRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + request.HttpMethod = "GET"; + request.AddSubResource("tagging"); + + if (publicRequest.IsSetExpectedBucketOwner()) + { + request.Headers["x-amz-expected-bucket-owner"] = publicRequest.ExpectedBucketOwner; + } + + if (publicRequest.IsSetRequestPayer()) + { + request.Headers["x-amz-request-payer"] = publicRequest.RequestPayer; + } + if (string.IsNullOrEmpty(publicRequest.BucketName)) + throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetObjectTaggingRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.Key)) + throw new System.ArgumentException("Key is a required property and must be set before making this call.", "GetObjectTaggingRequest.Key"); + request.AddPathResource("{Key+}", StringUtils.FromString(publicRequest.Key)); + + if (publicRequest.IsSetVersionId()) + request.AddSubResource("versionId", StringUtils.FromString(publicRequest.VersionId)); + request.ResourcePath = "/{Key+}"; + + request.UseQueryString = true; + PostMarshallCustomization(request, publicRequest); + return request; + } + private static GetObjectTaggingRequestMarshaller _instance = new GetObjectTaggingRequestMarshaller(); + + internal static GetObjectTaggingRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetObjectTaggingRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetObjectTaggingRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectTaggingResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectTaggingResponseUnmarshaller.cs similarity index 50% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectTaggingResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectTaggingResponseUnmarshaller.cs index 56fa6d8004c7..1f0b0931262f 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetObjectTaggingResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetObjectTaggingResponseUnmarshaller.cs @@ -12,56 +12,69 @@ * 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 System.Collections.Generic; +using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// /// Response Unmarshaller for GetObjectTagging operation - /// + /// public class GetObjectTaggingResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + ///
    /// /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { GetObjectTaggingResponse response = new GetObjectTaggingResponse(); + UnmarshallResult(context,response); + if (context.ResponseData.IsHeaderPresent("x-amz-version-id")) + response.VersionId = context.ResponseData.GetHeaderValue("x-amz-version-id"); - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context, response); - continue; - } - } return response; - } - + } + private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectTaggingResponse response) { int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 2; - + int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) - targetDepth += 2; - + targetDepth += 1; + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { - if (context.TestExpression("Tag", targetDepth)) + if (context.TestExpression("TagSet/Tag", targetDepth)) { if (response.Tagging == null) { response.Tagging = new List(); } - response.Tagging.Add(TagUnmarshaller.Instance.Unmarshall(context)); + var unmarshaller = TagUnmarshaller.Instance; + response.Tagging.Add(unmarshaller.Unmarshall(context)); continue; } } @@ -70,25 +83,50 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, GetObjectTa return; } } + return; } + - private static GetObjectTaggingResponseUnmarshaller _instance; + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + private static GetObjectTaggingResponseUnmarshaller _instance = new GetObjectTaggingResponseUnmarshaller(); + + internal static GetObjectTaggingResponseUnmarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + ///
    public static GetObjectTaggingResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new GetObjectTaggingResponseUnmarshaller(); - } return _instance; } } + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetPublicAccessBlockRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetPublicAccessBlockRequestMarshaller.cs new file mode 100644 index 000000000000..d2ccff5eee60 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetPublicAccessBlockRequestMarshaller.cs @@ -0,0 +1,93 @@ +/* + * 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 +{ + /// + /// GetPublicAccessBlock Request Marshaller + /// + public partial class GetPublicAccessBlockRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((GetPublicAccessBlockRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(GetPublicAccessBlockRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + request.HttpMethod = "GET"; + request.AddSubResource("publicAccessBlock"); + + 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.", "GetPublicAccessBlockRequest.BucketName"); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + return request; + } + private static GetPublicAccessBlockRequestMarshaller _instance = new GetPublicAccessBlockRequestMarshaller(); + + internal static GetPublicAccessBlockRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetPublicAccessBlockRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetPublicAccessBlockRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetPublicAccessBlockResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetPublicAccessBlockResponseUnmarshaller.cs similarity index 51% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetPublicAccessBlockResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetPublicAccessBlockResponseUnmarshaller.cs index 557bb0b0397f..e4a4e487a330 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetPublicAccessBlockResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetPublicAccessBlockResponseUnmarshaller.cs @@ -12,70 +12,113 @@ * 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 CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// /// Response Unmarshaller for GetPublicAccessBlock operation - /// + ///
public class GetPublicAccessBlockResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + ///
/// /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { - var response = new GetPublicAccessBlockResponse(); - UnmarshallResult(context, response); + GetPublicAccessBlockResponse response = new GetPublicAccessBlockResponse(); + UnmarshallResult(context,response); + return response; - } + } private static void UnmarshallResult(XmlUnmarshallerContext context, GetPublicAccessBlockResponse response) - { + { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("PublicAccessBlockConfiguration", targetDepth)) - { - response.PublicAccessBlockConfiguration = PublicAccessBlockConfigurationUnmarshaller.Instance.Unmarshall(context); + { + var unmarshaller = PublicAccessBlockConfigurationUnmarshaller.Instance; + response.PublicAccessBlockConfiguration = unmarshaller.Unmarshall(context); + continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } - } + } + + return; } + - private static GetPublicAccessBlockResponseUnmarshaller _instance; + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + private static GetPublicAccessBlockResponseUnmarshaller _instance = new GetPublicAccessBlockResponseUnmarshaller(); + + internal static GetPublicAccessBlockResponseUnmarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + ///
public static GetPublicAccessBlockResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new GetPublicAccessBlockResponseUnmarshaller(); - } return _instance; } } + } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockRetentionUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockRetentionUnmarshaller.cs similarity index 91% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockRetentionUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockRetentionUnmarshaller.cs index 08bb72b9a75a..b7e4a43fb7ab 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ObjectLockRetentionUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ObjectLockRetentionUnmarshaller.cs @@ -30,6 +30,7 @@ using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// @@ -63,7 +64,7 @@ public ObjectLockRetention Unmarshall(XmlUnmarshallerContext context) } if (context.TestExpression("RetainUntilDate", targetDepth)) { - var unmarshaller = DateTimeUnmarshaller.Instance; + var unmarshaller = NullableDateTimeUnmarshaller.Instance; unmarshalledObject.RetainUntilDate = unmarshaller.Unmarshall(context); continue; } @@ -75,23 +76,17 @@ public ObjectLockRetention Unmarshall(XmlUnmarshallerContext context) } return unmarshalledObject; } - - private static ObjectLockRetentionUnmarshaller _instance; + private static ObjectLockRetentionUnmarshaller _instance = new ObjectLockRetentionUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static ObjectLockRetentionUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new ObjectLockRetentionUnmarshaller(); - } return _instance; } } - } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PublicBlockConfigurationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PublicAccessBlockConfigurationUnmarshaller.cs similarity index 55% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PublicBlockConfigurationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PublicAccessBlockConfigurationUnmarshaller.cs index 0cac02524b4f..86db9a71342e 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PublicBlockConfigurationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/PublicAccessBlockConfigurationUnmarshaller.cs @@ -12,26 +12,40 @@ * 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 { - /// - /// PublicAccessBlockConfiguration Unmarshaller - /// + /// + /// Response Unmarshaller for PublicAccessBlockConfiguration Object + /// public class PublicAccessBlockConfigurationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + ///
/// /// - public PublicAccessBlockConfiguration Unmarshall(XmlUnmarshallerContext context) + public PublicAccessBlockConfiguration Unmarshall(XmlUnmarshallerContext context) { - PublicAccessBlockConfiguration publicAccessBlockConfiguration = new PublicAccessBlockConfiguration(); + PublicAccessBlockConfiguration unmarshalledObject = new PublicAccessBlockConfiguration(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; @@ -44,51 +58,47 @@ public PublicAccessBlockConfiguration Unmarshall(XmlUnmarshallerContext context) { if (context.TestExpression("BlockPublicAcls", targetDepth)) { - publicAccessBlockConfiguration.BlockPublicAcls = BoolUnmarshaller.GetInstance().Unmarshall(context); + var unmarshaller = NullableBoolUnmarshaller.Instance; + unmarshalledObject.BlockPublicAcls = unmarshaller.Unmarshall(context); continue; - } - else if (context.TestExpression("IgnorePublicAcls", targetDepth)) + } + if (context.TestExpression("BlockPublicPolicy", targetDepth)) { - publicAccessBlockConfiguration.IgnorePublicAcls = BoolUnmarshaller.GetInstance().Unmarshall(context); + var unmarshaller = NullableBoolUnmarshaller.Instance; + unmarshalledObject.BlockPublicPolicy = unmarshaller.Unmarshall(context); continue; } - else if (context.TestExpression("BlockPublicPolicy", targetDepth)) + if (context.TestExpression("IgnorePublicAcls", targetDepth)) { - publicAccessBlockConfiguration.BlockPublicPolicy = BoolUnmarshaller.GetInstance().Unmarshall(context); + var unmarshaller = NullableBoolUnmarshaller.Instance; + unmarshalledObject.IgnorePublicAcls = unmarshaller.Unmarshall(context); continue; } - else if (context.TestExpression("RestrictPublicBuckets", targetDepth)) + if (context.TestExpression("RestrictPublicBuckets", targetDepth)) { - publicAccessBlockConfiguration.RestrictPublicBuckets = BoolUnmarshaller.GetInstance().Unmarshall(context); + var unmarshaller = NullableBoolUnmarshaller.Instance; + unmarshalledObject.RestrictPublicBuckets = unmarshaller.Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return publicAccessBlockConfiguration; + return unmarshalledObject; } - } - - return publicAccessBlockConfiguration; + } + return unmarshalledObject; } - - private static PublicAccessBlockConfigurationUnmarshaller _instance; + private static PublicAccessBlockConfigurationUnmarshaller _instance = new PublicAccessBlockConfigurationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + ///
public static PublicAccessBlockConfigurationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new PublicAccessBlockConfigurationUnmarshaller(); - } return _instance; } } - } -} - +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/ObjectLockRetention.cs b/sdk/src/Services/S3/Generated/Model/ObjectLockRetention.cs similarity index 82% rename from sdk/src/Services/S3/Custom/Model/ObjectLockRetention.cs rename to sdk/src/Services/S3/Generated/Model/ObjectLockRetention.cs index 936b5fbd1666..54a52a4912fc 100644 --- a/sdk/src/Services/S3/Custom/Model/ObjectLockRetention.cs +++ b/sdk/src/Services/S3/Generated/Model/ObjectLockRetention.cs @@ -17,7 +17,16 @@ * 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 { /// @@ -47,7 +56,10 @@ internal bool IsSetMode() } /// - /// Gets and sets the property RetainUntilDate. + /// Gets and sets the property RetainUntilDate. + /// + /// The date on which this Object Lock Retention will expire. + /// /// public DateTime? RetainUntilDate { diff --git a/sdk/src/Services/S3/Generated/Model/PublicAccessBlockConfiguration.cs b/sdk/src/Services/S3/Generated/Model/PublicAccessBlockConfiguration.cs new file mode 100644 index 000000000000..20265b560239 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/PublicAccessBlockConfiguration.cs @@ -0,0 +1,158 @@ +/* + * 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 PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket. + /// You can enable the configuration options in any combination. For more information + /// about when Amazon S3 considers a bucket or object public, see The + /// Meaning of "Public" in the Amazon S3 User Guide. + /// + public partial class PublicAccessBlockConfiguration + { + private bool? _blockPublicAcls; + private bool? _blockPublicPolicy; + private bool? _ignorePublicAcls; + private bool? _restrictPublicBuckets; + + /// + /// Gets and sets the property BlockPublicAcls. + /// + /// Specifies whether Amazon S3 should block public access control lists (ACLs) for this + /// bucket and objects in this bucket. Setting this element to TRUE causes the + /// following behavior: + /// + ///
  • + /// + /// PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. + /// + ///
  • + /// + /// PUT Object calls fail if the request includes a public ACL. + /// + ///
  • + /// + /// PUT Bucket calls fail if the request includes a public ACL. + /// + ///
+ /// + /// Enabling this setting doesn't affect existing policies or ACLs. + /// + ///
+ public bool? BlockPublicAcls + { + get { return this._blockPublicAcls; } + set { this._blockPublicAcls = value; } + } + + // Check to see if BlockPublicAcls property is set + internal bool IsSetBlockPublicAcls() + { + return this._blockPublicAcls.HasValue; + } + + /// + /// Gets and sets the property BlockPublicPolicy. + /// + /// Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting + /// this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy + /// if the specified bucket policy allows public access. + /// + /// + /// + /// Enabling this setting doesn't affect existing bucket policies. + /// + /// + public bool? BlockPublicPolicy + { + get { return this._blockPublicPolicy; } + set { this._blockPublicPolicy = value; } + } + + // Check to see if BlockPublicPolicy property is set + internal bool IsSetBlockPublicPolicy() + { + return this._blockPublicPolicy.HasValue; + } + + /// + /// Gets and sets the property IgnorePublicAcls. + /// + /// Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects + /// in this bucket. Setting this element to TRUE causes Amazon S3 to ignore all + /// public ACLs on this bucket and objects in this bucket. + /// + /// + /// + /// Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't + /// prevent new public ACLs from being set. + /// + /// + public bool? IgnorePublicAcls + { + get { return this._ignorePublicAcls; } + set { this._ignorePublicAcls = value; } + } + + // Check to see if IgnorePublicAcls property is set + internal bool IsSetIgnorePublicAcls() + { + return this._ignorePublicAcls.HasValue; + } + + /// + /// Gets and sets the property RestrictPublicBuckets. + /// + /// Specifies whether Amazon S3 should restrict public bucket policies for this bucket. + /// Setting this element to TRUE restricts access to this bucket to only Amazon + /// Web Services service principals and authorized users within this account if the bucket + /// has a public policy. + /// + /// + /// + /// Enabling this setting doesn't affect previously stored bucket policies, except that + /// public and cross-account access within any public bucket policy, including non-public + /// delegation to specific accounts, is blocked. + /// + /// + public bool? RestrictPublicBuckets + { + get { return this._restrictPublicBuckets; } + set { this._restrictPublicBuckets = value; } + } + + // Check to see if RestrictPublicBuckets property is set + internal bool IsSetRestrictPublicBuckets() + { + return this._restrictPublicBuckets.HasValue; + } + + } +} \ No newline at end of file From 6d9ccb701d141892f4fcca9c1d1795d922997438 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Mon, 23 Jun 2025 12:50:56 -0700 Subject: [PATCH 3/7] update devconfig --- generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json b/generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json index 64ad3f74029a..c5836bf392fc 100644 --- a/generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json +++ b/generator/.DevConfigs/816a028b-eb1b-4f17-9d9c-a0373bcd8ced.json @@ -4,7 +4,7 @@ "serviceName": "S3", "type": "patch", "changeLogMessages": [ - "Generate GetBucketRequestPayment, GetBucketTagging, and GetObjectAttributes" + "Generate GetBucketRequestPayment, GetBucketTagging, and GetObjectAttributes, GetObjectLegalHold, GetObjectLockConfiguration, GetObjectRetention, GetObjectTagging, GetPublicAccessBlock" ] } ] From b84955afe72823e9abba0d499cfb63d76a53f29d Mon Sep 17 00:00:00 2001 From: Peter Song Date: Mon, 23 Jun 2025 15:00:18 -0700 Subject: [PATCH 4/7] address PR feedback --- generator/ServiceClientGeneratorLib/Customizations.cs | 6 +++--- generator/ServiceClientGeneratorLib/Member.cs | 2 +- generator/ServiceModels/s3/s3.customizations.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generator/ServiceClientGeneratorLib/Customizations.cs b/generator/ServiceClientGeneratorLib/Customizations.cs index 50971a86f964..82c385a7e465 100644 --- a/generator/ServiceClientGeneratorLib/Customizations.cs +++ b/generator/ServiceClientGeneratorLib/Customizations.cs @@ -424,7 +424,7 @@ public class CustomizationsModel public const string OverrideContentTypeKey = "overrideContentType"; public const string StopPaginationOnSameTokenKey = "stopPaginationOnSameToken"; public const string OriginalMemberKey = "originalMember"; - public const string TreatEnumsAsEnums = "treatEnumsAsEnums"; + public const string OverrideTreatEnumsAsStringKey = "overrideTreatEnumsAsString"; JsonData _documentRoot; SimpleMethodFormsModel _simpleMethodsModel; @@ -609,9 +609,9 @@ public List NoArgOverloads /// ///
/// - public bool GetTreatEnumAsEnum(string shapeName) + public bool OverrideTreatEnumsAsString(string shapeName) { - var data = _documentRoot[TreatEnumsAsEnums]; + var data = _documentRoot[OverrideTreatEnumsAsStringKey]; if (data == null) return false; return data[shapeName] == null ? false : true; } diff --git a/generator/ServiceClientGeneratorLib/Member.cs b/generator/ServiceClientGeneratorLib/Member.cs index fd76ab51bf49..a880820e4074 100644 --- a/generator/ServiceClientGeneratorLib/Member.cs +++ b/generator/ServiceClientGeneratorLib/Member.cs @@ -584,7 +584,7 @@ private string DetermineType(JsonData extendedData, bool treatEnumsAsString, boo return string.Format("Dictionary<{0}, {1}>", keyType, valueType); case "list": // if customization exists to treat the enum as an enum instead of a string, we pass in false - var listType = this.model.Customizations.GetTreatEnumAsEnum(this.Extends) ? DetermineType(memberShape["member"], false, false) : DetermineType(memberShape["member"], true, false) ; + var listType = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ? DetermineType(memberShape["member"], false, false) : DetermineType(memberShape["member"], true, false) ; return string.Format("List<{0}>", listType); case "decimal": diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index e741ada70ed1..ef16229c4f3e 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -394,7 +394,7 @@ } }, - "treatEnumsAsEnums":{ + "overrideTreatEnumsAsString":{ "ObjectAttributesList": true } } From a5779fb2d70b3584c5af0a85531f19ff33872c28 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Tue, 24 Jun 2025 10:03:46 -0700 Subject: [PATCH 5/7] update overrideTreatEnumsAsString customization --- .../ServiceClientGeneratorLib/Customizations.cs | 14 ++++++++------ generator/ServiceClientGeneratorLib/Member.cs | 4 ++-- .../Generated/Model/GetObjectAttributesRequest.cs | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/generator/ServiceClientGeneratorLib/Customizations.cs b/generator/ServiceClientGeneratorLib/Customizations.cs index 82c385a7e465..1dfb686364eb 100644 --- a/generator/ServiceClientGeneratorLib/Customizations.cs +++ b/generator/ServiceClientGeneratorLib/Customizations.cs @@ -602,18 +602,20 @@ public List NoArgOverloads /// /// For Lists of enums, the generator automatically treats the enum as a string via passing in true to "treatEnumAsString". - /// This customization overrides that so that the enum is treated as an enum. - /// "treatEnumsAsEnums":{ - /// "ObjectAttributesList": true + /// This customization sets the "treatEnumAsString" value to whatever is set here. This can be used outside of list of enums + /// but this is just one example of how it can be used. + /// "overrideTreatEnumsAsString":{ + /// "ObjectAttributesList": false /// } /// /// /// - public bool OverrideTreatEnumsAsString(string shapeName) + public bool? OverrideTreatEnumsAsString(string shapeName) { var data = _documentRoot[OverrideTreatEnumsAsStringKey]; - if (data == null) return false; - return data[shapeName] == null ? false : true; + if (data == null || data[shapeName] == null) return null; + + return (bool)data[shapeName]; } private HashSet _resultGenerationSuppressions = null; diff --git a/generator/ServiceClientGeneratorLib/Member.cs b/generator/ServiceClientGeneratorLib/Member.cs index a880820e4074..8c121bffd230 100644 --- a/generator/ServiceClientGeneratorLib/Member.cs +++ b/generator/ServiceClientGeneratorLib/Member.cs @@ -583,8 +583,8 @@ private string DetermineType(JsonData extendedData, bool treatEnumsAsString, boo var valueType = DetermineType(memberShape["value"], true, false); return string.Format("Dictionary<{0}, {1}>", keyType, valueType); case "list": - // if customization exists to treat the enum as an enum instead of a string, we pass in false - var listType = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ? DetermineType(memberShape["member"], false, false) : DetermineType(memberShape["member"], true, false) ; + var overrideTreatEnumsAsString = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ?? true; + var listType = DetermineType(memberShape["member"], overrideTreatEnumsAsString, false); return string.Format("List<{0}>", listType); case "decimal": diff --git a/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs index 09383475b539..cb67bc0ab88e 100644 --- a/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs @@ -270,7 +270,7 @@ public partial class GetObjectAttributesRequest : AmazonWebServiceRequest private string _expectedBucketOwner; private string _key; private int? _maxParts; - private List _objectAttributes = AWSConfigs.InitializeCollections ? new List() : null; + private List _objectAttributes = AWSConfigs.InitializeCollections ? new List() : null; private int? _partNumberMarker; private RequestPayer _requestPayer; private string _sseCustomerAlgorithm; @@ -405,7 +405,7 @@ internal bool IsSetMaxParts() /// SDK behavior set the AWSConfigs.InitializeCollections static property to true. ///
[AWSProperty(Required=true)] - public List ObjectAttributes + public List ObjectAttributes { get { return this._objectAttributes; } set { this._objectAttributes = value; } From 5e5120106c3fa24586ceb3d92376bafddca88ad3 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Tue, 24 Jun 2025 10:31:39 -0700 Subject: [PATCH 6/7] Update value from true to false --- generator/ServiceModels/s3/s3.customizations.json | 2 +- .../Services/S3/Generated/Model/GetObjectAttributesRequest.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index ef16229c4f3e..2dbeb50f630e 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -395,6 +395,6 @@ }, "overrideTreatEnumsAsString":{ - "ObjectAttributesList": true + "ObjectAttributesList": false } } diff --git a/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs index cb67bc0ab88e..09383475b539 100644 --- a/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetObjectAttributesRequest.cs @@ -270,7 +270,7 @@ public partial class GetObjectAttributesRequest : AmazonWebServiceRequest private string _expectedBucketOwner; private string _key; private int? _maxParts; - private List _objectAttributes = AWSConfigs.InitializeCollections ? new List() : null; + private List _objectAttributes = AWSConfigs.InitializeCollections ? new List() : null; private int? _partNumberMarker; private RequestPayer _requestPayer; private string _sseCustomerAlgorithm; @@ -405,7 +405,7 @@ internal bool IsSetMaxParts() /// SDK behavior set the AWSConfigs.InitializeCollections static property to true. ///
[AWSProperty(Required=true)] - public List ObjectAttributes + public List ObjectAttributes { get { return this._objectAttributes; } set { this._objectAttributes = value; } From e70b14dd00a64fa0c18468a842b8b2c46f3fa1ca Mon Sep 17 00:00:00 2001 From: Peter Song Date: Tue, 24 Jun 2025 10:41:20 -0700 Subject: [PATCH 7/7] Add overrideTreatEnumsAsString logic to map as well --- generator/ServiceClientGeneratorLib/Member.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/generator/ServiceClientGeneratorLib/Member.cs b/generator/ServiceClientGeneratorLib/Member.cs index 8c121bffd230..130d612822cb 100644 --- a/generator/ServiceClientGeneratorLib/Member.cs +++ b/generator/ServiceClientGeneratorLib/Member.cs @@ -579,12 +579,13 @@ private string DetermineType(JsonData extendedData, bool treatEnumsAsString, boo } return typeName; case "map": - var keyType = DetermineType(memberShape["key"], true, false); - var valueType = DetermineType(memberShape["value"], true, false); + bool overrideMapTreatEnumsAsString = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ?? true; + var keyType = DetermineType(memberShape["key"], overrideMapTreatEnumsAsString, false); + var valueType = DetermineType(memberShape["value"], overrideMapTreatEnumsAsString, false); return string.Format("Dictionary<{0}, {1}>", keyType, valueType); case "list": - var overrideTreatEnumsAsString = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ?? true; - var listType = DetermineType(memberShape["member"], overrideTreatEnumsAsString, false); + bool overrideListTreatEnumsAsString = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ?? true; + var listType = DetermineType(memberShape["member"], overrideListTreatEnumsAsString, false); return string.Format("List<{0}>", listType); case "decimal":