Skip to content

Commit 71cc1d8

Browse files
committed
Generate CompleteMultipartUpload
stack-info: PR: #4209, branch: peterrsongg/petesong/phase-3-pr5-rebased-2/6
1 parent 49dfa8b commit 71cc1d8

22 files changed

+2674
-2079
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": {
@@ -1348,6 +1354,26 @@
13481354
"Type":{"emitPropertyName":"JsonType"}
13491355
}
13501356
]
1357+
},
1358+
"CompleteMultipartUploadOutput":{
1359+
"modify":[
1360+
{
1361+
"ServerSideEncryption":{"emitPropertyName":"ServerSideEncryptionMethod"}
1362+
},
1363+
{
1364+
"SSEKMSKeyId":{"emitPropertyName":"ServerSideEncryptionKeyManagementServiceKeyId"}
1365+
},
1366+
{
1367+
"Expiration":{"injectXmlUnmarshallCode":["ExpirationCustomUnmarshall(context, response);"]}
1368+
}
1369+
]
1370+
},
1371+
"CompletedMultipartUpload":{
1372+
"modify":[
1373+
{
1374+
"Parts": {"emitPropertyName":"PartETags"}
1375+
}
1376+
]
13511377
}
13521378

13531379
},
@@ -1503,6 +1529,9 @@
15031529
},
15041530
"JSONType":{
15051531
"renameShape":"JsonType"
1532+
},
1533+
"CompletedPart":{
1534+
"renameShape":"PartETag"
15061535
}
15071536
},
15081537
"overrideTreatEnumsAsString":{
@@ -1690,6 +1719,13 @@
16901719
"Marshaller":"UserMetadata.Marshall",
16911720
"Unmarshaller":"StringUnmarshaller"
16921721
}
1722+
},
1723+
"CompleteMultipartUploadOutput":{
1724+
"Expiration":{
1725+
"Type":"Expiration",
1726+
"Marshaller":"blah",
1727+
"Unmarshaller":"StringUnmarshaller"
1728+
}
16931729
}
16941730
},
16951731
"excludeMembers":{
@@ -1753,6 +1789,9 @@
17531789
},
17541790
"PartDetail":{
17551791
"alternateBaseClass": "PartETag"
1792+
},
1793+
"PartETag":{
1794+
"alternateBaseClass": "IComparable<PartETag>"
17561795
}
17571796
},
17581797
"flattenShapes" : {
@@ -1764,6 +1803,9 @@
17641803
],
17651804
"RestoreObjectRequest":[
17661805
"RestoreRequest"
1806+
],
1807+
"CompleteMultipartUploadRequest":[
1808+
"MultipartUpload"
17671809
]
17681810
},
17691811
"excludeShapes":[

0 commit comments

Comments
 (0)