@@ -426,6 +426,7 @@ public class CustomizationsModel
426
426
public const string OriginalMemberKey = "originalMember" ;
427
427
public const string OverrideTreatEnumsAsStringKey = "overrideTreatEnumsAsString" ;
428
428
public const string ExcludeMembersKey = "excludeMembers" ;
429
+ public const string UnwrapXmlOutputKey = "unwrapXmlOutput" ;
429
430
430
431
JsonData _documentRoot ;
431
432
@@ -596,6 +597,29 @@ public List<string> ExcludeMembers(string shapeName)
596
597
597
598
}
598
599
600
+ /// <summary>
601
+ /// This customization is used to unwrap the response, and is only used for Xml services.
602
+ /// This is currently only used for GetBucketLocation
603
+ /// where the output is not wrapped in a top-level output xml tag and only includes the member at the root level
604
+ /// example usage:
605
+ /// "unwrapOutput:{
606
+ /// "GetBucketLocationOutput": true
607
+ /// }
608
+ /// </summary>
609
+ /// <param name="shapeName">The shape to unwrap</param>
610
+ /// <returns></returns>
611
+ /// <exception cref="InvalidCastException"></exception>
612
+ public bool UnwrapXmlOutput ( string shapeName )
613
+ {
614
+ var data = _documentRoot [ UnwrapXmlOutputKey ] ;
615
+ // if the customization doesn't exist, the default is false
616
+ if ( data == null || data [ shapeName ] == null ) return false ;
617
+ if ( ! data [ shapeName ] . IsBoolean )
618
+ throw new InvalidCastException ( "The value for the UnwrapOutput customization must be a boolean" ) ;
619
+
620
+ return ( bool ) data [ shapeName ] ;
621
+ }
622
+
599
623
/// <summary>
600
624
/// A list of uri properties for the service where we should not do validation for presence.
601
625
/// </summary>
0 commit comments