Skip to content

Commit 04b1ed4

Browse files
committed
Generate DeleteBucketMetadataConfiguration
stack-info: PR: #4204, branch: peterrsongg/petesong/phase-3-pr5-rebased-2/1
1 parent c3b7192 commit 04b1ed4

File tree

7 files changed

+160
-78
lines changed

7 files changed

+160
-78
lines changed

generator/ServiceClientGeneratorLib/ServiceModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ public List<Operation> S3AllowListOperations
574574
new Operation(this, "DeleteBucketInventoryConfiguration", DocumentRoot[OperationsKey]["DeleteBucketInventoryConfiguration"]),
575575
new Operation(this,"PutBucketRequestPayment", DocumentRoot[OperationsKey]["PutBucketRequestPayment"]),
576576
new Operation(this, "CreateBucketMetadataConfiguration",DocumentRoot[OperationsKey]["CreateBucketMetadataConfiguration"]),
577-
new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"])
577+
new Operation(this, "GetBucketMetadataConfiguration", DocumentRoot[OperationsKey]["GetBucketMetadataConfiguration"]),
578+
new Operation(this, "DeleteBucketMetadataConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetadataConfiguration"])
578579

579580
};
580581
}
@@ -606,7 +607,8 @@ public List<string> S3RequestMarshallerThrowGenericExceptionList
606607
"GetObjectAcl",
607608
"PutBucketAcl",
608609
"CreateBucketMetadataConfiguration",
609-
"GetBucketMetadataConfiguration"
610+
"GetBucketMetadataConfiguration",
611+
"DeleteBucketMetadataConfiguration"
610612
};
611613
}
612614
return _s3RequestMarshallerThrowAmazonS3ExceptionList;

generator/ServiceModels/s3/s3.customizations.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,13 @@
12171217
"ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]}
12181218
}
12191219
]
1220+
},
1221+
"DeleteBucketMetadataConfigurationRequest":{
1222+
"modify":[
1223+
{
1224+
"ExpectedBucketOwner":{"injectXmlIsSet":["return !String.IsNullOrEmpty(this._expectedBucketOwner);"]}
1225+
}
1226+
]
12201227
}
12211228

12221229
},

sdk/src/Services/S3/Custom/Model/DeleteBucketMetadataConfigurationRequest.cs

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.S3.Model
31+
{
32+
/// <summary>
33+
/// Container for the parameters to the DeleteBucketMetadataConfiguration operation.
34+
/// Deletes an S3 Metadata configuration from a general purpose bucket. For more information,
35+
/// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html">Accelerating
36+
/// data discovery with S3 Metadata</a> in the <i>Amazon S3 User Guide</i>.
37+
///
38+
/// <note>
39+
/// <para>
40+
/// You can use the V2 <c>DeleteBucketMetadataConfiguration</c> API operation with V1
41+
/// or V2 metadata configurations. However, if you try to use the V1 <c>DeleteBucketMetadataTableConfiguration</c>
42+
/// API operation with V2 configurations, you will receive an HTTP <c>405 Method Not Allowed</c>
43+
/// error.
44+
/// </para>
45+
/// </note> <dl> <dt>Permissions</dt> <dd>
46+
/// <para>
47+
/// To use this operation, you must have the <c>s3:DeleteBucketMetadataTableConfiguration</c>
48+
/// permission. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html">Setting
49+
/// up permissions for configuring metadata tables</a> in the <i>Amazon S3 User Guide</i>.
50+
///
51+
/// </para>
52+
/// <note>
53+
/// <para>
54+
/// The IAM policy action name is the same for the V1 and V2 API operations.
55+
/// </para>
56+
/// </note> </dd> </dl>
57+
/// <para>
58+
/// The following operations are related to <c>DeleteBucketMetadataConfiguration</c>:
59+
/// </para>
60+
/// <ul> <li>
61+
/// <para>
62+
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a>
63+
///
64+
/// </para>
65+
/// </li> <li>
66+
/// <para>
67+
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataConfiguration.html">GetBucketMetadataConfiguration</a>
68+
///
69+
/// </para>
70+
/// </li> <li>
71+
/// <para>
72+
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataInventoryTableConfiguration.html">UpdateBucketMetadataInventoryTableConfiguration</a>
73+
///
74+
/// </para>
75+
/// </li> <li>
76+
/// <para>
77+
/// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataJournalTableConfiguration.html">UpdateBucketMetadataJournalTableConfiguration</a>
78+
///
79+
/// </para>
80+
/// </li> </ul> <important>
81+
/// <para>
82+
/// You must URL encode any signed header values that contain spaces. For example, if
83+
/// your header value is <c>my file.txt</c>, containing two spaces after <c>my</c>, you
84+
/// must URL encode this value to <c>my%20%20file.txt</c>.
85+
/// </para>
86+
/// </important>
87+
/// </summary>
88+
public partial class DeleteBucketMetadataConfigurationRequest : AmazonWebServiceRequest
89+
{
90+
private string _bucketName;
91+
private string _expectedBucketOwner;
92+
93+
/// <summary>
94+
/// Gets and sets the property BucketName.
95+
/// <para>
96+
/// The general purpose bucket that you want to remove the metadata configuration from.
97+
///
98+
/// </para>
99+
/// </summary>
100+
[AWSProperty(Required=true)]
101+
public string BucketName
102+
{
103+
get { return this._bucketName; }
104+
set { this._bucketName = value; }
105+
}
106+
107+
// Check to see if BucketName property is set
108+
internal bool IsSetBucketName()
109+
{
110+
return this._bucketName != null;
111+
}
112+
113+
/// <summary>
114+
/// Gets and sets the property ExpectedBucketOwner.
115+
/// <para>
116+
/// The expected bucket owner of the general purpose bucket that you want to remove the
117+
/// metadata table configuration from.
118+
/// </para>
119+
/// </summary>
120+
public string ExpectedBucketOwner
121+
{
122+
get { return this._expectedBucketOwner; }
123+
set { this._expectedBucketOwner = value; }
124+
}
125+
126+
// Check to see if ExpectedBucketOwner property is set
127+
internal bool IsSetExpectedBucketOwner()
128+
{
129+
return !String.IsNullOrEmpty(this._expectedBucketOwner);
130+
}
131+
132+
}
133+
}

sdk/src/Services/S3/Custom/Model/DeleteBucketMetadataConfigurationResponse.cs renamed to sdk/src/Services/S3/Generated/Model/DeleteBucketMetadataConfigurationResponse.cs

File renamed without changes.

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs renamed to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationRequestMarshaller.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
3636
/// <summary>
3737
/// DeleteBucketMetadataConfiguration Request Marshaller
3838
/// </summary>
39-
public class DeleteBucketMetadataConfigurationRequestMarshaller : IMarshaller<IRequest, DeleteBucketMetadataConfigurationRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
39+
public partial class DeleteBucketMetadataConfigurationRequestMarshaller : IMarshaller<IRequest, DeleteBucketMetadataConfigurationRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
4040
{
4141
/// <summary>
4242
/// Marshaller the request object to the HTTP request.
@@ -56,6 +56,7 @@ public IRequest Marshall(AmazonWebServiceRequest input)
5656
public IRequest Marshall(DeleteBucketMetadataConfigurationRequest publicRequest)
5757
{
5858
var request = new DefaultRequest(publicRequest, "Amazon.S3");
59+
PreMarshallCustomization(request, publicRequest);
5960
request.HttpMethod = "DELETE";
6061
request.AddSubResource("metadataConfiguration");
6162

@@ -65,10 +66,9 @@ public IRequest Marshall(DeleteBucketMetadataConfigurationRequest publicRequest)
6566
}
6667
if (!publicRequest.IsSetBucketName())
6768
throw new AmazonS3Exception("Request object does not have required field BucketName set");
68-
request.AddPathResource("{Bucket}", StringUtils.FromString(publicRequest.BucketName));
69-
request.ResourcePath = "/{Bucket}";
70-
69+
request.ResourcePath = "/";
7170

71+
PostMarshallCustomization(request, publicRequest);
7272
return request;
7373
}
7474
private static DeleteBucketMetadataConfigurationRequestMarshaller _instance = new DeleteBucketMetadataConfigurationRequestMarshaller();
@@ -89,5 +89,7 @@ public static DeleteBucketMetadataConfigurationRequestMarshaller Instance
8989
}
9090
}
9191

92+
partial void PostMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketMetadataConfigurationRequest publicRequest);
93+
partial void PreMarshallCustomization(DefaultRequest defaultRequest, DeleteBucketMetadataConfigurationRequest publicRequest);
9294
}
9395
}

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs renamed to sdk/src/Services/S3/Generated/Model/Internal/MarshallTransformations/DeleteBucketMetadataConfigurationResponseUnmarshaller.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace Amazon.S3.Model.Internal.MarshallTransformations
3636
/// <summary>
3737
/// Response Unmarshaller for DeleteBucketMetadataConfiguration operation
3838
/// </summary>
39-
public class DeleteBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller
39+
public partial class DeleteBucketMetadataConfigurationResponseUnmarshaller : S3ReponseUnmarshaller
4040
{
4141
/// <summary>
4242
/// Unmarshaller the response from the service to the response class.
@@ -47,6 +47,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte
4747
{
4848
DeleteBucketMetadataConfigurationResponse response = new DeleteBucketMetadataConfigurationResponse();
4949

50+
PostUnmarshallCustomization(context, response);
5051
return response;
5152
}
5253

@@ -60,7 +61,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte
6061
/// <returns></returns>
6162
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
6263
{
63-
var errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context);
64+
S3ErrorResponse errorResponse = S3ErrorResponseUnmarshaller.Instance.Unmarshall(context);
6465
errorResponse.InnerException = innerException;
6566
errorResponse.StatusCode = statusCode;
6667

@@ -70,11 +71,17 @@ public override AmazonServiceException UnmarshallException(XmlUnmarshallerContex
7071
using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null))
7172
{
7273
}
73-
return new AmazonS3Exception(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
74+
return base.ConstructS3Exception(context, errorResponse, innerException, statusCode);
7475
}
7576

77+
partial void PostUnmarshallCustomization(XmlUnmarshallerContext context, DeleteBucketMetadataConfigurationResponse response);
78+
7679
private static DeleteBucketMetadataConfigurationResponseUnmarshaller _instance = new DeleteBucketMetadataConfigurationResponseUnmarshaller();
7780

81+
internal static DeleteBucketMetadataConfigurationResponseUnmarshaller GetInstance()
82+
{
83+
return _instance;
84+
}
7885

7986
/// <summary>
8087
/// Gets the singleton.

0 commit comments

Comments
 (0)