Skip to content

Commit 44e692b

Browse files
authored
Revert "S3 Gen Phase 2: Generate PutBucket (#3909)" (#3925)
This reverts commit 6501007.
1 parent 6501007 commit 44e692b

38 files changed

+1201
-2051
lines changed

generator/.DevConfigs/02d8bc0f-1757-4948-9c6c-ac1833b2b0dc.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

generator/ServiceClientGeneratorLib/Customizations.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ public class CustomizationsModel
427427
public const string OverrideTreatEnumsAsStringKey = "overrideTreatEnumsAsString";
428428
public const string ExcludeMembersKey = "excludeMembers";
429429
public const string UnwrapXmlOutputKey = "unwrapXmlOutput";
430-
public const string InheritAlternateBaseClassKey = "inheritAlternateBaseClass";
431430

432431
JsonData _documentRoot;
433432

@@ -705,27 +704,6 @@ public HashSet<string> ResultGenerationSuppressions
705704
}
706705
}
707706

708-
/// <summary>
709-
/// Overrides the base class that structures inherit from.
710-
/// Here is an example of the usage
711-
/// "inheritAlternateBaseClass":{
712-
/// "CreateBucketRequest": {
713-
/// "alternateBaseClass" : "PutWithAclRequest"
714-
/// }
715-
/// }
716-
/// </summary>
717-
/// <param name="shapeName"></param>
718-
/// <returns></returns>
719-
public string InheritAlternateBaseClass(string shapeName)
720-
{
721-
var data = _documentRoot[InheritAlternateBaseClassKey];
722-
if (data == null || data[shapeName] == null) return null;
723-
724-
if (data[shapeName]["alternateBaseClass"] == null)
725-
throw new InvalidDataException("You must specify \"alternateBaseClass\" as the key for this customization");
726-
return data[shapeName]["alternateBaseClass"].ToString();
727-
}
728-
729707
public bool GenerateCustomUnmarshaller
730708
{
731709
get

generator/ServiceClientGeneratorLib/GeneratorDriver.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,10 @@ public void Execute()
286286
/// <param name="operation">The operation object which contains info about what the request needs to contain for the operation</param>
287287
void GenerateRequest(Operation operation)
288288
{
289-
var baseClassString = this.Configuration.ServiceModel.Customizations.InheritAlternateBaseClass(operation.Name + "Request");
290289
var requestGenerator = new StructureGenerator
291290
{
292291
ClassName = operation.Name + "Request",
293-
BaseClass = baseClassString ?? (this.Configuration.ServiceId != "S3" ? string.Format("Amazon{0}Request", Configuration.ClassName) : "AmazonWebServiceRequest"),
292+
BaseClass = this.Configuration.ServiceId != "S3" ? string.Format("Amazon{0}Request", Configuration.ClassName) : "AmazonWebServiceRequest",
294293
StructureType = StructureType.Request,
295294
Operation = operation
296295
};
@@ -460,11 +459,10 @@ var propertyModifier
460459
}
461460
else
462461
{
463-
var baseClassString = this.Configuration.ServiceModel.Customizations.InheritAlternateBaseClass(operation.Name + "Response");
464462
var resultGenerator = new StructureGenerator
465463
{
466464
ClassName = operation.Name + "Response",
467-
BaseClass = baseClassString ?? "AmazonWebServiceResponse",
465+
BaseClass = "AmazonWebServiceResponse",
468466
IsWrapped = operation.IsResponseWrapped,
469467
Operation = operation,
470468
StructureType = StructureType.Response

generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlRequestMarshaller.cs

Lines changed: 538 additions & 1008 deletions
Large diffs are not rendered by default.

generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlRequestMarshaller.tt

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,16 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations
8989
// Process any members which are marshalled as part of the request body
9090
if(this.Operation.RequestHasBodyMembers || shouldMarshallPayload)
9191
{
92-
ProcessRequestBodyMembers("publicRequest", this.Operation);
92+
ProcessRequestBodyMembers("publicRequest", this.Operation);
9393
}
9494
else if(payload != null && !payload.Shape.IsStructure)
9595
{
9696
ProcessNonStructurePayload(payload, 3);
97-
#>
98-
PostMarshallCustomization(request, publicRequest);
99-
<#
10097
GenerateRequestChecksumHandling(this.Operation, "content");
10198
}
102-
else
103-
{
10499
#>
105100

106-
PostMarshallCustomization(request, publicRequest);
107101
<#
108-
}
109102
if (this.Operation.UnsignedPayload)
110103
{
111104
#>
@@ -125,6 +118,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations
125118
ProcessEndpointHostPrefixMembers(3, "publicRequest", this.Operation);
126119
}
127120
#>
121+
PostMarshallCustomization(request, publicRequest);
128122
return request;
129123
}
130124
<#
@@ -187,41 +181,17 @@ WriteXmlAttributeString(level, member, variableName, isPayload: false);
187181
#>
188182
if (<#=variableName + ".IsSet" + operation.RequestPayloadMember.PropertyName#>())
189183
{
190-
<#+
191-
// S3 doesn't follow the rule where if the request payload member's location name is the same as the payload member name, we marshall with the payload member's shape's marshall name instead
192-
if (this.Config.ServiceId != "S3")
193-
{
194-
#>
195184
xmlWriter.WriteStartElement("<#=operation.RequestPayloadMember.LocationName != operation.RequestStructure.PayloadMemberName ? operation.RequestPayloadMember.LocationName : operation.RequestPayloadMember.Shape.MarshallName#>", "<#=operation.XmlNamespace#>");
196185
<#+
197-
}
198-
else
199-
{
200-
#>
201-
xmlWriter.WriteStartElement("<#=operation.RequestPayloadMember.LocationName#>", "<#=operation.XmlNamespace#>");
202-
<#+
203-
}
204186
}
205187
else
206188
{
207189
#>
208190
if (<#=variableName + ".IsSet" + operation.RequestPayloadMember.PropertyName#>())
209191
{
210-
<#+
211-
if (this.Config.ServiceId != "S3")
212-
{
213-
#>
214192
xmlWriter.WriteStartElement("<#=operation.RequestPayloadMember.LocationName != operation.RequestStructure.PayloadMemberName ? operation.RequestPayloadMember.LocationName : operation.RequestPayloadMember.Shape.MarshallName#>");
215193
xmlWriter.WriteAttributeString("xmlns","<#=operation.XmlNamespacePrefix#>",null,"<#=operation.XmlNamespace#>");
216194
<#+
217-
}
218-
else
219-
{
220-
#>
221-
xmlWriter.WriteStartElement("<#=operation.RequestPayloadMember.LocationName#>");
222-
xmlWriter.WriteAttributeString("xmlns","<#=operation.XmlNamespacePrefix#>",null,"<#=operation.XmlNamespace#>");
223-
<#+
224-
}
225195
}
226196
#>
227197
<#+
@@ -312,7 +282,6 @@ WriteXmlAttributeString(level + 1, member, variableName, isPayload: true, operat
312282
}
313283
#>
314284
}
315-
PostMarshallCustomization(request, publicRequest);
316285
try
317286
{
318287
string content = stringWriter.ToString();

generator/ServiceClientGeneratorLib/ServiceModel.cs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -521,30 +521,7 @@ public List<Operation> S3AllowListOperations
521521
new Operation(this, "PutObjectTagging", DocumentRoot[OperationsKey]["PutObjectTagging"]),
522522
new Operation(this, "PutPublicAccessBlock", DocumentRoot[OperationsKey]["PutPublicAccessBlock"]),
523523
//new Operation(this, "RestoreObject", DocumentRoot[OperationsKey]["RestoreObject"]),
524-
//new Operation(this, "SelectObjectContent", DocumentRoot[OperationsKey]["SelectObjectContent"]),
525-
526-
// PHASE 2
527-
new Operation(this, "CreateBucket", DocumentRoot[OperationsKey]["CreateBucket"]),
528-
//new Operation(this, "CreateBucketMetadataTableConfiguration", DocumentRoot[OperationsKey]["CreateBucketMetadataTableConfiguration"]),
529-
//new Operation(this, "CreateMultipartUpload", DocumentRoot[OperationsKey]["CreateMultipartUpload"]),
530-
//new Operation(this, "DeleteBucketCors", DocumentRoot[OperationsKey]["DeleteBucketCors"]),
531-
//new Operation(this, "DeleteBucketLifecycle", DocumentRoot[OperationsKey]["DeleteBucketLifecycle"]),
532-
//new Operation(this, "GetBucketAcl", DocumentRoot[OperationsKey]["GetBucketAcl"]),
533-
//new Operation(this, "GetBucketCors", DocumentRoot[OperationsKey]["GetBucketCors"]),
534-
//new Operation(this, "GetBucketLifecycle", DocumentRoot[OperationsKey]["GetBucketLifecycle"]),
535-
//new Operation(this, "GetBucketLifecycleConfiguration", DocumentRoot[OperationsKey]["GetBucketLifecycleConfiguration"]),
536-
//new Operation(this, "GetBucketNotificationConfiguration", DocumentRoot[OperationsKey]["GetBucketNotificationConfiguration"]),
537-
//new Operation(this, "GetObjectAcl", DocumentRoot[OperationsKey]["GetObjectAcl"]),
538-
//new Operation(this, "HeadObject", DocumentRoot[OperationsKey]["HeadObject"]),
539-
//new Operation(this, "ListObjectVersions", DocumentRoot[OperationsKey]["ListObjectVersions"]),
540-
//new Operation(this, "PutBucketAcl", DocumentRoot[OperationsKey]["PutBucketAcl"]),
541-
//new Operation(this, "PutBucketCors", DocumentRoot[OperationsKey]["PutBucketCors"]),
542-
//new Operation(this, "PutBucketLifecycle", DocumentRoot[OperationsKey]["PutBucketLifecycle"]),
543-
//new Operation(this, "PutBucketLifecycleConfiguration", DocumentRoot[OperationsKey]["PutBucketLifecycleConfiguration"]),
544-
//new Operation(this, "PutBucketNotificationConfiguration", DocumentRoot[OperationsKey]["PutBucketNotificationConfiguration"]),
545-
//new Operation(this, "PutObjectAcl", DocumentRoot[OperationsKey]["PutObjectAcl"]),
546-
//new Operation(this, "UploadPartCopy", DocumentRoot[OperationsKey]["UploadPartCopy"]),
547-
524+
//new Operation(this, "SelectObjectContent", DocumentRoot[OperationsKey]["SelectObjectContent"])
548525
};
549526
}
550527
return _s3AllowListOperations;

generator/ServiceModels/s3/s3.customizations.json

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -210,30 +210,6 @@
210210
}
211211
]
212212
},
213-
"CreateBucketRequest":{
214-
"exclude":[
215-
"GrantFullControl",
216-
"GrantRead",
217-
"GrantReadACP",
218-
"GrantWrite",
219-
"GrantWriteACP"
220-
],
221-
"modify":[
222-
{
223-
"ACL": {"emitPropertyName": "CannedACL"}
224-
},
225-
{
226-
"CreateBucketConfiguration" : {"emitPropertyName" : "PutBucketConfiguration"}
227-
}
228-
]
229-
},
230-
"PutBucketConfiguration":{
231-
"modify":[
232-
{
233-
"BucketName" : {"emitPropertyName" : "BucketInfo"}
234-
}
235-
]
236-
},
237213
"QueueConfigurationDeprecated": {
238214
"modify": [
239215
{
@@ -425,13 +401,8 @@
425401
},
426402
"Part":{
427403
"renameShape": "PartDetail"
428-
},
429-
"CreateBucketConfiguration":{
430-
"renameShape":"PutBucketConfiguration"
431-
},
432-
"BucketCannedACL":{
433-
"renameShape":"S3CannedACL"
434404
}
405+
435406
},
436407
"overrideTreatEnumsAsString":{
437408
"ObjectAttributesList": false
@@ -450,13 +421,6 @@
450421
"Marshaller" : "StringUtils.FromString",
451422
"Unmarshaller" : "StringUnmarshaller"
452423
}
453-
},
454-
"PutBucketConfiguration":{
455-
"LocationConstraint":{
456-
"Type": "BucketLocationConstraint",
457-
"Marshaller": "StringUtils.FromString",
458-
"Unmarshaller": "StringUnmarshaller"
459-
}
460424
}
461425
},
462426
"excludeMembers":{
@@ -472,10 +436,5 @@
472436
},
473437
"unwrapXmlOutput":{
474438
"GetBucketLocationOutput": true
475-
},
476-
"inheritAlternateBaseClass":{
477-
"PutBucketRequest": {
478-
"alternateBaseClass" : "PutWithACLRequest"
479-
}
480439
}
481440
}

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

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
@@ -13,9 +13,6 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
/*
17-
* Do not modify this file. This file is generated from the s3-2006-03-01.normal.json service model.
18-
*/
1916
using System;
2017
using System.Collections.Generic;
2118
using System.Xml.Serialization;
@@ -26,16 +23,15 @@
2623
using Amazon.Runtime;
2724
using Amazon.Runtime.Internal;
2825

29-
#pragma warning disable CS0612,CS0618,CS1570
3026
namespace Amazon.S3.Model
3127
{
3228
/// <summary>
3329
/// The requested bucket name is not available. The bucket namespace is shared by all
3430
/// users of the system. Select a different name and try again.
3531
/// </summary>
36-
#if !NETSTANDARD
32+
#if !NETSTANDARD
3733
[Serializable]
38-
#endif
34+
#endif
3935
public partial class BucketAlreadyExistsException : AmazonS3Exception
4036
{
4137

@@ -46,23 +42,23 @@ public partial class BucketAlreadyExistsException : AmazonS3Exception
4642
/// <param name="message">
4743
/// Describes the error encountered.
4844
/// </param>
49-
public BucketAlreadyExistsException(string message)
50-
: base(message) {}
45+
public BucketAlreadyExistsException(string message)
46+
: base(message) { }
5147

5248
/// <summary>
5349
/// Construct instance of BucketAlreadyExistsException
5450
/// </summary>
5551
/// <param name="message"></param>
5652
/// <param name="innerException"></param>
57-
public BucketAlreadyExistsException(string message, Exception innerException)
58-
: base(message, innerException) {}
53+
public BucketAlreadyExistsException(string message, Exception innerException)
54+
: base(message, innerException) { }
5955

6056
/// <summary>
6157
/// Construct instance of BucketAlreadyExistsException
6258
/// </summary>
6359
/// <param name="innerException"></param>
64-
public BucketAlreadyExistsException(Exception innerException)
65-
: base(innerException) {}
60+
public BucketAlreadyExistsException(Exception innerException)
61+
: base(innerException) { }
6662

6763
/// <summary>
6864
/// Construct instance of BucketAlreadyExistsException
@@ -73,8 +69,8 @@ public BucketAlreadyExistsException(Exception innerException)
7369
/// <param name="errorCode"></param>
7470
/// <param name="requestId"></param>
7571
/// <param name="statusCode"></param>
76-
public BucketAlreadyExistsException(string message, Exception innerException, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
77-
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
72+
public BucketAlreadyExistsException(string message, Exception innerException, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
73+
: base(message, innerException, errorType, errorCode, requestId, statusCode) { }
7874

7975
/// <summary>
8076
/// Construct instance of BucketAlreadyExistsException
@@ -84,9 +80,22 @@ public BucketAlreadyExistsException(string message, Exception innerException, Am
8480
/// <param name="errorCode"></param>
8581
/// <param name="requestId"></param>
8682
/// <param name="statusCode"></param>
87-
public BucketAlreadyExistsException(string message, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
88-
: base(message, errorType, errorCode, requestId, statusCode) {}
83+
public BucketAlreadyExistsException(string message, Amazon.Runtime.ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
84+
: base(message, errorType, errorCode, requestId, statusCode) { }
8985

86+
/// <summary>
87+
/// Construct instance of BucketAlreadyExistsException
88+
/// </summary>
89+
/// <param name="message"></param>
90+
/// <param name="innerException"></param>
91+
/// <param name="errorType"></param>
92+
/// <param name="errorCode"></param>
93+
/// <param name="requestId"></param>
94+
/// <param name="statusCode"></param>
95+
/// <param name="amazonId2"></param>
96+
/// <param name="amazonCfId"></param>
97+
public BucketAlreadyExistsException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode, string amazonId2, string amazonCfId)
98+
: base(message, innerException, errorType, errorCode, requestId, statusCode, amazonId2, amazonCfId) { }
9099

91100
#if !NETSTANDARD
92101
/// <summary>
@@ -117,18 +126,5 @@ public override void GetObjectData(System.Runtime.Serialization.SerializationInf
117126
}
118127
#endif
119128

120-
/// <summary>
121-
/// Construct instance of BucketAlreadyExistsException
122-
/// </summary>
123-
/// <param name="message"></param>
124-
/// <param name="innerException"></param>
125-
/// <param name="errorType"></param>
126-
/// <param name="errorCode"></param>
127-
/// <param name="requestId"></param>
128-
/// <param name="statusCode"></param>
129-
/// <param name="amazonId2"></param>
130-
/// <param name="amazonCfId"></param>
131-
public BucketAlreadyExistsException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode, string amazonId2, string amazonCfId)
132-
: base(message, innerException, errorType, errorCode, requestId, statusCode, amazonId2, amazonCfId) { }
133129
}
134130
}

0 commit comments

Comments
 (0)