diff --git a/generator/ServiceClientGeneratorLib/ServiceModel.cs b/generator/ServiceClientGeneratorLib/ServiceModel.cs index 74c33ab8291f..61b8e7ba4a0c 100644 --- a/generator/ServiceClientGeneratorLib/ServiceModel.cs +++ b/generator/ServiceClientGeneratorLib/ServiceModel.cs @@ -571,7 +571,7 @@ public List S3AllowListOperations new Operation(this, "DeleteBucketMetricsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetricsConfiguration"]), new Operation(this, "DeleteBucketAnalyticsConfiguration", DocumentRoot[OperationsKey]["DeleteBucketAnalyticsConfiguration"]), new Operation(this, "DeleteBucketIntelligentTieringConfiguration", DocumentRoot[OperationsKey]["DeleteBucketIntelligentTieringConfiguration"]), - //new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), + new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]), }; } diff --git a/generator/ServiceModels/s3/s3.customizations.json b/generator/ServiceModels/s3/s3.customizations.json index c4e3dbd14361..8d40ec042246 100644 --- a/generator/ServiceModels/s3/s3.customizations.json +++ b/generator/ServiceModels/s3/s3.customizations.json @@ -1163,6 +1163,16 @@ "NextToken":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._nextToken);"]} } ] + }, + "DeleteBucketInventoryConfigurationRequest":{ + "modify":[ + { + "Id":{"emitPropertyName":"InventoryId"} + }, + { + "ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]} + } + ] } }, diff --git a/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationRequest.cs b/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationRequest.cs deleted file mode 100644 index c9429fa0f9b1..000000000000 --- a/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationRequest.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System; -using System.Collections.Generic; -using System.Xml.Serialization; -using System.Text; -using System.IO; - -using Amazon.Runtime; -using Amazon.Runtime.Internal; - - -namespace Amazon.S3.Model -{ - /// - /// Container for the parameters to the DeleteInventoryConfiguration operation. - /// Deletes an inventory configuration (identified by the inventory ID) from the bucket. - /// - public partial class DeleteBucketInventoryConfigurationRequest : AmazonWebServiceRequest - { - private string bucketName; - private string inventoryId; - private string expectedBucketOwner; - - /// - /// The name of the bucket containing the inventory configuration to delete. - /// - public string BucketName - { - get { return this.bucketName; } - set { this.bucketName = value; } - } - - // Check to see if BucketName property is set - internal bool IsSetBucketName() - { - return !(string.IsNullOrEmpty(this.bucketName)); - } - - /// - /// The ID used to identify the inventory configuration. - /// - public string InventoryId - { - get { return this.inventoryId; } - set { this.inventoryId = value; } - } - - // Check to see if InventoryId property is set - internal bool IsSetInventoryId() - { - return !(string.IsNullOrEmpty(this.inventoryId)); - } - - /// - /// Gets and sets the property ExpectedBucketOwner. - /// - /// The account ID of the expected bucket owner. If the account ID that you provide does - /// not match the actual owner of the bucket, the request fails with the HTTP status code - /// 403 Forbidden (access denied). - /// - /// - public string ExpectedBucketOwner - { - get { return this.expectedBucketOwner; } - set { this.expectedBucketOwner = value; } - } - - /// - /// Checks to see if ExpectedBucketOwner is set. - /// - /// true, if ExpectedBucketOwner property is set. - internal bool IsSetExpectedBucketOwner() - { - return !String.IsNullOrEmpty(this.expectedBucketOwner); - } - - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs deleted file mode 100644 index d2bf215460f2..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; -using Amazon.S3.Util; - -#pragma warning disable 1591 - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Delete InventoryConfiguration Request Marshaller - /// - public class DeleteBucketInventoryConfigurationRequestMarshaller : IMarshaller, IMarshaller - { - public IRequest Marshall(Amazon.Runtime.AmazonWebServiceRequest input) - { - return this.Marshall((DeleteBucketInventoryConfigurationRequest)input); - } - - public IRequest Marshall(DeleteBucketInventoryConfigurationRequest deleteInventoryConfigurationRequest) - { - IRequest request = new DefaultRequest(deleteInventoryConfigurationRequest, "Amazon.S3"); - - request.HttpMethod = "DELETE"; - - if (deleteInventoryConfigurationRequest.IsSetExpectedBucketOwner()) - request.Headers.Add(S3Constants.AmzHeaderExpectedBucketOwner, S3Transforms.ToStringValue(deleteInventoryConfigurationRequest.ExpectedBucketOwner)); - - if (string.IsNullOrEmpty(deleteInventoryConfigurationRequest.BucketName)) - throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "DeleteBucketInventoryConfigurationRequest.BucketName"); - - request.ResourcePath = "/"; - request.AddSubResource("inventory"); - request.AddSubResource("id", deleteInventoryConfigurationRequest.InventoryId); - request.UseQueryString = true; - - return request; - } - - private static DeleteBucketInventoryConfigurationRequestMarshaller _instance; - - /// - /// Singleton for marshaller - /// - public static DeleteBucketInventoryConfigurationRequestMarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new DeleteBucketInventoryConfigurationRequestMarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs deleted file mode 100644 index f7f4a8e1be7a..000000000000 --- a/sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -using System; -using System.Net; -using System.Collections.Generic; -using Amazon.S3.Model; -using Amazon.Runtime; -using Amazon.Runtime.Internal; -using Amazon.Runtime.Internal.Transform; - -namespace Amazon.S3.Model.Internal.MarshallTransformations -{ - /// - /// Response Unmarshaller for DeleteInventoryConfiguration operation - /// - public class DeleteBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller - { - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) - { - DeleteBucketInventoryConfigurationResponse response = new DeleteBucketInventoryConfigurationResponse(); - - return response; - } - - private static DeleteBucketInventoryConfigurationResponseUnmarshaller _instance; - - /// - /// Singleton for the unmarshaller - /// - public static DeleteBucketInventoryConfigurationResponseUnmarshaller Instance - { - get - { - if (_instance == null) - { - _instance = new DeleteBucketInventoryConfigurationResponseUnmarshaller(); - } - return _instance; - } - } - } -} diff --git a/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationRequest.cs b/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationRequest.cs new file mode 100644 index 000000000000..dfee3069c261 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationRequest.cs @@ -0,0 +1,147 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Xml.Serialization; +using System.Text; +using System.IO; +using System.Net; + +using Amazon.Runtime; +using Amazon.Runtime.Internal; + +#pragma warning disable CS0612,CS0618,CS1570 +namespace Amazon.S3.Model +{ + /// + /// Container for the parameters to the DeleteBucketInventoryConfiguration operation. + /// + /// + /// This operation is not supported for directory buckets. + /// + /// + /// + /// Deletes an S3 Inventory configuration (identified by the inventory ID) from the bucket. + /// + /// + /// + /// To use this operation, you must have permissions to perform the s3:PutInventoryConfiguration + /// action. The bucket owner has this permission by default. The bucket owner can grant + /// this permission to others. For more information about permissions, see Permissions + /// Related to Bucket Subresource Operations and Managing + /// Access Permissions to Your Amazon S3 Resources. + /// + /// + /// + /// For information about the Amazon S3 inventory feature, see Amazon + /// S3 Inventory. + /// + /// + /// + /// Operations related to DeleteBucketInventoryConfiguration include: + /// + /// + /// + /// You must URL encode any signed header values that contain spaces. For example, if + /// your header value is my file.txt, containing two spaces after my, you + /// must URL encode this value to my%20%20file.txt. + /// + /// + /// + public partial class DeleteBucketInventoryConfigurationRequest : AmazonWebServiceRequest + { + private string _bucketName; + private string _expectedBucketOwner; + private string _inventoryId; + + /// + /// Gets and sets the property BucketName. + /// + /// The name of the bucket containing the inventory configuration to delete. + /// + /// + [AWSProperty(Required=true)] + public string BucketName + { + get { return this._bucketName; } + set { this._bucketName = value; } + } + + // Check to see if BucketName property is set + internal bool IsSetBucketName() + { + return this._bucketName != null; + } + + /// + /// Gets and sets the property ExpectedBucketOwner. + /// + /// The account ID of the expected bucket owner. If the account ID that you provide does + /// not match the actual owner of the bucket, the request fails with the HTTP status code + /// 403 Forbidden (access denied). + /// + /// + public string ExpectedBucketOwner + { + get { return this._expectedBucketOwner; } + set { this._expectedBucketOwner = value; } + } + + // Check to see if ExpectedBucketOwner property is set + internal bool IsSetExpectedBucketOwner() + { + return !String.IsNullOrEmpty(this._expectedBucketOwner); + } + + /// + /// Gets and sets the property InventoryId. + /// + /// The ID used to identify the inventory configuration. + /// + /// + [AWSProperty(Required=true)] + public string InventoryId + { + get { return this._inventoryId; } + set { this._inventoryId = value; } + } + + // Check to see if InventoryId property is set + internal bool IsSetInventoryId() + { + return this._inventoryId != null; + } + + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationResponse.cs b/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationResponse.cs similarity index 73% rename from sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationResponse.cs rename to sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationResponse.cs index cb2fb4057194..0b1098a4e85d 100644 --- a/sdk/src/Services/S3/Custom/Model/DeleteBucketInventoryConfigurationResponse.cs +++ b/sdk/src/Services/S3/Generated/Model/DeleteBucketInventoryConfigurationResponse.cs @@ -12,20 +12,28 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; +using System.IO; +using System.Net; using Amazon.Runtime; +using Amazon.Runtime.Internal; +#pragma warning disable CS0612,CS0618,CS1570 namespace Amazon.S3.Model { /// - /// Returns information about the DeleteInventoryConfiguration response metadata. - /// The DeleteInventoryConfiguration operation has a void result type. + /// This is the response object from the DeleteBucketInventoryConfiguration operation. /// public partial class DeleteBucketInventoryConfigurationResponse : AmazonWebServiceResponse { + } -} +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs new file mode 100644 index 000000000000..ca7fc5603ea9 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationRequestMarshaller.cs @@ -0,0 +1,101 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; +using System.Xml; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// DeleteBucketInventoryConfiguration Request Marshaller + /// + public partial class DeleteBucketInventoryConfigurationRequestMarshaller : IMarshaller , IMarshaller + { + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(AmazonWebServiceRequest input) + { + return this.Marshall((DeleteBucketInventoryConfigurationRequest)input); + } + + /// + /// Marshaller the request object to the HTTP request. + /// + /// + /// + public IRequest Marshall(DeleteBucketInventoryConfigurationRequest publicRequest) + { + var request = new DefaultRequest(publicRequest, "Amazon.S3"); + PreMarshallCustomization(request, publicRequest); + request.HttpMethod = "DELETE"; + request.AddSubResource("inventory"); + + if (publicRequest.IsSetExpectedBucketOwner()) + { + request.Headers["x-amz-expected-bucket-owner"] = publicRequest.ExpectedBucketOwner; + } + if (string.IsNullOrEmpty(publicRequest.BucketName)) + throw new System.ArgumentException("BucketName is a required property and must be set before making this call.", "DeleteBucketInventoryConfigurationRequest.BucketName"); + if (string.IsNullOrEmpty(publicRequest.InventoryId)) + throw new AmazonS3Exception("Request object does not have required field InventoryId set"); + + if (publicRequest.IsSetInventoryId()) + request.Parameters.Add("id", StringUtils.FromString(publicRequest.InventoryId)); + request.ResourcePath = "/"; + + PostMarshallCustomization(request, publicRequest); + request.UseQueryString = true; + return request; + } + private static DeleteBucketInventoryConfigurationRequestMarshaller _instance = new DeleteBucketInventoryConfigurationRequestMarshaller(); + + internal static DeleteBucketInventoryConfigurationRequestMarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static DeleteBucketInventoryConfigurationRequestMarshaller Instance + { + get + { + return _instance; + } + } + + partial void PostMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketInventoryConfigurationRequest publicRequest); + partial void PreMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketInventoryConfigurationRequest publicRequest); + } +} \ No newline at end of file diff --git a/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs new file mode 100644 index 000000000000..516de60a49c4 --- /dev/null +++ b/sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketInventoryConfigurationResponseUnmarshaller.cs @@ -0,0 +1,98 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +/* + * Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model. + */ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Text; +using System.Xml.Serialization; + +using Amazon.S3.Model; +using Amazon.Runtime; +using Amazon.Runtime.Internal; +using Amazon.Runtime.Internal.Transform; +using Amazon.Runtime.Internal.Util; + +#pragma warning disable CS0612,CS0618 +namespace Amazon.S3.Model.Internal.MarshallTransformations +{ + /// + /// Response Unmarshaller for DeleteBucketInventoryConfiguration operation + /// + public partial class DeleteBucketInventoryConfigurationResponseUnmarshaller : S3ReponseUnmarshaller + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) + { + DeleteBucketInventoryConfigurationResponse response = new DeleteBucketInventoryConfigurationResponse(); + + PostUnmarshallCustomization(context, response); + return response; + } + + + /// + /// Unmarshaller error response to exception. + /// + /// + /// + /// + /// + public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) + { + S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context); + errorResponse.InnerException = innerException; + errorResponse.StatusCode = statusCode; + + var responseBodyBytes = context.GetResponseBodyBytes(); + + using (var streamCopy = new MemoryStream(responseBodyBytes)) + using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) + { + } + return base.ConstructS3Exception(context, errorResponse, innerException, statusCode); + } + + partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, DeleteBucketInventoryConfigurationResponse response); + + private static DeleteBucketInventoryConfigurationResponseUnmarshaller _instance = new DeleteBucketInventoryConfigurationResponseUnmarshaller(); + + internal static DeleteBucketInventoryConfigurationResponseUnmarshaller GetInstance() + { + return _instance; + } + + /// + /// Gets the singleton. + /// + public static DeleteBucketInventoryConfigurationResponseUnmarshaller Instance + { + get + { + return _instance; + } + } + + } +} \ No newline at end of file