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 @@ -37,11 +37,24 @@ using Amazon.Runtime.Internal.Util;
{
if (structure != null && this.Config.ServiceModel.Customizations.ShapeModifiers.TryGetValue(structure.Name, out var modifier) && modifier.ExcludedMarshallingProperties.Contains(member.ModeledName))
continue;
bool skipXmlIsSet = this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var propModifier) && propModifier.SkipXmlIsSet;
if (!skipXmlIsSet)
{
#>
if (<#=variableName#>.IsSet<#=member.PropertyName#>())
{
<#+
if (member.CustomMarshallerTransformation != null)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

if(this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var injectPropModifier ) && injectPropModifier.InjectXmlMarshallCode.Count > 0)
{
foreach (var codeSnippet in injectPropModifier.InjectXmlMarshallCode)
{
#>
<#=codeSnippet#>
<#+
}
}
else if (member.CustomMarshallerTransformation != null)
{
#>
request.Headers["<#=member.MarshallLocationName#>"] = <#=member.CustomMarshallerTransformation#>(<#=variableName#>.<#=member.PropertyName#>);
Expand Down Expand Up @@ -118,9 +131,12 @@ using Amazon.Runtime.Internal.Util;
<#+
}
}
if (!skipXmlIsSet)
{
#>
}
<#+
}
}
}
protected void ProcessHeaderMembers(string variableName, IEnumerable<Member> members)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ 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#>
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above( there is also a method above the one i linked for exactly this scenario)

<#+
}
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 @@ -404,6 +404,8 @@ namespace <#=this.Config.Namespace#>.Model

<#
}
if (this.Config.ServiceModel.Customizations.TryGetPropertyModifier(member.OwningShape.Name, member.ModeledName, out var propertyModifier) && propertyModifier.SkipXmlIsSet)
Copy link
Contributor

Choose a reason for hiding this comment

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

curious, what did you need this for?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think for skipping the headers isSet, since it isn't used in the marshaller.

continue;
#>
// Check to see if <#=member.PropertyName#> property is set
internal bool IsSet<#=member.PropertyName#>()
Expand Down
3 changes: 3 additions & 0 deletions generator/ServiceClientGeneratorLib/Operation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,12 @@ public IList<Member> RequestBodyMembers
if (this.RequestStructure == null)
return new List<Member>();

this.model.Customizations.ShapeModifiers.TryGetValue(this.RequestStructure.Name, out var modifiers);

var payloadName = this.RequestStructure.PayloadMemberName;
return this.RequestStructure.Members.Where(
m =>
!(modifiers != null && modifiers.ExcludedMarshallingProperties.Contains(m.ModeledName)) &&
m.MarshallLocation == MarshallLocation.Body &&
!string.Equals(m.MarshallName, payloadName, StringComparison.Ordinal)).ToList();
}
Expand Down
1 change: 1 addition & 0 deletions generator/ServiceClientGeneratorLib/ServiceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ public List<Operation> S3AllowListOperations
new Operation(this, "RenameObject", DocumentRoot[OperationsKey]["RenameObject"]),
new Operation(this, "PutBucketOwnershipControls", DocumentRoot[OperationsKey]["PutBucketOwnershipControls"]),
new Operation(this, "PutBucketTagging", DocumentRoot[OperationsKey]["PutBucketTagging"]),
new Operation(this, "CopyObject", DocumentRoot[OperationsKey]["CopyObject"]),
};
}
return _s3AllowListOperations.Where(operation => operation.data != null).ToList();
Expand Down
Loading