From 18d3b1690c92e8af9f512c590c6c538f9ea90d24 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Thu, 6 Nov 2025 15:11:43 -0800 Subject: [PATCH 1/2] Generate GetBucketAnalyticsConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4127, branch: peterrsongg/petesong/phase-3-pr-2-all/3 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 28 ++++ ...nalyticsS3BucketDestinationUnmarshaller.cs | 102 +++----------- ...AnalyticsConfigurationRequestMarshaller.cs | 44 +----- ...lyticsConfigurationResponseUnmarshaller.cs | 116 ---------------- .../GetBucketAnalyticsConfigurationRequest.cs | 80 ++++++----- ...GetBucketAnalyticsConfigurationResponse.cs | 28 ++-- .../AnalyticsConfigurationUnmarshaller.cs | 79 ++++++----- .../AnalyticsExportDestinationUnmarshaller.cs | 63 +++++---- ...nalyticsS3BucketDestinationUnmarshaller.cs | 108 +++++++++++++++ ...AnalyticsConfigurationRequestMarshaller.cs | 101 ++++++++++++++ ...lyticsConfigurationResponseUnmarshaller.cs | 126 ++++++++++++++++++ ...rageClassAnalysisDataExportUnmarshaller.cs | 71 +++++----- .../StorageClassAnalysisUnmarshaller.cs | 63 +++++---- 14 files changed, 610 insertions(+), 401 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketAnalyticsConfigurationRequest.cs (68%) rename sdk/src/Services/S3/{Custom => Generated}/Model/GetBucketAnalyticsConfigurationResponse.cs (61%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/AnalyticsConfigurationUnmarshaller.cs (52%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/AnalyticsExportDestinationUnmarshaller.cs (55%) create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsS3BucketDestinationUnmarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/StorageClassAnalysisDataExportUnmarshaller.cs (54%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/StorageClassAnalysisUnmarshaller.cs (55%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index e26bfff008ca..cf47d93f81d1 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -548,7 +548,7 @@ public List S3AllowListOperations new Operation(this, "ListObjectsV2", DocumentRoot[OperationsKey]["ListObjectsV2"]), // phase 3 (including those moved from phase 1) new Operation(this, "CreateSession", DocumentRoot[OperationsKey]["CreateSession"]), - //new Operation(this, "GetBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["GetBucketAnalyticsConfiguration"]), + new Operation(this, "GetBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["GetBucketAnalyticsConfiguration"]), //new Operation(this, "GetBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["GetBucketIntelligentTieringConfiguration"]), //new Operation(this, "GetBucketInventoryConfiguration", DocumentRoot[OperationsKey]["GetBucketInventoryConfiguration"]), //new Operation(this, "GetBucketLogging", DocumentRoot[OperationsKey]["GetBucketLogging"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 9ca183a779ac..66f9df755191 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -933,6 +933,28 @@ "injectXmlMarshallCode": ["AnalyticsFilterCustomMarshall(publicRequest, xmlWriter);"] } } + ], + "predicateListUnmarshallers": [ + { + "AnalyticsFilter" :{ + "predicateListUnmarshallerName" : "AnalyticsPredicateListUnmarshaller", + "filterPredicateName": "AnalyticsFilterPredicate" + } + } + ] + }, + "GetBucketAnalyticsConfigurationRequest":{ + "modify" :[ + { + "Id" :{"emitPropertyName": "AnalyticsId"} + }, + { + "ExpectedBucketOwner":{ + "injectXmlIsSet":[ + "return !String.IsNullOrEmpty(this._expectedBucketOwner);" + ] + } + } ] }, "AnalyticsS3BucketDestination" : { @@ -951,6 +973,12 @@ "Prefix":{ "injectXmlIsSet": ["return !String.IsNullOrEmpty(this._prefix);"] } + }, + { + "Format" :{ + "skipContextTestExpressionUnmarshallingLogic" : true, + "injectXmlUnmarshallCode": ["FormatCustomUnmarshall(context, unmarshalledObject);"] + } } ] } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsS3BucketDestinationUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsS3BucketDestinationUnmarshaller.cs index 080475e44742..27f04b8ac67b 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsS3BucketDestinationUnmarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsS3BucketDestinationUnmarshaller.cs @@ -1,98 +1,26 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System.Collections.Generic; - -using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +using Amazon.S3.Model; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; namespace Amazon.S3.Model.Internal.MarshallTransformations { /// - /// AnalyticsS3BucketDestination Unmarshaller + /// Custom unmarshaller for AnalyticsS3BucketDestination Object /// - public class AnalyticsS3BucketDestinationUnmarshaller : IXmlUnmarshaller + public partial class AnalyticsS3BucketDestinationUnmarshaller : IXmlUnmarshaller { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public AnalyticsS3BucketDestination Unmarshall(XmlUnmarshallerContext context) - { - AnalyticsS3BucketDestination AnalyticsS3BucketDestination = new AnalyticsS3BucketDestination(); - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - if (context.TestExpression("Format", targetDepth)) - { - AnalyticsS3BucketDestination.Format = AnalyticsS3ExportFileFormat.FindValue(StringUnmarshaller.Instance.Unmarshall(context)); - - continue; - } - if (context.TestExpression("BucketAccountId", targetDepth)) - { - AnalyticsS3BucketDestination.BucketAccountId = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Bucket", targetDepth)) - { - AnalyticsS3BucketDestination.BucketName = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Prefix", targetDepth)) - { - AnalyticsS3BucketDestination.Prefix = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return AnalyticsS3BucketDestination; - } - } - - - - return AnalyticsS3BucketDestination; - } - - private static AnalyticsS3BucketDestinationUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static AnalyticsS3BucketDestinationUnmarshaller Instance + void FormatCustomUnmarshall(XmlUnmarshallerContext context, AnalyticsS3BucketDestination unmarshalledObject) { - get - { - if (_instance == null) - { - _instance = new AnalyticsS3BucketDestinationUnmarshaller(); - } - return _instance; - } + unmarshalledObject.Format = AnalyticsS3ExportFileFormat.FindValue(StringUnmarshaller.Instance.Unmarshall(context)); } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs index 68d039d30306..d3619b9e519e 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs @@ -24,49 +24,11 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Get BucketAnalyticsConfiguration Request Marshaller /// - public class GetBucketAnalyticsConfigurationRequestMarshaller : IMarshaller, IMarshaller + public partial class GetBucketAnalyticsConfigurationRequestMarshaller : IMarshaller, IMarshaller { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketAnalyticsConfigurationRequest publicRequest) { - return this.Marshall((GetBucketAnalyticsConfigurationRequest)input); - } - - public IRequest Marshall(GetBucketAnalyticsConfigurationRequest getAnalyticsConfigurationRequest) - { - IRequest request = new DefaultRequest(getAnalyticsConfigurationRequest, "Amazon.S3"); - - request.Suppress404Exceptions = true; - request.HttpMethod = "GET"; - - if (getAnalyticsConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(getAnalyticsConfigurationRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(getAnalyticsConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "GetBucketAnalyticsConfigurationRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("analytics"); - request.AddSubResource("id", getAnalyticsConfigurationRequest.AnalyticsId); - request.UseQueryString = true; - - return request; - } - - private static GetBucketAnalyticsConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static GetBucketAnalyticsConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketAnalyticsConfigurationRequestMarshaller(); - } - return _instance; - } + defaultRequest.Suppress404Exceptions = true; } } } diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs deleted file mode 100644 index 875ddc3f6e69..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System; -using System.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for GetAnalyticsConfiguration operation - /// - public class GetBucketAnalyticsConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - GetBucketAnalyticsConfigurationResponse response = new GetBucketAnalyticsConfigurationResponse(); - - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context, response); - continue; - } - } - - - return response; - } - - private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketAnalyticsConfigurationResponse response) - { - - int originalDepth = context.CurrentDepth; - int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - - response.AnalyticsConfiguration = new AnalyticsConfiguration(); - - while (context.Read()) - { - if (context.IsStartElement || context.IsAttribute) - { - if (context.TestExpression("Id", targetDepth)) - { - response.AnalyticsConfiguration.AnalyticsId = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("Filter", targetDepth)) - { - response.AnalyticsConfiguration.AnalyticsFilter = new AnalyticsFilter() - { - AnalyticsFilterPredicate = (AnalyticsPredicateListUnmarshaller.Instance.Unmarshall(context))[0] - }; - continue; - } - if (context.TestExpression("StorageClassAnalysis", targetDepth)) - { - response.AnalyticsConfiguration.StorageClassAnalysis = StorageClassAnalysisUnmarshaller.Instance.Unmarshall(context); - - continue; - } - - } - else if (context.IsEndElement && context.CurrentDepth < originalDepth) - { - return; - } - } - - return; - } - - private static GetBucketAnalyticsConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static GetBucketAnalyticsConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new GetBucketAnalyticsConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - - } -} diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketAnalyticsConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/GetBucketAnalyticsConfigurationRequest.cs similarity index 68% rename from sdk/src/Services/S3/Custom/Model/GetBucketAnalyticsConfigurationRequest.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketAnalyticsConfigurationRequest.cs index d104a32bd523..01f85db98185 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketAnalyticsConfigurationRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketAnalyticsConfigurationRequest.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,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 GetBucketAnalyticsConfiguration operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -36,7 +42,7 @@ namespace Amazon.S3.Model /// /// /// - /// To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration + /// To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration /// action. The bucket owner has this permission by default. The bucket owner can grant /// this permission to others. For more information about permissions, see /// Permissions Related to Bucket Subresource Operations and Managing @@ -50,7 +56,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following operations are related to GetBucketAnalyticsConfiguration: + /// The following operations are related to GetBucketAnalyticsConfiguration: /// /// + /// + /// + /// You must URL encode any signed header values that contain spaces. For example, if + /// your header value is my file.txt, containing two spaces after my, you + /// must URL encode this value to my%20%20file.txt. + /// + /// /// public partial class GetBucketAnalyticsConfigurationRequest : AmazonWebServiceRequest { - private string bucketName; - private string analyticsId; - private string expectedBucketOwner; + private string _analyticsId; + private string _bucketName; + private string _expectedBucketOwner; /// - /// The name of the bucket from which an analytics configuration is retrieved. + /// Gets and sets the property AnalyticsId. + /// + /// The ID that identifies the analytics configuration. + /// /// - public string BucketName + [AWSProperty(Required=true)] + public string AnalyticsId { - get { return this.bucketName; } - set { this.bucketName = value; } + get { return this._analyticsId; } + set { this._analyticsId = value; } } - // Check to see if BucketName property is set - internal bool IsSetBucketName() + // Check to see if AnalyticsId property is set + internal bool IsSetAnalyticsId() { - return !(string.IsNullOrEmpty(this.bucketName)); + return this._analyticsId != null; } /// - /// The identifier used to represent an analytics configuration. + /// Gets and sets the property BucketName. + /// + /// The name of the bucket from which an analytics configuration is retrieved. + /// /// - public string AnalyticsId + [AWSProperty(Required=true)] + public string BucketName { - get { return this.analyticsId; } - set { this.analyticsId = value; } + get { return this._bucketName; } + set { this._bucketName = value; } } - // Check to see if InventoryId property is set - internal bool IsSetAnalyticsId() + // Check to see if BucketName property is set + internal bool IsSetBucketName() { - return !(string.IsNullOrEmpty(this.analyticsId)); + return this._bucketName != null; } /// @@ -110,22 +130,20 @@ internal bool IsSetAnalyticsId() /// /// The account ID of the expected bucket owner. If the account ID that you provide does /// not match the actual owner of the bucket, the request fails with the HTTP status code - /// 403 Forbidden (access denied). + /// 403 Forbidden (access denied). /// /// public string ExpectedBucketOwner { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. + // Check to see if ExpectedBucketOwner property is set internal bool IsSetExpectedBucketOwner() { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + return !String.IsNullOrEmpty(this._expectedBucketOwner); } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/GetBucketAnalyticsConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/GetBucketAnalyticsConfigurationResponse.cs similarity index 61% rename from sdk/src/Services/S3/Custom/Model/GetBucketAnalyticsConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/GetBucketAnalyticsConfigurationResponse.cs index 6247f364db16..06a0343d6aac 100644 --- a/sdk/src/Services/S3/Custom/Model/GetBucketAnalyticsConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/GetBucketAnalyticsConfigurationResponse.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,35 +12,47 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// GetBucketAnalyticsConfigurationResponse Response + /// This is the response object from the GetBucketAnalyticsConfiguration operation. /// public partial class GetBucketAnalyticsConfigurationResponse : AmazonWebServiceResponse { - AnalyticsConfiguration analyticsConfiguration; + private AnalyticsConfiguration _analyticsConfiguration; /// + /// Gets and sets the property AnalyticsConfiguration. + /// /// The configuration and any analyses for the analytics filter. + /// /// public AnalyticsConfiguration AnalyticsConfiguration { - get { return this.analyticsConfiguration; } - set { this.analyticsConfiguration = value; } + get { return this._analyticsConfiguration; } + set { this._analyticsConfiguration = value; } } - // Check to see if InventoryConfiguration property is set + // Check to see if AnalyticsConfiguration property is set internal bool IsSetAnalyticsConfiguration() { - return this.analyticsConfiguration != null; + return this._analyticsConfiguration != null; } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsConfigurationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsConfigurationUnmarshaller.cs similarity index 52% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsConfigurationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsConfigurationUnmarshaller.cs index 46edf58a1f4a..31ce335b6917 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsConfigurationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsConfigurationUnmarshaller.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,84 +12,93 @@ * 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 { /// - /// AnalyticsConfiguration Unmarshaller - /// - public class AnalyticsConfigurationUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for AnalyticsConfiguration Object + /// + public partial class AnalyticsConfigurationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public AnalyticsConfiguration Unmarshall(XmlUnmarshallerContext context) { - AnalyticsConfiguration analyticsConfiguration = new AnalyticsConfiguration(); + AnalyticsConfiguration unmarshalledObject = new AnalyticsConfiguration(); 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("Id", targetDepth)) + if (context.TestExpression("Filter", targetDepth)) { - analyticsConfiguration.AnalyticsId = StringUnmarshaller.Instance.Unmarshall(context); - + var predicateList = AnalyticsPredicateListUnmarshaller.Instance.Unmarshall(context); + unmarshalledObject.AnalyticsFilter = new AnalyticsFilter(); + unmarshalledObject.AnalyticsFilter.AnalyticsFilterPredicate = predicateList[0]; continue; } - - if (context.TestExpression("Filter", targetDepth)) + if (context.TestExpression("Id", targetDepth)) { - analyticsConfiguration.AnalyticsFilter = new AnalyticsFilter(){ - AnalyticsFilterPredicate = (AnalyticsPredicateListUnmarshaller.Instance.Unmarshall(context))[0] - }; + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.AnalyticsId = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("StorageClassAnalysis", targetDepth)) { - analyticsConfiguration.StorageClassAnalysis = StorageClassAnalysisUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = StorageClassAnalysisUnmarshaller.Instance; + unmarshalledObject.StorageClassAnalysis = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return analyticsConfiguration; + return unmarshalledObject; } - } - - - - return analyticsConfiguration; + } + return unmarshalledObject; } - private static AnalyticsConfigurationUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, AnalyticsConfiguration unmarshalledObject, int targetDepth); + + private static AnalyticsConfigurationUnmarshaller _instance = new AnalyticsConfigurationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static AnalyticsConfigurationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new AnalyticsConfigurationUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsExportDestinationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsExportDestinationUnmarshaller.cs similarity index 55% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsExportDestinationUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsExportDestinationUnmarshaller.cs index 82d632d248bd..fc4e29f6e3ee 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/AnalyticsExportDestinationUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsExportDestinationUnmarshaller.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,69 +12,80 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// - /// AnalyticsExportDestinationUnmarshaller - /// - public class AnalyticsExportDestinationUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for AnalyticsExportDestination Object + /// + public partial class AnalyticsExportDestinationUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public AnalyticsExportDestination Unmarshall(XmlUnmarshallerContext context) { - AnalyticsExportDestination AnalyticsExportDestination = new AnalyticsExportDestination(); + AnalyticsExportDestination unmarshalledObject = new AnalyticsExportDestination(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - + + if (context.IsStartOfDocument) + targetDepth += 2; + while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("S3BucketDestination", targetDepth)) { - AnalyticsExportDestination.S3BucketDestination = AnalyticsS3BucketDestinationUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = AnalyticsS3BucketDestinationUnmarshaller.Instance; + unmarshalledObject.S3BucketDestination = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return AnalyticsExportDestination; + return unmarshalledObject; } - } - - - - return AnalyticsExportDestination; + } + return unmarshalledObject; } - private static AnalyticsExportDestinationUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, AnalyticsExportDestination unmarshalledObject, int targetDepth); + + private static AnalyticsExportDestinationUnmarshaller _instance = new AnalyticsExportDestinationUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static AnalyticsExportDestinationUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new AnalyticsExportDestinationUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsS3BucketDestinationUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsS3BucketDestinationUnmarshaller.cs new file mode 100644 index 000000000000..926d91658356 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/AnalyticsS3BucketDestinationUnmarshaller.cs @@ -0,0 +1,108 @@ +/* + * 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 AnalyticsS3BucketDestination Object + /// + public partial class AnalyticsS3BucketDestinationUnmarshaller : IXmlUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public AnalyticsS3BucketDestination Unmarshall(XmlUnmarshallerContext context) + { + AnalyticsS3BucketDestination unmarshalledObject = new AnalyticsS3BucketDestination(); + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + + if (context.IsStartOfDocument) + targetDepth += 2; + + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + if (context.TestExpression("BucketAccountId", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.BucketAccountId = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("Bucket", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.BucketName = unmarshaller.Unmarshall(context); + continue; + } + if (context.TestExpression("Format", targetDepth)) + { + FormatCustomUnmarshall(context, unmarshalledObject); + continue; + } + if (context.TestExpression("Prefix", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.Prefix = unmarshaller.Unmarshall(context); + continue; + } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); + } + else if (context.IsEndElement && context.CurrentDepth < originalDepth) + { + return unmarshalledObject; + } + } + return unmarshalledObject; + } + + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, AnalyticsS3BucketDestination unmarshalledObject, int targetDepth); + + private static AnalyticsS3BucketDestinationUnmarshaller _instance = new AnalyticsS3BucketDestinationUnmarshaller(); + + /// + /// Gets the singleton. + /// + public static AnalyticsS3BucketDestinationUnmarshaller Instance + { + get + { + return _instance; + } + } + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..e001ad360368 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationRequestMarshaller.cs @@ -0,0 +1,101 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +using System.Xml; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// GetBucketAnalyticsConfiguration Request Marshaller + /// + public partial class GetBucketAnalyticsConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((GetBucketAnalyticsConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(GetBucketAnalyticsConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "GET"; + request.AddSubResource("analytics"); + + 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.", "GetBucketAnalyticsConfigurationRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.AnalyticsId)) + throw new AmazonS3Exception("Request object does not have required field AnalyticsId set"); + + if (publicRequest.IsSetAnalyticsId()) + request.Parameters.Add("id", StringUtils.FromString(publicRequest.AnalyticsId)); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static GetBucketAnalyticsConfigurationRequestMarshaller _instance = new GetBucketAnalyticsConfigurationRequestMarshaller(); + + internal static GetBucketAnalyticsConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketAnalyticsConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, GetBucketAnalyticsConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, GetBucketAnalyticsConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..3a03e15964e7 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/GetBucketAnalyticsConfigurationResponseUnmarshaller.cs @@ -0,0 +1,126 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// Response Unmarshaller for GetBucketAnalyticsConfiguration operation + /// + public partial class GetBucketAnalyticsConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + GetBucketAnalyticsConfigurationResponse response = new GetBucketAnalyticsConfigurationResponse(); + UnmarshallResult(context,response); + + PostUnmarshallCustomization(context, response); + return response; + } + + private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketAnalyticsConfigurationResponse response) + { + int originalDepth = context.CurrentDepth; + int targetDepth = originalDepth + 1; + if (context.IsEmptyResponse) + { + return; + } + while (context.Read()) + { + if (context.IsStartElement || context.IsAttribute) + { + if (context.TestExpression("AnalyticsConfiguration", targetDepth)) + { + var unmarshaller = AnalyticsConfigurationUnmarshaller.Instance; + response.AnalyticsConfiguration = unmarshaller.Unmarshall(context); + continue; + } + } + else if (context.IsEndElement && context.CurrentDepth < originalDepth) + { + return; + } + } + return; + } + + + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, GetBucketAnalyticsConfigurationResponse response); + + private static GetBucketAnalyticsConfigurationResponseUnmarshaller _instance = new GetBucketAnalyticsConfigurationResponseUnmarshaller(); + + internal static GetBucketAnalyticsConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static GetBucketAnalyticsConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/StorageClassAnalysisDataExportUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/StorageClassAnalysisDataExportUnmarshaller.cs similarity index 54% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/StorageClassAnalysisDataExportUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/StorageClassAnalysisDataExportUnmarshaller.cs index 236f3b1763f6..124fc7165af8 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/StorageClassAnalysisDataExportUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/StorageClassAnalysisDataExportUnmarshaller.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,75 +12,86 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// - /// StorageClassAnalysisDataExportDataExportUnmarshaller - /// - public class StorageClassAnalysisDataExportUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for StorageClassAnalysisDataExport Object + /// + public partial class StorageClassAnalysisDataExportUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public StorageClassAnalysisDataExport Unmarshall(XmlUnmarshallerContext context) { - StorageClassAnalysisDataExport StorageClassAnalysisDataExport = new StorageClassAnalysisDataExport(); + StorageClassAnalysisDataExport unmarshalledObject = new StorageClassAnalysisDataExport(); 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("OutputSchemaVersion", targetDepth)) + if (context.TestExpression("Destination", targetDepth)) { - StorageClassAnalysisDataExport.OutputSchemaVersion = StorageClassAnalysisSchemaVersion.FindValue(StringUnmarshaller.Instance.Unmarshall(context)); - + var unmarshaller = AnalyticsExportDestinationUnmarshaller.Instance; + unmarshalledObject.Destination = unmarshaller.Unmarshall(context); continue; } - if (context.TestExpression("Destination", targetDepth)) + if (context.TestExpression("OutputSchemaVersion", targetDepth)) { - StorageClassAnalysisDataExport.Destination = AnalyticsExportDestinationUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + unmarshalledObject.OutputSchemaVersion = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return StorageClassAnalysisDataExport; + return unmarshalledObject; } - } - - - - return StorageClassAnalysisDataExport; + } + return unmarshalledObject; } - private static StorageClassAnalysisDataExportUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, StorageClassAnalysisDataExport unmarshalledObject, int targetDepth); + + private static StorageClassAnalysisDataExportUnmarshaller _instance = new StorageClassAnalysisDataExportUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static StorageClassAnalysisDataExportUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new StorageClassAnalysisDataExportUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/StorageClassAnalysisUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/StorageClassAnalysisUnmarshaller.cs similarity index 55% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/StorageClassAnalysisUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/StorageClassAnalysisUnmarshaller.cs index 7585b1702a54..aa164d69852f 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/StorageClassAnalysisUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/StorageClassAnalysisUnmarshaller.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,69 +12,80 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// - /// StorageClassAnalysisUnmarshaller - /// - public class StorageClassAnalysisUnmarshaller : IXmlUnmarshaller + /// Response Unmarshaller for StorageClassAnalysis Object + /// + public partial class StorageClassAnalysisUnmarshaller : IXmlUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public StorageClassAnalysis Unmarshall(XmlUnmarshallerContext context) { - StorageClassAnalysis storageClassAnalysis = new StorageClassAnalysis(); + StorageClassAnalysis unmarshalledObject = new StorageClassAnalysis(); 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("DataExport", targetDepth)) { - storageClassAnalysis.DataExport = StorageClassAnalysisDataExportUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = StorageClassAnalysisDataExportUnmarshaller.Instance; + unmarshalledObject.DataExport = unmarshaller.Unmarshall(context); continue; } + + XmlStructureUnmarshallCustomization(context, unmarshalledObject, targetDepth); } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { - return storageClassAnalysis; + return unmarshalledObject; } - } - - - - return storageClassAnalysis; + } + return unmarshalledObject; } - private static StorageClassAnalysisUnmarshaller _instance; + partial void XmlStructureUnmarshallCustomization(XmlUnmarshallerContext context, StorageClassAnalysis unmarshalledObject, int targetDepth); + + private static StorageClassAnalysisUnmarshaller _instance = new StorageClassAnalysisUnmarshaller(); /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static StorageClassAnalysisUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new StorageClassAnalysisUnmarshaller(); - } return _instance; } } } -} +} \ No newline at end of file From ced9680413b327218b260f784ec930fe8af93a9a Mon Sep 17 00:00:00 2001 From: Peter Song Date: Thu, 6 Nov 2025 22:51:32 -0800 Subject: [PATCH 2/2] Generate ListBucketAnalyticsConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4128, branch: peterrsongg/petesong/phase-3-pr-2-all/4 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 2 +- .../ServiceModels/s3/s3.customizations.json | 14 ++ ...nalyticsConfigurationsRequestMarshaller.cs | 75 ----------- ...stBucketAnalyticsConfigurationsResponse.cs | 99 -------------- ...nalyticsConfigurationsRequestMarshaller.cs | 99 ++++++++++++++ ...yticsConfigurationsResponseUnmarshaller.cs | 118 ++++++++++------- ...istBucketAnalyticsConfigurationsRequest.cs | 83 +++++++----- ...stBucketAnalyticsConfigurationsResponse.cs | 125 ++++++++++++++++++ 8 files changed, 362 insertions(+), 253 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsRequestMarshaller.cs delete mode 100644 sdk/src/Services/S3/Custom/Model/ListBucketAnalyticsConfigurationsResponse.cs create mode 100644 sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsRequestMarshaller.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsResponseUnmarshaller.cs (54%) rename sdk/src/Services/S3/{Custom => Generated}/Model/ListBucketAnalyticsConfigurationsRequest.cs (61%) create mode 100644 sdk/src/Services/S3/Generated/Model/ListBucketAnalyticsConfigurationsResponse.cs diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index cf47d93f81d1..07b502aff69a 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -555,7 +555,7 @@ public List S3AllowListOperations new Operation(this, "GetBucketMetricsConfiguration", DocumentRoot[OperationsKey]["GetBucketMetricsConfiguration"]), //new Operation(this, "GetBucketVersioning", DocumentRoot[OperationsKey]["GetBucketVersioning"]), //new Operation(this, "GetBucketWebsite", DocumentRoot[OperationsKey]["GetBucketWebsite"]), - //new Operation(this, "ListBucketAnalyticsConfigurations", DocumentRoot[OperationsKey]["ListBucketAnalyticsConfigurations"]), + new Operation(this, "ListBucketAnalyticsConfigurations", DocumentRoot[OperationsKey]["ListBucketAnalyticsConfigurations"]), //new Operation(this, "ListBucketIntelligentTieringConfigurations", DocumentRoot[OperationsKey]["ListBucketIntelligentTieringConfigurations"]), //new Operation(this, "ListBucketInventoryConfigurations", DocumentRoot[OperationsKey]["ListBucketInventoryConfigurations"]), new Operation(this, "ListBucketMetricsConfigurations", DocumentRoot[OperationsKey]["ListBucketMetricsConfigurations"]), diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index 66f9df755191..ce43984c9beb 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -981,6 +981,20 @@ } } ] + }, + "ListBucketAnalyticsConfigurationsRequest":{ + "modify":[ + { + "ContinuationToken":{ + "injectXmlIsSet":["return !string.IsNullOrEmpty(this._continuationToken);"] + } + }, + { + "ExpectedBucketOwner" :{ + "injectXmlIsSet":["return !string.IsNullOrEmpty(this._expectedBucketOwner);"] + } + } + ] } }, "operationModifiers": { diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsRequestMarshaller.cs deleted file mode 100644 index 046afc39e91d..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsRequestMarshaller.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.S3.Util; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// List AnalyticsConfiguration Request Marshaller - /// - public class ListBucketAnalyticsConfigurationsRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((ListBucketAnalyticsConfigurationsRequest)input); - } - - public IRequest Marshall(ListBucketAnalyticsConfigurationsRequest listBucketAnalyticsConfigurationsRequest) - { - IRequest request = new DefaultRequest(listBucketAnalyticsConfigurationsRequest, "Amazon.S3"); - - request.HttpMethod = "GET"; - - if (listBucketAnalyticsConfigurationsRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(listBucketAnalyticsConfigurationsRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(listBucketAnalyticsConfigurationsRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "ListBucketAnalyticsConfigurationsRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("analytics"); - if (listBucketAnalyticsConfigurationsRequest.IsSetContinuationToken()) - { - request.AddSubResource("continuation-token", listBucketAnalyticsConfigurationsRequest.ContinuationToken.ToString()); - } - request.UseQueryString = true; - - return request; - } - - private static ListBucketAnalyticsConfigurationsRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static ListBucketAnalyticsConfigurationsRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new ListBucketAnalyticsConfigurationsRequestMarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/ListBucketAnalyticsConfigurationsResponse.cs b/sdk/src/Services/S3/Custom/Model/ListBucketAnalyticsConfigurationsResponse.cs deleted file mode 100644 index a5e19c635ebe..000000000000 --- a/sdk/src/Services/S3/Custom/Model/ListBucketAnalyticsConfigurationsResponse.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System; -using System.Collections.Generic; -using System.Xml.Serialization; -using System.Text; - -using Amazon.Runtime; - -namespace Amazon.S3.Model -{ - /// - /// Returns information about the ListBucketAnalyticsConfigurationsResponse response and response metadata. - /// - public partial class ListBucketAnalyticsConfigurationsResponse : AmazonWebServiceResponse - { - private string token; - private List analyticsConfigurationList = AWSConfigs.InitializeCollections ? new List() : null; - private bool? isTruncated; - private string nextToken; - - /// - /// The ContinuationToken that represents where this request began. - /// - public string ContinuationToken - { - get { return this.token; } - set { this.token = value; } - } - - // Check to see if ContinuationToken property is set - internal bool IsSetToken() - { - return !(string.IsNullOrEmpty(this.token)); - } - - /// - /// The list of analytics configurations for a bucket. - /// - public List AnalyticsConfigurationList - { - get { return this.analyticsConfigurationList; } - set { this.analyticsConfigurationList = value; } - } - - /// - /// Check to see if AnalyticsConfigurationList property is set - /// - /// - public bool IsSetAnalyticsConfigurationList() - { - return this.analyticsConfigurationList != null && (this.analyticsConfigurationList.Count > 0 || !AWSConfigs.InitializeCollections); - } - - /// - /// Indicates whether the returned list of analytics configurations is complete. - /// A value of true indicates that the list is not complete and the NextContinuationToken will be provided for a subsequent request. - /// - public bool? IsTruncated - { - get { return this.isTruncated; } - set { this.isTruncated = value; } - } - - // Check to see if IsTruncated property is set - internal bool IsSetIsTruncated() - { - return this.isTruncated.HasValue; - } - - /// - /// NextContinuationToken is sent when isTruncated is true, which indicates that there are more analytics configurations to list. - /// The next request must include this NextContinuationToken. The token is obfuscated and is not a usable value. - /// - public string NextContinuationToken - { - get { return this.nextToken; } - set { this.nextToken = value; } - } - - // Check to see if NextContinuationToken property is set - internal bool IsSetNextToken() - { - return !(string.IsNullOrEmpty(this.nextToken)); - } - } -} diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsRequestMarshaller.cs new file mode 100644 index 000000000000..e8680e0661f0 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsRequestMarshaller.cs @@ -0,0 +1,99 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +using System.Xml; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// ListBucketAnalyticsConfigurations Request Marshaller + /// + public partial class ListBucketAnalyticsConfigurationsRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((ListBucketAnalyticsConfigurationsRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(ListBucketAnalyticsConfigurationsRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "GET"; + request.AddSubResource("analytics"); + + 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.", "ListBucketAnalyticsConfigurationsRequest.BucketName"); + + if (publicRequest.IsSetContinuationToken()) + request.Parameters.Add("continuation-token", StringUtils.FromString(publicRequest.ContinuationToken)); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static ListBucketAnalyticsConfigurationsRequestMarshaller _instance = new ListBucketAnalyticsConfigurationsRequestMarshaller(); + + internal static ListBucketAnalyticsConfigurationsRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static ListBucketAnalyticsConfigurationsRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, ListBucketAnalyticsConfigurationsRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, ListBucketAnalyticsConfigurationsRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsResponseUnmarshaller.cs similarity index 54% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsResponseUnmarshaller.cs index 687e548dcb04..84a6a5d1689e 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/ListBucketAnalyticsConfigurationsResponseUnmarshaller.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,84 +12,86 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; -using System.Net; using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; + using Amazon.S3.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; -#pragma warning disable 1591 - +#pragma warning disable CS0612,CS0618 namespace Amazon.S3.Model.Internal.MarshallTransformations { /// - /// Response Unmarshaller for ListAnalyticsConfiguration operation - /// - public class ListBucketAnalyticsConfigurationsResponseUnmarshaller : S3ReponseUnmarshaller + /// Response Unmarshaller for ListBucketAnalyticsConfigurations operation + /// + public partial class ListBucketAnalyticsConfigurationsResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. - /// + /// /// /// public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListBucketAnalyticsConfigurationsResponse response = new ListBucketAnalyticsConfigurationsResponse(); - - while (context.Read()) - { - if (context.IsStartElement) - { - UnmarshallResult(context, response); - continue; - } - } - - + UnmarshallResult(context,response); + + PostUnmarshallCustomization(context, response); return response; - } + } private static void UnmarshallResult(XmlUnmarshallerContext context, ListBucketAnalyticsConfigurationsResponse response) { - int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; - - if (context.IsStartOfDocument) - targetDepth += 2; - + if (context.IsStartOfDocument) + targetDepth += 1; + if (context.IsEmptyResponse) + { + return; + } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { - if (context.TestExpression("ContinuationToken", targetDepth)) - { - response.ContinuationToken = StringUnmarshaller.Instance.Unmarshall(context); - - continue; - } - if (context.TestExpression("AnalyticsConfiguration", targetDepth)) { if (response.AnalyticsConfigurationList == null) { response.AnalyticsConfigurationList = new List(); } - response.AnalyticsConfigurationList.Add(AnalyticsConfigurationUnmarshaller.Instance.Unmarshall(context)); + var unmarshaller = AnalyticsConfigurationUnmarshaller.Instance; + response.AnalyticsConfigurationList.Add(unmarshaller.Unmarshall(context)); + continue; + } + if (context.TestExpression("ContinuationToken", targetDepth)) + { + var unmarshaller = StringUnmarshaller.Instance; + response.ContinuationToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IsTruncated", targetDepth)) { - response.IsTruncated = BoolUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = NullableBoolUnmarshaller.Instance; + response.IsTruncated = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextContinuationToken", targetDepth)) { - response.NextContinuationToken = StringUnmarshaller.Instance.Unmarshall(context); - + var unmarshaller = StringUnmarshaller.Instance; + response.NextContinuationToken = unmarshaller.Unmarshall(context); continue; } } @@ -98,27 +100,51 @@ private static void UnmarshallResult(XmlUnmarshallerContext context, ListBucketA return; } } + return; + } + + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + var responseBodyBytes = context.GetResponseBodyBytes(); - return; + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); } - private static ListBucketAnalyticsConfigurationsResponseUnmarshaller _instance = new ListBucketAnalyticsConfigurationsResponseUnmarshaller(); + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, ListBucketAnalyticsConfigurationsResponse response); + + private static ListBucketAnalyticsConfigurationsResponseUnmarshaller _instance = new ListBucketAnalyticsConfigurationsResponseUnmarshaller(); + + internal static ListBucketAnalyticsConfigurationsResponseUnmarshaller GetInstance() + { + return _instance; + } /// - /// Singleton for the unmarshaller - /// + /// Gets the singleton. + /// public static ListBucketAnalyticsConfigurationsResponseUnmarshaller Instance { get { - if (_instance == null) - { - _instance = new ListBucketAnalyticsConfigurationsResponseUnmarshaller(); - } return _instance; } } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/ListBucketAnalyticsConfigurationsRequest.cs b/sdk/src/Services/S3/Generated/Model/ListBucketAnalyticsConfigurationsRequest.cs similarity index 61% rename from sdk/src/Services/S3/Custom/Model/ListBucketAnalyticsConfigurationsRequest.cs rename to sdk/src/Services/S3/Generated/Model/ListBucketAnalyticsConfigurationsRequest.cs index bbc1691cc45e..00219aaca72b 100644 --- a/sdk/src/Services/S3/Custom/Model/ListBucketAnalyticsConfigurationsRequest.cs +++ b/sdk/src/Services/S3/Generated/Model/ListBucketAnalyticsConfigurationsRequest.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). @@ -12,20 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// /// Container for the parameters to the ListBucketAnalyticsConfigurations operation. /// /// - /// This operation is not supported by directory buckets. + /// This operation is not supported for directory buckets. /// /// /// @@ -35,16 +43,16 @@ namespace Amazon.S3.Model /// /// /// This action supports list pagination and does not return more than 100 configurations - /// at a time. You should always check the IsTruncated element in the response. - /// If there are no more configurations to list, IsTruncated is set to false. - /// If there are more configurations to list, IsTruncated is set to true, - /// and there will be a value in NextContinuationToken. You use the NextContinuationToken + /// at a time. You should always check the IsTruncated element in the response. + /// If there are no more configurations to list, IsTruncated is set to false. If + /// there are more configurations to list, IsTruncated is set to true, and there + /// will be a value in NextContinuationToken. You use the NextContinuationToken /// value to continue the pagination of the list by passing the value in continuation-token - /// in the request to GET the next page. + /// in the request to GET the next page. /// /// /// - /// To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration + /// To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration /// action. The bucket owner has this permission by default. The bucket owner can grant /// this permission to others. For more information about permissions, see Permissions /// Related to Bucket Subresource Operations and Managing @@ -57,7 +65,7 @@ namespace Amazon.S3.Model /// /// /// - /// The following operations are related to ListBucketAnalyticsConfigurations: + /// The following operations are related to ListBucketAnalyticsConfigurations: /// /// + /// + /// + /// You must URL encode any signed header values that contain spaces. For example, if + /// your header value is my file.txt, containing two spaces after my, you + /// must URL encode this value to my%20%20file.txt. + /// + /// /// public partial class ListBucketAnalyticsConfigurationsRequest : AmazonWebServiceRequest { - private string bucketName; - private string token; - private string expectedBucketOwner; + private string _bucketName; + private string _continuationToken; + private string _expectedBucketOwner; /// - /// The name of the bucket containing the analytics configurations to retrieve. + /// Gets and sets the property BucketName. + /// + /// The name of the bucket from which analytics configurations are retrieved. + /// /// + [AWSProperty(Required=true)] public string BucketName { - get { return this.bucketName; } - set { this.bucketName = value; } + get { return this._bucketName; } + set { this._bucketName = value; } } - // Check to see if Bucket property is set - internal bool IsSetBucket() + // Check to see if BucketName property is set + internal bool IsSetBucketName() { - return !(string.IsNullOrEmpty(this.bucketName)); + return this._bucketName != null; } /// - /// The ContinuationToken that represents a placeholder from where this request + /// Gets and sets the property ContinuationToken. + /// + /// The ContinuationToken that represents a placeholder from where this request /// should begin. + /// /// public string ContinuationToken { - get { return this.token; } - set { this.token = value; } + get { return this._continuationToken; } + set { this._continuationToken = value; } } // Check to see if ContinuationToken property is set internal bool IsSetContinuationToken() { - return !(string.IsNullOrEmpty(this.ContinuationToken)); + return !string.IsNullOrEmpty(this._continuationToken); } /// @@ -118,22 +139,20 @@ internal bool IsSetContinuationToken() /// /// The account ID of the expected bucket owner. If the account ID that you provide does /// not match the actual owner of the bucket, the request fails with the HTTP status code - /// 403 Forbidden (access denied). + /// 403 Forbidden (access denied). /// /// public string ExpectedBucketOwner { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } } - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. + // Check to see if ExpectedBucketOwner property is set internal bool IsSetExpectedBucketOwner() { - return !String.IsNullOrEmpty(this.expectedBucketOwner); + return !string.IsNullOrEmpty(this._expectedBucketOwner); } + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/ListBucketAnalyticsConfigurationsResponse.cs b/sdk/src/Services/S3/Generated/Model/ListBucketAnalyticsConfigurationsResponse.cs new file mode 100644 index 000000000000..42b2bba42986 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/ListBucketAnalyticsConfigurationsResponse.cs @@ -0,0 +1,125 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// This is the response object from the ListBucketAnalyticsConfigurations operation. + /// + public partial class ListBucketAnalyticsConfigurationsResponse : AmazonWebServiceResponse + { + private List _analyticsConfigurationList = AWSConfigs.InitializeCollections ? new List() : null; + private string _continuationToken; + private bool? _isTruncated; + private string _nextContinuationToken; + + /// + /// Gets and sets the property AnalyticsConfigurationList. + /// + /// The list of analytics configurations for a bucket. + /// + /// + /// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned + /// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller + /// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous + /// SDK behavior set the AWSConfigs.InitializeCollections static property to true. + /// + public List AnalyticsConfigurationList + { + get { return this._analyticsConfigurationList; } + set { this._analyticsConfigurationList = value; } + } + + // Check to see if AnalyticsConfigurationList property is set + internal bool IsSetAnalyticsConfigurationList() + { + return this._analyticsConfigurationList != null && (this._analyticsConfigurationList.Count > 0 || !AWSConfigs.InitializeCollections); + } + + /// + /// Gets and sets the property ContinuationToken. + /// + /// The marker that is used as a starting point for this analytics configuration list + /// response. This value is present if it was sent in the request. + /// + /// + public string ContinuationToken + { + get { return this._continuationToken; } + set { this._continuationToken = value; } + } + + // Check to see if ContinuationToken property is set + internal bool IsSetContinuationToken() + { + return this._continuationToken != null; + } + + /// + /// Gets and sets the property IsTruncated. + /// + /// Indicates whether the returned list of analytics configurations is complete. A value + /// of true indicates that the list is not complete and the NextContinuationToken will + /// be provided for a subsequent request. + /// + /// + public bool? IsTruncated + { + get { return this._isTruncated; } + set { this._isTruncated = value; } + } + + // Check to see if IsTruncated property is set + internal bool IsSetIsTruncated() + { + return this._isTruncated.HasValue; + } + + /// + /// Gets and sets the property NextContinuationToken. + /// + /// NextContinuationToken is sent when isTruncated is true, which indicates + /// that there are more analytics configurations to list. The next request must include + /// this NextContinuationToken. The token is obfuscated and is not a usable value. + /// + /// + public string NextContinuationToken + { + get { return this._nextContinuationToken; } + set { this._nextContinuationToken = value; } + } + + // Check to see if NextContinuationToken property is set + internal bool IsSetNextContinuationToken() + { + return this._nextContinuationToken != null; + } + + } +} \ No newline at end of file