Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ using Amazon.Runtime.Internal.Util;
request.Headers["<#=member.MarshallLocationName#>"] = <#=member.CustomMarshallerTransformation#>(<#=variableName#>.<#=member.PropertyName#>);
<#+
}
else if (this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var headerPropertyModifier) && headerPropertyModifier.InjectXmlMarshallCode.Count > 0)
{
WriteInjectXmlMarshallCode(3, headerPropertyModifier.InjectXmlMarshallCode);
}
else if (member.IsJsonValue)
{
#>
Expand Down Expand Up @@ -545,3 +549,14 @@ using Amazon.Runtime.Internal.Util;
}
}
#>
<#+
protected void WriteInjectXmlMarshallCode(int level, HashSet<string> injectXmlMarshallCode)
{
foreach (var injectCode in injectXmlMarshallCode)
{
#>
<#=new string(' ', level * 4)#> <#=injectCode#>
<#+
}
}
#>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ using Amazon.Runtime.Internal.Util;
{
if (this.Config.ServiceModel.Customizations.ShapeModifiers.TryGetValue(member.OwningShape.Name, out var modifier) && modifier.ExcludedUnmarshallingProperties.Contains(member.ModeledName))
continue;
else if (this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var headerPropertyModifier) && headerPropertyModifier.InjectXmlUnmarshallCode.Count > 0)
{
WriteInjectXmlCode(headerPropertyModifier.InjectXmlUnmarshallCode, 3);
continue;
}
if (member.Shape.IsMap)
{
#>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5354,54 +5354,6 @@ protected void WriteXmlAttributeString(int level, Member member, string variable
}


#line default
#line hidden

#line 947 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"

protected void WriteInjectXmlMarshallCode(int level, HashSet<string> injectXmlMarshallCode)
{
foreach (var injectCode in injectXmlMarshallCode)
{


#line default
#line hidden

#line 953 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(new string(' ', level * 4)));


#line default
#line hidden

#line 953 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
this.Write("\t\t\t\t");


#line default
#line hidden

#line 953 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(injectCode));


#line default
#line hidden

#line 953 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"
this.Write("\r\n");


#line default
#line hidden

#line 954 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlRequestMarshaller.tt"

}
}


#line default
#line hidden
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -944,14 +944,4 @@ WriteXmlAttributeString(level + 1, member, variableName, isPayload: true, operat
}
}
#>
<#+
protected void WriteInjectXmlMarshallCode(int level, HashSet<string> injectXmlMarshallCode)
{
foreach (var injectCode in injectXmlMarshallCode)
{
#>
<#=new string(' ', level * 4)#> <#=injectCode#>
<#+
}
}
#>

3 changes: 2 additions & 1 deletion generator/ServiceClientGeneratorLib/ServiceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ public List<Operation> S3AllowListOperations
new Operation(this, "DeleteBucketMetadataConfiguration", DocumentRoot[OperationsKey]["DeleteBucketMetadataConfiguration"]),
new Operation(this, "ListObjects", DocumentRoot[OperationsKey]["ListObjects"]),
new Operation(this,"UpdateBucketMetadataJournalTableConfiguration", DocumentRoot[OperationsKey]["UpdateBucketMetadataJournalTableConfiguration"]),
new Operation(this, "ListMultipartUploads", DocumentRoot[OperationsKey]["ListMultipartUploads"])
new Operation(this, "ListMultipartUploads", DocumentRoot[OperationsKey]["ListMultipartUploads"]),
new Operation(this, "CompleteMultipartUpload", DocumentRoot[OperationsKey]["CompleteMultipartUpload"])
};
}
return _s3AllowListOperations.Where(operation => operation.data != null).ToList();
Expand Down
58 changes: 50 additions & 8 deletions generator/ServiceModels/s3/s3.customizations.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,22 @@
]
},
"CompleteMultipartUploadRequest": {
"exclude": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the PR description explaining this? I don't follow why we were excluding something before but not it's in flattenShapes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in the PR description

"MultipartUpload"
],
"inject": [
"modify":[
{
"PartETags": {
"shape": "CompletedPartList",
"originalMember": "MultipartUpload"
}
"IfMatch": {"injectXmlIsSet":["return !string.IsNullOrEmpty(this._ifMatch);"]}
},
{
"ExpectedBucketOwner": {"injectXmlIsSet":["return !string.IsNullOrEmpty(this._expectedBucketOwner);"]}
},
{
"IfNoneMatch": {"injectXmlIsSet":["return !string.IsNullOrEmpty(this._ifNoneMatch);"]}
},
{
"Parts":{"emitPropertyName":"PartETags"}
}
],
"injectXmlMarshallCodeInPayload":[
"SortPartsList(publicRequest);"
]
},
"CopyObjectRequest": {
Expand Down Expand Up @@ -1348,6 +1354,26 @@
"Type":{"emitPropertyName":"JsonType"}
}
]
},
"CompleteMultipartUploadOutput":{
"modify":[
{
"ServerSideEncryption":{"emitPropertyName":"ServerSideEncryptionMethod"}
},
{
"SSEKMSKeyId":{"emitPropertyName":"ServerSideEncryptionKeyManagementServiceKeyId"}
},
{
"Expiration":{"injectXmlUnmarshallCode":["ExpirationCustomUnmarshall(context, response);"]}
}
]
},
"CompletedMultipartUpload":{
"modify":[
{
"Parts": {"emitPropertyName":"PartETags"}
}
]
}

},
Expand Down Expand Up @@ -1503,6 +1529,9 @@
},
"JSONType":{
"renameShape":"JsonType"
},
"CompletedPart":{
"renameShape":"PartETag"
}
},
"overrideTreatEnumsAsString":{
Expand Down Expand Up @@ -1690,6 +1719,13 @@
"Marshaller":"UserMetadata.Marshall",
"Unmarshaller":"StringUnmarshaller"
}
},
"CompleteMultipartUploadOutput":{
"Expiration":{
"Type":"Expiration",
"Marshaller":"blah",
"Unmarshaller":"StringUnmarshaller"
}
}
},
"excludeMembers":{
Expand Down Expand Up @@ -1753,6 +1789,9 @@
},
"PartDetail":{
"alternateBaseClass": "PartETag"
},
"PartETag":{
"alternateBaseClass": "IComparable<PartETag>"
}
},
"flattenShapes" : {
Expand All @@ -1764,6 +1803,9 @@
],
"RestoreObjectRequest":[
"RestoreRequest"
],
"CompleteMultipartUploadRequest":[
"MultipartUpload"
]
},
"excludeShapes":[
Expand Down
Loading