From 241693e5ec8bd24002b0327b5d840c871cfcaff3 Mon Sep 17 00:00:00 2001 From: Peter Song Date: Tue, 25 Nov 2025 10:28:04 -0800 Subject: [PATCH] Generate DeleteBucketMetadataConfiguration stack-info: PR: https://github.com/aws/aws-sdk-net/pull/4204, branch: peterrsongg/petesong/phase-3-pr5-rebased-2/1 --- .../ServiceClientGeneratorLib/ServiceModel.cs | 6 +- .../ServiceModels/s3/s3.customizations.json | 7 + ...eleteBucketMetadataConfigurationRequest.cs | 69 --------- ...eleteBucketMetadataConfigurationRequest.cs | 133 ++++++++++++++++++ ...leteBucketMetadataConfigurationResponse.cs | 0 ...tMetadataConfigurationRequestMarshaller.cs | 10 +- ...tadataConfigurationResponseUnmarshaller.cs | 13 +- 7 files changed, 160 insertions(+), 78 deletions(-) delete mode 100644 sdk/src/Services/S3/Custom/Model/DeleteBucketMetadataConfigurationRequest.cs create mode 100644 sdk/src/Services/S3/Generated/Model/DeleteBucketMetadataConfigurationRequest.cs rename sdk/src/Services/S3/{Custom => Generated}/Model/DeleteBucketMetadataConfigurationResponse.cs (100%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs (82%) rename sdk/src/Services/S3/{Custom => Generated}/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs (82%) diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 5d0a63188b3b..563eab474e26 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -574,7 +574,8 @@ public List S3AllowListOperations new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), new Operation(this,"PutBucketRequestPayment", DocumentRoot[OperationsKey]["PutBucketRequestPayment"]), new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"]), - new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"]) + new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"]), + new Operation(this, "DeleteBucketMetadataConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetadataConfiguration"]) }; } @@ -606,7 +607,8 @@ public List S3RequestMarshallerThrowGenericExceptionList "GetObjectAcl", "PutBucketAcl", "CreateBucketMetadataConfiguration", - "GetBucketMetadataConfiguration" + "GetBucketMetadataConfiguration", + "DeleteBucketMetadataConfiguration" }; } return _s3RequestMarshallerThrowAmazonS3ExceptionList; diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index b241f9a605a7..93ccd709a143 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1217,6 +1217,13 @@ "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} } ] + }, + "DeleteBucketMetadataConfigurationRequest":{ + "modify":[ + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/DeleteBucketMetadataConfigurationRequest.cs b/sdk/src/Services/S3/Custom/Model/DeleteBucketMetadataConfigurationRequest.cs deleted file mode 100644 index 7402d0709a41..000000000000 --- a/sdk/src/Services/S3/Custom/Model/DeleteBucketMetadataConfigurationRequest.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -using System; -using System.Collections.Generic; -using System.Xml.Serialization; -using System.Text; -using System.IO; -using System.Net; - -using Amazon.Runtime; -using Amazon.Runtime.Internal; - -#pragma warning disable CS0612,CS0618,CS1570 -namespace Amazon.S3.Model -{ - /// - /// Container for the parameters to the DeleteBucketMetadataConfiguration operation. - /// - /// - public partial class DeleteBucketMetadataConfigurationRequest : AmazonWebServiceRequest - { - private string bucketName; - private string expectedBucketOwner; - - /// - /// Gets and sets the property BucketName. - /// - public string BucketName - { - get { return this.bucketName; } - set { this.bucketName = value; } - } - - // Check to see if BucketName property is set - internal bool IsSetBucketName() - { - return !String.IsNullOrEmpty(this.bucketName); - } - - /// - /// Gets and sets the property ExpectedBucketOwner. - /// - public string ExpectedBucketOwner - { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } - } - - // Check to see if ExpectedBucketOwner property is set - internal bool IsSetExpectedBucketOwner() - { - return !String.IsNullOrEmpty(this.expectedBucketOwner); - } - - } -} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/DeleteBucketMetadataConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/DeleteBucketMetadataConfigurationRequest.cs new file mode 100644 index 000000000000..a52a3a423489 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/DeleteBucketMetadataConfigurationRequest.cs @@ -0,0 +1,133 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Container for the parameters to the DeleteBucketMetadataConfiguration operation. + /// Deletes an S3 Metadata configuration from a general purpose bucket. For more information, + /// see Accelerating + /// data discovery with S3 Metadata in the Amazon S3 User Guide. + /// + /// + /// + /// You can use the V2 DeleteBucketMetadataConfiguration API operation with V1 + /// or V2 metadata configurations. However, if you try to use the V1 DeleteBucketMetadataTableConfiguration + /// API operation with V2 configurations, you will receive an HTTP 405 Method Not Allowed + /// error. + /// + ///
Permissions
+ /// + /// To use this operation, you must have the s3:DeleteBucketMetadataTableConfiguration + /// permission. For more information, see Setting + /// up permissions for configuring metadata tables in the Amazon S3 User Guide. + /// + /// + /// + /// + /// The IAM policy action name is the same for the V1 and V2 API operations. + /// + ///
+ /// + /// The following operations are related to DeleteBucketMetadataConfiguration: + /// + /// + /// + /// 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 DeleteBucketMetadataConfigurationRequest : AmazonWebServiceRequest + { + private string _bucketName; + private string _expectedBucketOwner; + + /// + /// Gets and sets the property BucketName. + /// + /// The general purpose bucket that you want to remove the metadata configuration from. + /// + /// + /// + [AWSProperty(Required=true)] + public string BucketName + { + get { return this._bucketName; } + set { this._bucketName = value; } + } + + // Check to see if BucketName property is set + internal bool IsSetBucketName() + { + return this._bucketName != null; + } + + /// + /// Gets and sets the property ExpectedBucketOwner. + /// + /// The expected bucket owner of the general purpose bucket that you want to remove the + /// metadata table configuration from. + /// + /// + public string ExpectedBucketOwner + { + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } + } + + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() + { + return !String.IsNullOrEmpty(this._expectedBucketOwner); + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/DeleteBucketMetadataConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/DeleteBucketMetadataConfigurationResponse.cs similarity index 100% rename from sdk/src/Services/S3/Custom/Model/DeleteBucketMetadataConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/DeleteBucketMetadataConfigurationResponse.cs diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs similarity index 82% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs index f65958b9936d..34e31112270d 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// DeleteBucketMetadataConfiguration Request Marshaller /// - public class DeleteBucketMetadataConfigurationRequestMarshaller : IMarshaller , IMarshaller + public partial class DeleteBucketMetadataConfigurationRequestMarshaller : IMarshaller , IMarshaller { /// /// Marshaller the request object to the HTTP request. @@ -56,6 +56,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) public IRequest Marshall(DeleteBucketMetadataConfigurationRequest publicRequest) { var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); request.HttpMethod = "DELETE"; request.AddSubResource("metadataConfiguration"); @@ -65,10 +66,9 @@ public IRequest Marshall(DeleteBucketMetadataConfigurationRequest publicRequest) } if (!publicRequest.IsSetBucketName()) throw new AmazonS3Exception("Request object does not have required field BucketName set"); - request.AddPathResource("{Bucket}", StringUtils.FromString(publicRequest.BucketName)); - request.ResourcePath = "/{Bucket}"; - + request.ResourcePath = "/"; + PostMarshallCustomization(request, publicRequest); return request; } private static DeleteBucketMetadataConfigurationRequestMarshaller _instance = new DeleteBucketMetadataConfigurationRequestMarshaller(); @@ -89,5 +89,7 @@ public static DeleteBucketMetadataConfigurationRequestMarshaller Instance } } + partial void PostMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketMetadataConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketMetadataConfigurationRequest publicRequest); } } \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs similarity index 82% rename from sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs rename to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs index 58aecfc76892..48a0740d071e 100644 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs @@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for DeleteBucketMetadataConfiguration operation /// - public class DeleteBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + public partial class DeleteBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller { /// /// Unmarshaller the response from the service to the response class. @@ -47,6 +47,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte { DeleteBucketMetadataConfigurationResponse response = new DeleteBucketMetadataConfigurationResponse(); + PostUnmarshallCustomization(context, response); return response; } @@ -60,7 +61,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - var errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; @@ -70,11 +71,17 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) { } - return new AmazonS3Exception(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode); + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); } + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, DeleteBucketMetadataConfigurationResponse response); + private static DeleteBucketMetadataConfigurationResponseUnmarshaller _instance = new DeleteBucketMetadataConfigurationResponseUnmarshaller(); + internal static DeleteBucketMetadataConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } /// /// Gets the singleton.