Skip to content

Commit ea64644

Browse files
committed
Generate CompleteMultipartUpload
stack-info: PR: #4209, branch: peterrsongg/petesong/phase-3-pr5-rebased-2/6
1 parent 73c0160 commit ea64644

23 files changed

+2675
-2095
lines changed

generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseMarshaller.cs

Lines changed: 476 additions & 425 deletions
Large diffs are not rendered by default.

generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseMarshaller.tt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ using Amazon.Runtime.Internal.Util;
4747
request.Headers["<#=member.MarshallLocationName#>"] = <#=member.CustomMarshallerTransformation#>(<#=variableName#>.<#=member.PropertyName#>);
4848
<#+
4949
}
50+
else if (this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var headerPropertyModifier) && headerPropertyModifier.InjectXmlMarshallCode.Count > 0)
51+
{
52+
WriteInjectXmlMarshallCode(3, headerPropertyModifier.InjectXmlMarshallCode);
53+
}
5054
else if (member.IsJsonValue)
5155
{
5256
#>
@@ -545,3 +549,14 @@ using Amazon.Runtime.Internal.Util;
545549
}
546550
}
547551
#>
552+
<#+
553+
protected void WriteInjectXmlMarshallCode(int level, HashSet<string> injectXmlMarshallCode)
554+
{
555+
foreach (var injectCode in injectXmlMarshallCode)
556+
{
557+
#>
558+
<#=new string(' ', level * 4)#> <#=injectCode#>
559+
<#+
560+
}
561+
}
562+
#>

generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.cs

Lines changed: 322 additions & 317 deletions
Large diffs are not rendered by default.

generator/ServiceClientGeneratorLib/Generators/Marshallers/BaseResponseUnmarshaller.tt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ using Amazon.Runtime.Internal.Util;
150150
{
151151
if (this.Config.ServiceModel.Customizations.ShapeModifiers.TryGetValue(member.OwningShape.Name, out var modifier) && modifier.ExcludedUnmarshallingProperties.Contains(member.ModeledName))
152152
continue;
153+
else if (this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var headerPropertyModifier) && headerPropertyModifier.InjectXmlUnmarshallCode.Count > 0)
154+
{
155+
WriteInjectXmlCode(headerPropertyModifier.InjectXmlUnmarshallCode, 3);
156+
continue;
157+
}
153158
if (member.Shape.IsMap)
154159
{
155160
#>

generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlRequestMarshaller.cs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5354,54 +5354,6 @@ protected void WriteXmlAttributeString(int level, Member member, string variable
53545354
}
53555355

53565356

5357-
#line default
5358-
#line hidden
5359-
5360-
#line 947 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
5361-
5362-
protected void WriteInjectXmlMarshallCode(int level, HashSet<string> injectXmlMarshallCode)
5363-
{
5364-
foreach (var injectCode in injectXmlMarshallCode)
5365-
{
5366-
5367-
5368-
#line default
5369-
#line hidden
5370-
5371-
#line 953 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
5372-
this.Write(this.ToStringHelper.ToStringWithCulture(new string(' ', level * 4)));
5373-
5374-
5375-
#line default
5376-
#line hidden
5377-
5378-
#line 953 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
5379-
this.Write("\t\t\t\t");
5380-
5381-
5382-
#line default
5383-
#line hidden
5384-
5385-
#line 953 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
5386-
this.Write(this.ToStringHelper.ToStringWithCulture(injectCode));
5387-
5388-
5389-
#line default
5390-
#line hidden
5391-
5392-
#line 953 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
5393-
this.Write("\r\n");
5394-
5395-
5396-
#line default
5397-
#line hidden
5398-
5399-
#line 954 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
5400-
5401-
}
5402-
}
5403-
5404-
54055357
#line default
54065358
#line hidden
54075359
}

generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlRequestMarshaller.tt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -944,14 +944,4 @@ WriteXmlAttributeString(level + 1, member, variableName, isPayload: true, operat
944944
}
945945
}
946946
#>
947-
<#+
948-
protected void WriteInjectXmlMarshallCode(int level, HashSet<string> injectXmlMarshallCode)
949-
{
950-
foreach (var injectCode in injectXmlMarshallCode)
951-
{
952-
#>
953-
<#=new string(' ', level * 4)#> <#=injectCode#>
954-
<#+
955-
}
956-
}
957-
#>
947+

generator/ServiceClientGeneratorLib/ServiceModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ public List<Operation> S3AllowListOperations
578578
new Operation(this, "DeleteBucketMetadataConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetadataConfiguration"]),
579579
new Operation(this, "ListObjects", DocumentRoot[OperationsKey]["ListObjects"]),
580580
new Operation(this,"UpdateBucketMetadataJournalTableConfiguration", DocumentRoot[OperationsKey]["UpdateBucketMetadataJournalTableConfiguration"]),
581-
new Operation(this, "ListMultipartUploads", DocumentRoot[OperationsKey]["ListMultipartUploads"])
581+
new Operation(this, "ListMultipartUploads", DocumentRoot[OperationsKey]["ListMultipartUploads"]),
582+
new Operation(this, "CompleteMultipartUpload", DocumentRoot[OperationsKey]["CompleteMultipartUpload"])
582583
};
583584
}
584585
return _s3AllowListOperations.Where(operation => operation.data != null).ToList();

generator/ServiceModels/s3/s3.customizations.json

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,22 @@
4343
]
4444
},
4545
"CompleteMultipartUploadRequest": {
46-
"exclude": [
47-
"MultipartUpload"
48-
],
49-
"inject": [
46+
"modify":[
5047
{
51-
"PartETags": {
52-
"shape": "CompletedPartList",
53-
"originalMember": "MultipartUpload"
54-
}
48+
"IfMatch": {"injectXmlIsSet":["return !string.IsNullOrEmpty(this._ifMatch);"]}
49+
},
50+
{
51+
"ExpectedBucketOwner": {"injectXmlIsSet":["return !string.IsNullOrEmpty(this._expectedBucketOwner);"]}
52+
},
53+
{
54+
"IfNoneMatch": {"injectXmlIsSet":["return !string.IsNullOrEmpty(this._ifNoneMatch);"]}
55+
},
56+
{
57+
"Parts":{"emitPropertyName":"PartETags"}
5558
}
59+
],
60+
"injectXmlMarshallCodeInPayload":[
61+
"SortPartsList(publicRequest);"
5662
]
5763
},
5864
"CopyObjectRequest": {
@@ -1345,6 +1351,26 @@
13451351
"Type":{"emitPropertyName":"JsonType"}
13461352
}
13471353
]
1354+
},
1355+
"CompleteMultipartUploadOutput":{
1356+
"modify":[
1357+
{
1358+
"ServerSideEncryption":{"emitPropertyName":"ServerSideEncryptionMethod"}
1359+
},
1360+
{
1361+
"SSEKMSKeyId":{"emitPropertyName":"ServerSideEncryptionKeyManagementServiceKeyId"}
1362+
},
1363+
{
1364+
"Expiration":{"injectXmlUnmarshallCode":["ExpirationCustomUnmarshall(context, response);"]}
1365+
}
1366+
]
1367+
},
1368+
"CompletedMultipartUpload":{
1369+
"modify":[
1370+
{
1371+
"Parts": {"emitPropertyName":"PartETags"}
1372+
}
1373+
]
13481374
}
13491375

13501376
},
@@ -1500,6 +1526,9 @@
15001526
},
15011527
"JSONType":{
15021528
"renameShape":"JsonType"
1529+
},
1530+
"CompletedPart":{
1531+
"renameShape":"PartETag"
15031532
}
15041533
},
15051534
"overrideTreatEnumsAsString":{
@@ -1687,6 +1716,13 @@
16871716
"Marshaller":"UserMetadata.Marshall",
16881717
"Unmarshaller":"StringUnmarshaller"
16891718
}
1719+
},
1720+
"CompleteMultipartUploadOutput":{
1721+
"Expiration":{
1722+
"Type":"Expiration",
1723+
"Marshaller":"blah",
1724+
"Unmarshaller":"StringUnmarshaller"
1725+
}
16901726
}
16911727
},
16921728
"excludeMembers":{
@@ -1750,6 +1786,9 @@
17501786
},
17511787
"PartDetail":{
17521788
"alternateBaseClass": "PartETag"
1789+
},
1790+
"PartETag":{
1791+
"alternateBaseClass": "IComparable<PartETag>"
17531792
}
17541793
},
17551794
"flattenShapes" : {
@@ -1761,6 +1800,9 @@
17611800
],
17621801
"RestoreObjectRequest":[
17631802
"RestoreRequest"
1803+
],
1804+
"CompleteMultipartUploadRequest":[
1805+
"MultipartUpload"
17641806
]
17651807
},
17661808
"excludeShapes":[

0 commit comments

Comments
 (0)