Skip to content
Merged
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 @@ -55,6 +55,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 @@ -556,3 +560,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,16 +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;
if (this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var propertyModifier) && propertyModifier.InjectXmlUnmarshallCode.Count > 0)
{
foreach (var code in propertyModifier.InjectXmlUnmarshallCode)
{
#>
<#=code#>
<#+
}
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -937,14 +937,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#>
<#+
}
}
#>

Original file line number Diff line number Diff line change
Expand Up @@ -1004,15 +1004,15 @@ public override void GetObjectData(System.Runtime.Serialization.SerializationInf
#line 339 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"

}
else if (this.Structure != null && this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var injectModifier) && injectModifier.InjectXmlPropertyGetter.Count > 0)
else if (this.Structure != null && this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var injectXmlPropertyGetterModifier) && injectXmlPropertyGetterModifier.InjectXmlPropertyGetter.Count > 0)
{


#line default
#line hidden

#line 344 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
WriteInjectXmlCode(injectModifier.InjectXmlPropertyGetter, 3);
WriteInjectXmlCode(injectXmlPropertyGetterModifier.InjectXmlPropertyGetter, 3);

#line default
#line hidden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ namespace <#=this.Config.Namespace#>.Model
}
<#
}
else if (this.Structure != null && this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var injectModifier) && injectModifier.InjectXmlPropertyGetter.Count > 0)
else if (this.Structure != null && this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var injectXmlPropertyGetterModifier) && injectXmlPropertyGetterModifier.InjectXmlPropertyGetter.Count > 0)
{
#>
<#WriteInjectXmlCode(injectModifier.InjectXmlPropertyGetter, 3);#>
<#WriteInjectXmlCode(injectXmlPropertyGetterModifier.InjectXmlPropertyGetter, 3);#>
<#
}
else
Expand Down
1 change: 1 addition & 0 deletions generator/ServiceClientGeneratorLib/ServiceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ public List<Operation> S3AllowListOperations
new Operation(this, "PutBucketOwnershipControls", DocumentRoot[OperationsKey]["PutBucketOwnershipControls"]),
new Operation(this, "PutBucketTagging", DocumentRoot[OperationsKey]["PutBucketTagging"]),
new Operation(this, "CopyObject", DocumentRoot[OperationsKey]["CopyObject"]),
new Operation(this, "CompleteMultipartUpload", DocumentRoot[OperationsKey]["CompleteMultipartUpload"])
};
}
return _s3AllowListOperations.Where(operation => operation.data != null).ToList();
Expand Down
61 changes: 52 additions & 9 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": [
"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 @@ -1686,6 +1692,26 @@
"Type":{"emitPropertyName":"JsonType"}
}
]
},
"CompleteMultipartUploadOutput":{
"modify":[
{
"ServerSideEncryption":{"emitPropertyName":"ServerSideEncryptionMethod"}
},
{
"SSEKMSKeyId":{"emitPropertyName":"ServerSideEncryptionKeyManagementServiceKeyId"}
},
{
"Expiration":{"injectXmlUnmarshallCode":["ExpirationCustomUnmarshall(context, response);"]}
}
]
},
"CompletedMultipartUpload":{
"modify":[
{
"Parts": {"emitPropertyName":"PartETags"}
}
]
}
},
"operationModifiers": {
Expand Down Expand Up @@ -1840,6 +1866,9 @@
},
"JSONType":{
"renameShape":"JsonType"
},
"CompletedPart":{
"renameShape":"PartETag"
}
},
"overrideTreatEnumsAsString":{
Expand Down Expand Up @@ -2099,6 +2128,13 @@
"Marshaller":"UserMetadata.Marshall",
"Unmarshaller":"StringUnmarshaller"
}
},
"CompleteMultipartUploadOutput":{
"Expiration":{
"Type":"Expiration",
"Marshaller":"blah",
"Unmarshaller":"StringUnmarshaller"
}
}
},
"excludeMembers":{
Expand Down Expand Up @@ -2165,6 +2201,9 @@
},
"CopyObjectRequest":{
"alternateBaseClass": "PutWithACLRequest"
},
"PartETag":{
"alternateBaseClass": "IComparable<PartETag>"
}
},
"flattenShapes" : {
Expand All @@ -2182,6 +2221,9 @@
],
"RestoreObjectRequest":[
"RestoreRequest"
],
"CompleteMultipartUploadRequest":[
"MultipartUpload"
]
},
"excludeShapes":[
Expand All @@ -2195,6 +2237,7 @@
"IntelligentTieringFilter",
"IntelligentTieringAndOperator",
"InventoryFilter",
"GlacierJobTier"
"GlacierJobTier",
"CompletedMultipartUpload"
]
}
Loading