diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.cs index bb9e2298f1cc..c7e2a92fc95b 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.cs @@ -273,7 +273,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); + ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context); "); #line 121 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryEC2ResponseUnmarshaller.tt" diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.tt index 378de529009f..6207a8edd2bf 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.tt @@ -117,7 +117,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); + ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context); <# foreach (var exception in this.Operation.Exceptions) { diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.cs index 01aa30211aa1..1ddd526d3a47 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.cs @@ -18,7 +18,7 @@ namespace ServiceClientGenerator.Generators.Marshallers /// Class to produce the template output /// - #line 1 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 1 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class AWSQueryExceptionUnmarshaller : BaseResponseUnmarshaller { @@ -29,7 +29,7 @@ public partial class AWSQueryExceptionUnmarshaller : BaseResponseUnmarshaller public override string TransformText() { - #line 6 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 6 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" AddLicenseHeader(); @@ -40,7 +40,7 @@ public override string TransformText() #line hidden this.Write("#pragma warning disable CS0612,CS0618\r\nnamespace "); - #line 12 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 12 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace)); #line default @@ -48,21 +48,21 @@ public override string TransformText() this.Write(".Model.Internal.MarshallTransformations\r\n{\r\n /// \r\n /// Response U" + "nmarshaller for "); - #line 15 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 15 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" operation\r\n /// \r\n public class "); - #line 17 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden - this.Write("Unmarshaller : IErrorResponseUnmarshaller<"); + this.Write("Unmarshaller : IXmlErrorResponseUnmarshaller<"); - #line 17 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -72,7 +72,7 @@ public override string TransformText() "\n /// \r\n /// \r\n " + " public "); - #line 24 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 24 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -90,7 +90,7 @@ public override string TransformText() /// public "); - #line 35 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 35 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -98,14 +98,14 @@ public override string TransformText() this.Write(" Unmarshall(XmlUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse" + " errorResponse)\r\n {\r\n "); - #line 37 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 37 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" response = new "); - #line 37 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 37 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -125,7 +125,7 @@ public override string TransformText() { "); - #line 50 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 50 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" if(this.Structure != null) { @@ -138,14 +138,14 @@ public override string TransformText() #line hidden this.Write(" if (context.TestExpression(\""); - #line 57 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(testExpression)); #line default #line hidden this.Write("\", targetDepth))\r\n {\r\n"); - #line 59 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 59 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" if (member.IsMap || member.IsList) { @@ -155,42 +155,42 @@ public override string TransformText() #line hidden this.Write(" if (response."); - #line 63 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 63 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(MemberAccessorFor(member.PropertyName))); #line default #line hidden this.Write(" == null)\r\n {\r\n response."); - #line 65 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 65 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(MemberAccessorFor(member.PropertyName))); #line default #line hidden this.Write(" = new "); - #line 65 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 65 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType())); #line default #line hidden this.Write("();\r\n }\r\n var item = "); - #line 67 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 67 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden this.Write(".Unmarshall(context);\r\n response."); - #line 68 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 68 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(MemberAccessorFor(member.PropertyName))); #line default #line hidden this.Write(".Add(item);\r\n"); - #line 69 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 69 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" } else @@ -201,21 +201,21 @@ public override string TransformText() #line hidden this.Write(" response."); - #line 74 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 74 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(MemberAccessorFor(member.PropertyName))); #line default #line hidden this.Write(" = "); - #line 74 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 74 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden this.Write(".Unmarshall(context);\r\n"); - #line 75 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 75 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" } @@ -224,7 +224,7 @@ public override string TransformText() #line hidden this.Write(" }\r\n"); - #line 79 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 79 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" } } @@ -234,7 +234,7 @@ public override string TransformText() #line hidden this.Write(" }\r\n }\r\n return response;\r\n }\r\n\r\n"); - #line 88 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 88 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" this.AddStructureSingletonMethod(); @@ -245,7 +245,7 @@ public override string TransformText() return this.GenerationEnvironment.ToString(); } - #line 94 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" + #line 94 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt" // if the result fields have been wrapped in a subordinate structure, wire the accessor // to use it when addressing a member diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.tt index 0f17743a821d..ea6fd3f5d926 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.tt @@ -14,7 +14,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for <#=this.UnmarshallerBaseName #> operation /// - public class <#=this.UnmarshallerBaseName #>Unmarshaller : IErrorResponseUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext> + public class <#=this.UnmarshallerBaseName #>Unmarshaller : IXmlErrorResponseUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext> { /// /// Unmarshaller the response from the service to the response class. diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.cs index 65d9a560f376..9fca6b480d3f 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.cs @@ -316,7 +316,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); + ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.tt index 772e6bc50820..f5f0c8d075a9 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.tt @@ -138,7 +138,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); + ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryStructureUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryStructureUnmarshaller.cs index 43daa547babb..16f6324eb5b0 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryStructureUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryStructureUnmarshaller.cs @@ -18,7 +18,7 @@ namespace ServiceClientGenerator.Generators.Marshallers /// Class to produce the template output /// - #line 1 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 1 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class AWSQueryStructureUnmarshaller : BaseResponseUnmarshaller { @@ -29,7 +29,7 @@ public partial class AWSQueryStructureUnmarshaller : BaseResponseUnmarshaller public override string TransformText() { - #line 6 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 6 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" AddLicenseHeader(); @@ -40,7 +40,7 @@ public override string TransformText() #line hidden this.Write("#pragma warning disable CS0612,CS0618\r\nnamespace "); - #line 12 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 12 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace)); #line default @@ -48,52 +48,45 @@ public override string TransformText() this.Write(".Model.Internal.MarshallTransformations\r\n{\r\n /// \r\n /// Response U" + "nmarshaller for "); - #line 15 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 15 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" Object\r\n /// \r\n public class "); - #line 17 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden - this.Write("Unmarshaller : IUnmarshaller<"); + this.Write("Unmarshaller : IXmlUnmarshaller<"); - #line 17 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden - this.Write(", XmlUnmarshallerContext>, IUnmarshaller<"); + this.Write(", XmlUnmarshallerContext>\r\n {\r\n /// \r\n /// Unmarshaller" + + " the response from the service to the response class.\r\n /// \r" + + "\n /// \r\n /// \r\n " + + " public "); - #line 17 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); - - #line default - #line hidden - this.Write(", JsonUnmarshallerContext>\r\n {\r\n /// \r\n /// Unmarshalle" + - "r the response from the service to the response class.\r\n /// " + - "\r\n /// \r\n /// \r\n " + - " public "); - - #line 24 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 24 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" Unmarshall(XmlUnmarshallerContext context)\r\n {\r\n "); - #line 26 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 26 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" unmarshalledObject = new "); - #line 26 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 26 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -111,7 +104,7 @@ public override string TransformText() { "); - #line 37 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 37 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" if(this.Structure != null) { @@ -124,7 +117,7 @@ public override string TransformText() #line hidden this.Write(" if (context.TestExpression(\""); - #line 44 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 44 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(testExpression)); #line default @@ -132,14 +125,14 @@ public override string TransformText() this.Write("\", targetDepth))\r\n {\r\n var unmarshaller" + " = "); - #line 46 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 46 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden this.Write(";\r\n"); - #line 47 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 47 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" if (member.IsMap || member.IsList) { @@ -149,7 +142,7 @@ public override string TransformText() #line hidden this.Write(" if (unmarshalledObject."); - #line 51 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 51 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default @@ -157,14 +150,14 @@ public override string TransformText() this.Write(" == null)\r\n {\r\n unmarshalledObj" + "ect."); - #line 53 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 53 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden this.Write(" = new "); - #line 53 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 53 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType())); #line default @@ -172,14 +165,14 @@ public override string TransformText() this.Write("();\r\n }\r\n var item = unmarshaller.U" + "nmarshall(context);\r\n unmarshalledObject."); - #line 56 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 56 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden this.Write(".Add(item);\r\n"); - #line 57 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" } else @@ -190,14 +183,14 @@ public override string TransformText() #line hidden this.Write(" unmarshalledObject."); - #line 62 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 62 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden this.Write(" = unmarshaller.Unmarshall(context);\r\n"); - #line 63 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 63 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" } @@ -206,7 +199,7 @@ public override string TransformText() #line hidden this.Write(" continue;\r\n }\r\n"); - #line 68 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 68 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" } } @@ -224,22 +217,9 @@ public override string TransformText() return unmarshalledObject; } - /// - /// Unmarshaller error response to exception. - /// - /// - /// - public "); - - #line 87 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); - - #line default - #line hidden - this.Write(" Unmarshall(JsonUnmarshallerContext context)\r\n {\r\n return null;" + - "\r\n }\r\n\r\n\r\n"); +"); - #line 93 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" + #line 82 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryStructureUnmarshaller.tt" this.AddStructureSingletonMethod(); diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryStructureUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryStructureUnmarshaller.tt index d5ca583c4f05..15453b45a2c4 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryStructureUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryStructureUnmarshaller.tt @@ -14,7 +14,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for <#=this.UnmarshallerBaseName #> Object /// - public class <#=this.UnmarshallerBaseName #>Unmarshaller : IUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext>, IUnmarshaller<<#=this.UnmarshallerBaseName #>, JsonUnmarshallerContext> + public class <#=this.UnmarshallerBaseName #>Unmarshaller : IXmlUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext> { /// /// Unmarshaller the response from the service to the response class. @@ -79,17 +79,6 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations return unmarshalledObject; } - /// - /// Unmarshaller error response to exception. - /// - /// - /// - public <#=this.UnmarshallerBaseName #> Unmarshall(JsonUnmarshallerContext context) - { - return null; - } - - <# this.AddStructureSingletonMethod(); #> diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.cs index cfb8e819b070..a76b07e68f69 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.cs @@ -18,7 +18,7 @@ namespace ServiceClientGenerator.Generators.Marshallers /// Class to produce the template output /// - #line 1 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 1 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class JsonRPCExceptionUnmarshaller : BaseResponseUnmarshaller { @@ -29,7 +29,7 @@ public partial class JsonRPCExceptionUnmarshaller : BaseResponseUnmarshaller public override string TransformText() { - #line 6 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 6 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" AddLicenseHeader(); @@ -38,10 +38,10 @@ public override string TransformText() #line default #line hidden - this.Write("using ThirdParty.Json.LitJson;\r\n\r\n#pragma warning disable CS0612,CS0618\r\nnamespac" + - "e "); + this.Write("using System.Text.Json;\r\nusing Amazon.Util;\r\n#pragma warning disable CS0612,CS061" + + "8\r\nnamespace "); - #line 14 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 14 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace)); #line default @@ -49,38 +49,43 @@ public override string TransformText() this.Write(".Model.Internal.MarshallTransformations\r\n{\r\n /// \r\n /// Response U" + "nmarshaller for "); - #line 17 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" Object\r\n /// \r\n public class "); - #line 19 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 19 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden - this.Write("Unmarshaller : IErrorResponseUnmarshaller<"); + this.Write("Unmarshaller : IJsonErrorResponseUnmarshaller<"); - #line 19 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 19 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden - this.Write(", JsonUnmarshallerContext>\r\n {\r\n /// \r\n /// Unmarshalle" + - "r the response from the service to the response class.\r\n /// " + - "\r\n /// \r\n /// \r\n " + - " public "); + this.Write(@", JsonUnmarshallerContext> + { + /// + /// Unmarshaller the response from the service to the response class. + /// + /// + /// + /// + public "); - #line 26 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 27 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden - this.Write(@" Unmarshall(JsonUnmarshallerContext context) + this.Write(@" Unmarshall(JsonUnmarshallerContext context, ref StreamingUtf8JsonReader reader) { - return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse()); + return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse(), ref reader); } /// @@ -88,18 +93,20 @@ public override string TransformText() /// /// /// + /// /// public "); - #line 37 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 39 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorRespons" + - "e errorResponse)\r\n {\r\n context.Read();\r\n\r\n"); + "e errorResponse, ref StreamingUtf8JsonReader reader)\r\n {\r\n con" + + "text.Read(ref reader);\r\n\r\n"); - #line 41 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 43 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" if (this.Config.ServiceModel.IsAwsQueryCompatible) { @@ -110,14 +117,14 @@ public override string TransformText() #line hidden this.Write(" "); - #line 46 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 48 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" unmarshalledObject = new "); - #line 46 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 48 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -125,7 +132,7 @@ public override string TransformText() this.Write("(errorResponse.Message, errorResponse.InnerException,\r\n errorType," + " errorCode, errorResponse.RequestId, errorResponse.StatusCode);\r\n"); - #line 48 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 50 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" } else @@ -136,14 +143,14 @@ public override string TransformText() #line hidden this.Write(" "); - #line 53 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 55 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" unmarshalledObject = new "); - #line 53 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 55 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -152,7 +159,7 @@ public override string TransformText() "nse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode)" + ";\r\n"); - #line 55 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" } @@ -160,9 +167,9 @@ public override string TransformText() #line default #line hidden this.Write(" \r\n int targetDepth = context.CurrentDepth;\r\n while " + - "(context.ReadAtDepth(targetDepth))\r\n {\r\n"); + "(context.ReadAtDepth(targetDepth, ref reader))\r\n {\r\n"); - #line 62 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 64 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" if(this.Structure != null) { @@ -174,29 +181,29 @@ public override string TransformText() #line hidden this.Write(" if (context.TestExpression(\""); - #line 68 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 70 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallName)); #line default #line hidden this.Write("\", targetDepth))\r\n {\r\n var unmarshaller = "); - #line 70 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 72 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden this.Write(";\r\n unmarshalledObject."); - #line 71 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 73 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - this.Write(" = unmarshaller.Unmarshall(context);\r\n continue;\r\n " + - " }\r\n"); + this.Write(" = unmarshaller.Unmarshall(context, ref reader);\r\n continue;\r\n" + + " }\r\n"); - #line 74 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 76 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" } } @@ -206,7 +213,7 @@ public override string TransformText() #line hidden this.Write(" }\r\n \r\n return unmarshalledObject;\r\n }\r\n\r\n"); - #line 83 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" + #line 85 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt" this.AddStructureSingletonMethod(); diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.tt index 97ebdf03a760..2c75b5a2d328 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCExceptionUnmarshaller.tt @@ -8,24 +8,25 @@ AddCommonUsingStatements(); #> -using ThirdParty.Json.LitJson; - +using System.Text.Json; +using Amazon.Util; #pragma warning disable CS0612,CS0618 namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations { /// /// Response Unmarshaller for <#=this.UnmarshallerBaseName #> Object /// - public class <#=this.UnmarshallerBaseName #>Unmarshaller : IErrorResponseUnmarshaller<<#=this.UnmarshallerBaseName #>, JsonUnmarshallerContext> + public class <#=this.UnmarshallerBaseName #>Unmarshaller : IJsonErrorResponseUnmarshaller<<#=this.UnmarshallerBaseName #>, JsonUnmarshallerContext> { /// /// Unmarshaller the response from the service to the response class. /// /// + /// /// - public <#=this.UnmarshallerBaseName #> Unmarshall(JsonUnmarshallerContext context) + public <#=this.UnmarshallerBaseName #> Unmarshall(JsonUnmarshallerContext context, ref StreamingUtf8JsonReader reader) { - return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse()); + return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse(), ref reader); } /// @@ -33,10 +34,11 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// /// /// + /// /// - public <#=this.UnmarshallerBaseName #> Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) + public <#=this.UnmarshallerBaseName #> Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse, ref StreamingUtf8JsonReader reader) { - context.Read(); + context.Read(ref reader); <# if (this.Config.ServiceModel.IsAwsQueryCompatible) @@ -57,7 +59,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations #> int targetDepth = context.CurrentDepth; - while (context.ReadAtDepth(targetDepth)) + while (context.ReadAtDepth(targetDepth, ref reader)) { <# if(this.Structure != null) @@ -68,7 +70,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations if (context.TestExpression("<#=member.MarshallName#>", targetDepth)) { var unmarshaller = <#= member.DetermineTypeUnmarshallerInstantiate() #>; - unmarshalledObject.<#=member.PropertyName#> = unmarshaller.Unmarshall(context); + unmarshalledObject.<#=member.PropertyName#> = unmarshaller.Unmarshall(context, ref reader); continue; } <# diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCRequestMarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCRequestMarshaller.cs index 85a51a68f195..0189b2265863 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCRequestMarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCRequestMarshaller.cs @@ -38,31 +38,31 @@ public override string TransformText() #line default #line hidden - this.Write("using System.Text.Json;\r\nusing System.Buffers;\r\n#pragma warning disable CS0612,CS" + - "0618\r\nnamespace "); + this.Write("using System.Text.Json;\r\nusing System.Buffers;\r\n#if !NETFRAMEWORK\r\nusing ThirdPar" + + "ty.RuntimeBackports;\r\n#endif\r\n#pragma warning disable CS0612,CS0618\r\nnamespace "); - #line 14 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace)); #line default #line hidden this.Write(".Model.Internal.MarshallTransformations\r\n{\r\n\t/// \r\n\t/// "); - #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 20 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name)); #line default #line hidden this.Write(" Request Marshaller\r\n\t/// \r\n\tpublic class "); - #line 19 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 22 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name)); #line default #line hidden this.Write("RequestMarshaller : IMarshaller\r\n /// \r\n\t\tpublic IReque" + "st Marshall("); - #line 36 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 39 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name)); #line default @@ -96,14 +96,14 @@ public IRequest Marshall(AmazonWebServiceRequest input) this.Write("Request publicRequest)\r\n\t\t{\r\n\t\t\tIRequest request = new DefaultRequest(publicReque" + "st, \""); - #line 38 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 41 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace)); #line default #line hidden this.Write("\");\r\n"); - #line 39 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 42 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" SetCompressionAlgorithmEncoding(this.Operation); @@ -115,21 +115,21 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\tstring target = \""); - #line 45 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 48 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.TargetPrefix)); #line default #line hidden this.Write("."); - #line 45 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 48 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name)); #line default #line hidden this.Write("\";\r\n\t\t\trequest.Headers[\"X-Amz-Target\"] = target;\r\n"); - #line 47 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 50 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } if (this.Operation.HttpMethod != "GET" && this.Operation.HttpMethod != "DELETE") @@ -143,14 +143,14 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\trequest.Headers[\"Content-Type\"] = \""); - #line 55 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 58 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.Customizations.OverrideContentType)); #line default #line hidden this.Write("\";\r\n"); - #line 56 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 59 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } else if (this.Config.ServiceModel.Type != ServiceType.Rest_Json) @@ -161,14 +161,14 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\trequest.Headers[\"Content-Type\"] = \"application/x-amz-json-"); - #line 61 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 64 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.JsonVersion)); #line default #line hidden this.Write("\";\r\n"); - #line 62 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 65 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } else if (this.Operation.RequestHasBodyMembers || this.Operation.RequestPayloadMember != null) @@ -179,7 +179,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\trequest.Headers[\"Content-Type\"] = \"application/json\";\r\n"); - #line 68 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 71 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } } @@ -189,21 +189,21 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write(" request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = \""); - #line 72 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 75 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.APIVersion)); #line default #line hidden this.Write("\";\r\n request.HttpMethod = \""); - #line 73 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 76 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.HttpMethod)); #line default #line hidden this.Write("\";\r\n\r\n"); - #line 75 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 78 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" var requestStructure = this.Operation.RequestStructure; @@ -221,14 +221,14 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\trequest.ResourcePath = \""); - #line 87 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 90 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.RequestUri)); #line default #line hidden this.Write("\";\r\n"); - #line 88 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 91 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" var payload = this.Operation.RequestPayloadMember; @@ -240,16 +240,16 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line default #line hidden - this.Write(@"#if NETCOREAPP3_1_OR_GREATER - ArrayBufferWriter arrayBufferWriter = new ArrayBufferWriter(); - using Utf8JsonWriter writer = new Utf8JsonWriter(arrayBufferWriter); + this.Write(@"#if !NETFRAMEWORK + using ArrayPoolBufferWriter arrayPoolBufferWriter = new ArrayPoolBufferWriter(); + using Utf8JsonWriter writer = new Utf8JsonWriter(arrayPoolBufferWriter); #else using var memoryStream = new MemoryStream(); using Utf8JsonWriter writer = new Utf8JsonWriter(memoryStream); #endif "); - #line 103 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 106 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" if (shouldMarshallPayload) { @@ -259,7 +259,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\tvar context = new JsonMarshallerContext(request, writer);\r\n"); - #line 108 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 111 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" ProcessStructure(0, "publicRequest." + payload.PropertyName, payload.Shape); @@ -268,7 +268,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\twriter.Flush();\r\n"); - #line 112 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 115 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } else @@ -280,7 +280,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) this.Write("\t\t\twriter.WriteStartObject();\r\n\t\t\tvar context = new JsonMarshallerContext(request" + ", writer);\r\n"); - #line 119 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 122 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" ProcessMembers(0, "publicRequest", this.Operation.RequestBodyMembers); @@ -289,18 +289,18 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\twriter.WriteEndObject();\r\n\t\t\twriter.Flush();\r\n"); - #line 124 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 127 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } #line default #line hidden - this.Write("#if NETCOREAPP3_1_OR_GREATER\r\n request.Content = arrayBufferWriter.Wri" + - "ttenMemory.ToArray();\r\n#else\r\n\t\t\trequest.Content = memoryStream.ToArray();\r\n#end" + - "if\r\n"); + this.Write("\t\t\t// ToArray() must be called here because aspects of sigv4 signing require a by" + + "te array\r\n#if !NETFRAMEWORK\r\n\t\t\trequest.Content = arrayPoolBufferWriter.WrittenM" + + "emory.ToArray();\r\n#else\r\n\t\t\trequest.Content = memoryStream.ToArray();\r\n#endif\r\n"); - #line 132 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 136 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" GenerateRequestChecksumHandling(this.Operation, "snippet"); @@ -309,7 +309,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\t\r\n\r\n"); - #line 136 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 140 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } else if (payload?.Shape.IsString == true) @@ -320,14 +320,14 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\trequest.Content = System.Text.Encoding.UTF8.GetBytes(publicRequest."); - #line 141 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 145 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(payload.PropertyName)); #line default #line hidden this.Write(");\r\n"); - #line 142 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 146 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } else if (payload?.IsMemoryStream == true) @@ -338,14 +338,14 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\trequest.ContentStream = publicRequest."); - #line 147 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 151 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(payload.PropertyName)); #line default #line hidden this.Write(" ?? new MemoryStream();\r\n"); - #line 148 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 152 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" var requiresLength = payload.RequiresLength; if (!requiresLength && payload.Shape.IsStreaming && this.Operation.AuthType == OperationAuthType.V4UnsignedBody) @@ -366,7 +366,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) } "); - #line 163 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 167 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } else @@ -381,7 +381,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) "onException(\"Cannot determine stream length for the payload when content-length " + "is required.\");\r\n\t\t\t}\r\n"); - #line 174 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 178 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } @@ -393,7 +393,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) "ader] =\r\n\t\t\t\trequest.ContentStream.Length.ToString(CultureInfo.InvariantCulture)" + ";\r\n"); - #line 183 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 187 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } @@ -403,7 +403,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) this.Write("\t\t\trequest.Headers[Amazon.Util.HeaderKeys.ContentTypeHeader] = \"application/octet" + "-stream\";\r\n"); - #line 187 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 191 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } else if (payload?.Shape.IsPrimitiveType == true) @@ -423,7 +423,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) this.Write("\t\t\tvar content = \"{}\";\r\n request.Content = System.Text.Encoding.UTF8.G" + "etBytes(content);\r\n"); - #line 202 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 206 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" GenerateRequestChecksumHandling(this.Operation, "content"); @@ -431,7 +431,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line default #line hidden - #line 205 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 209 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } @@ -460,7 +460,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\t\t\trequest.UseQueryString = true;\r\n"); - #line 218 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 222 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" } // We skip endpoint host prefix handling for S3 and S3 Control as it's implemented by endpoint rules. @@ -474,7 +474,7 @@ public IRequest Marshall(AmazonWebServiceRequest input) #line hidden this.Write("\r\n\t\t\treturn request;\r\n\t\t}\r\n"); - #line 229 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" + #line 233 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCRequestMarshaller.tt" this.AddRequestSingletonMethod(); diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCRequestMarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCRequestMarshaller.tt index f90fe691939c..2383fd36653f 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCRequestMarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCRequestMarshaller.tt @@ -10,6 +10,9 @@ #> using System.Text.Json; using System.Buffers; +#if !NETFRAMEWORK +using ThirdParty.RuntimeBackports; +#endif #pragma warning disable CS0612,CS0618 namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations { @@ -93,9 +96,9 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations if (this.Operation.RequestHasBodyMembers || shouldMarshallPayload) { #> -#if NETCOREAPP3_1_OR_GREATER - ArrayBufferWriter arrayBufferWriter = new ArrayBufferWriter(); - using Utf8JsonWriter writer = new Utf8JsonWriter(arrayBufferWriter); +#if !NETFRAMEWORK + using ArrayPoolBufferWriter arrayPoolBufferWriter = new ArrayPoolBufferWriter(); + using Utf8JsonWriter writer = new Utf8JsonWriter(arrayPoolBufferWriter); #else using var memoryStream = new MemoryStream(); using Utf8JsonWriter writer = new Utf8JsonWriter(memoryStream); @@ -124,8 +127,9 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations <# } #> -#if NETCOREAPP3_1_OR_GREATER - request.Content = arrayBufferWriter.WrittenMemory.ToArray(); + // ToArray() must be called here because aspects of sigv4 signing require a byte array +#if !NETFRAMEWORK + request.Content = arrayPoolBufferWriter.WrittenMemory.ToArray(); #else request.Content = memoryStream.ToArray(); #endif diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.cs index 053f57ad0c6c..6749cdb7781c 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.cs @@ -38,8 +38,8 @@ public override string TransformText() #line default #line hidden - this.Write("using ThirdParty.Json.LitJson;\r\n\r\n#pragma warning disable CS0612,CS0618\r\nnamespac" + - "e "); + this.Write("using System.Text.Json;\r\nusing Amazon.Util;\r\n#pragma warning disable CS0612,CS061" + + "8\r\nnamespace "); #line 14 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace)); @@ -84,9 +84,9 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line default #line hidden - this.Write("Response();\r\n\r\n"); + this.Write("Response();\r\n"); - #line 30 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 29 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" var payload = this.Operation.ResponsePayloadMember; var unmarshallPayload = payload != null && payload.IsStructure; @@ -114,21 +114,21 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line hidden this.Write(" response."); - #line 52 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 51 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(payload.PropertyName)); #line default #line hidden this.Write(" = new "); - #line 52 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 51 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(payload.Shape.Name)); #line default #line hidden this.Write("(context.Stream);\r\n"); - #line 53 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 52 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } else if (payloadIsStream) @@ -141,14 +141,14 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line hidden this.Write(" response."); - #line 60 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 59 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(payload.PropertyName)); #line default #line hidden this.Write(" = context.Stream;\r\n"); - #line 61 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 60 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } else if (payload.ModelShape.IsString) @@ -160,14 +160,14 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont this.Write(" using (var sr = new StreamReader(context.Stream))\r\n {\r\n " + " response."); - #line 68 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 67 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(payload.PropertyName)); #line default #line hidden this.Write(" = sr.ReadToEnd();\r\n }\r\n"); - #line 70 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 69 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } else if (payload.ModelShape.IsMemoryStream) @@ -180,14 +180,14 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont "yStream(context.Stream, ms);\r\n ms.Seek(0, SeekOrigin.Begin);\r\n " + " if (ms.Length > 0)\r\n response."); - #line 79 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 78 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(payload.PropertyName)); #line default #line hidden this.Write(" = ms;\r\n"); - #line 80 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 79 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } else @@ -205,7 +205,8 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line default #line hidden - this.Write(" var unmarshaller = "); + this.Write(" StreamingUtf8JsonReader reader = new StreamingUtf8JsonReader(context." + + "Stream);\r\n var unmarshaller = "); #line 94 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(payload.DetermineTypeUnmarshallerInstantiate())); @@ -219,7 +220,7 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line default #line hidden - this.Write(" = unmarshaller.Unmarshall(context);\r\n"); + this.Write(" = unmarshaller.Unmarshall(context, ref reader);\r\n"); #line 96 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" @@ -244,7 +245,7 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line default #line hidden - this.Write("Unmarshaller.Instance.Unmarshall(context);\r\n"); + this.Write("Unmarshaller.Instance.Unmarshall(context, ref reader);\r\n"); #line 102 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" @@ -255,10 +256,14 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line default #line hidden - this.Write(" context.Read();\r\n int targetDepth = context.CurrentDepth;\r" + - "\n while (context.ReadAtDepth(targetDepth))\r\n {\r\n"); + this.Write(@" StreamingUtf8JsonReader reader = new StreamingUtf8JsonReader(context.Stream); + context.Read(ref reader); + int targetDepth = context.CurrentDepth; + while (context.ReadAtDepth(targetDepth, ref reader)) + { +"); - #line 111 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 112 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" foreach (var member in this.Operation.ResponseBodyMembers) @@ -269,29 +274,29 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line hidden this.Write(" if (context.TestExpression(\""); - #line 116 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 117 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallName)); #line default #line hidden this.Write("\", targetDepth))\r\n {\r\n var unmarshaller = "); - #line 118 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 119 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden this.Write(";\r\n response."); - #line 119 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 120 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden - this.Write(" = unmarshaller.Unmarshall(context);\r\n continue;\r\n " + - " }\r\n"); + this.Write(" = unmarshaller.Unmarshall(context, ref reader);\r\n continue;\r\n" + + " }\r\n"); - #line 122 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 123 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } @@ -300,7 +305,7 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont #line hidden this.Write(" }\r\n"); - #line 126 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 127 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } } @@ -323,7 +328,8 @@ public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext cont /// public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); + StreamingUtf8JsonReader reader = new StreamingUtf8JsonReader(context.Stream); + var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context, ref reader); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; @@ -332,7 +338,7 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte using (var streamCopy = new MemoryStream(responseBodyBytes)) "); - #line 152 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 154 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" if (this.Config.ServiceModel.IsAwsQueryCompatible) { @@ -341,17 +347,19 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte #line default #line hidden - #line 156 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 158 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" // Create a copy of context with headers in the response + + #line default #line hidden - this.Write("\r\n using (var contextCopy = new JsonUnmarshallerContext(streamCopy, tr" + - "ue, context.ResponseData))\r\n"); + this.Write(" using (var contextCopy = new JsonUnmarshallerContext(streamCopy, true" + + ", context.ResponseData))\r\n"); - #line 159 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 162 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" - } + } else { @@ -361,16 +369,18 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte this.Write(" using (var contextCopy = new JsonUnmarshallerContext(streamCopy, fals" + "e, null))\r\n"); - #line 165 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 168 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + // Create a new reader because the stream has been read already in the original context } #line default #line hidden - this.Write(" {\r\n"); + this.Write(" {\r\n StreamingUtf8JsonReader readerCopy = new Streaming" + + "Utf8JsonReader(streamCopy);\r\n"); - #line 169 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 174 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" foreach (var exception in this.Operation.Exceptions) { @@ -380,22 +390,22 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte #line hidden this.Write(" if (errorResponse.Code != null && errorResponse.Code.Equals(\""); - #line 173 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 178 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(exception.Code)); #line default #line hidden this.Write("\"))\r\n {\r\n return "); - #line 175 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 180 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name)); #line default #line hidden - this.Write("Unmarshaller.Instance.Unmarshall(contextCopy, errorResponse);\r\n }\r" + - "\n"); + this.Write("Unmarshaller.Instance.Unmarshall(contextCopy, errorResponse, ref readerCopy);\r\n " + + " }\r\n"); - #line 177 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 182 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } @@ -404,7 +414,7 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte #line hidden this.Write(" }\r\n"); - #line 181 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 186 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" if (this.Config.ServiceModel.IsAwsQueryCompatible) { @@ -415,7 +425,7 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte #line hidden this.Write(" return new "); - #line 186 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 191 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.BaseException)); #line default @@ -423,7 +433,7 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte this.Write("(errorResponse.Message, errorResponse.InnerException, errorType, errorCode, error" + "Response.RequestId, errorResponse.StatusCode);\r\n"); - #line 187 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 192 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } else @@ -434,7 +444,7 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte #line hidden this.Write(" return new "); - #line 192 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 197 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.BaseException)); #line default @@ -442,7 +452,7 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte this.Write("(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorRe" + "sponse.Code, errorResponse.RequestId, errorResponse.StatusCode);\r\n"); - #line 193 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 198 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } @@ -451,7 +461,7 @@ public override AmazonServiceException UnmarshallException(JsonUnmarshallerConte #line hidden this.Write(" }\r\n\r\n"); - #line 198 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 203 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" if (payload != null && payload.Shape.IsStreaming) { @@ -472,7 +482,7 @@ public override bool HasStreamingProperty "); - #line 213 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 218 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } this.AddResponseSingletonMethod(); @@ -481,7 +491,7 @@ public override bool HasStreamingProperty #line default #line hidden - #line 217 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 222 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" if(isEventStreamOutput) { @@ -505,7 +515,7 @@ protected override bool ShouldReadEntireResponse(IWebResponseData response, bool public override bool HasStreamingProperty => true; "); - #line 235 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" + #line 240 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCResponseUnmarshaller.tt" } diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.tt index e2e75b05f40c..f26f178159f2 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCResponseUnmarshaller.tt @@ -8,8 +8,8 @@ AddCommonUsingStatements(); #> -using ThirdParty.Json.LitJson; - +using System.Text.Json; +using Amazon.Util; #pragma warning disable CS0612,CS0618 namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations { @@ -26,7 +26,6 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { <#=this.UnmarshallerBaseName #>Response response = new <#=this.Operation.Name #>Response(); - <# var payload = this.Operation.ResponsePayloadMember; var unmarshallPayload = payload != null && payload.IsStructure; @@ -91,22 +90,24 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations else if (unmarshallPayload) { #> + StreamingUtf8JsonReader reader = new StreamingUtf8JsonReader(context.Stream); var unmarshaller = <#= payload.DetermineTypeUnmarshallerInstantiate() #>; - response.<#=payload.PropertyName#> = unmarshaller.Unmarshall(context); + response.<#=payload.PropertyName#> = unmarshaller.Unmarshall(context, ref reader); <# } else if (this.IsWrapped) { #> - response.<#=this.WrappedResultMember#> = <#=this.Structure.Name#>Unmarshaller.Instance.Unmarshall(context); + response.<#=this.WrappedResultMember#> = <#=this.Structure.Name#>Unmarshaller.Instance.Unmarshall(context, ref reader); <# } else { #> - context.Read(); + StreamingUtf8JsonReader reader = new StreamingUtf8JsonReader(context.Stream); + context.Read(ref reader); int targetDepth = context.CurrentDepth; - while (context.ReadAtDepth(targetDepth)) + while (context.ReadAtDepth(targetDepth, ref reader)) { <# @@ -116,7 +117,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations if (context.TestExpression("<#=member.MarshallName#>", targetDepth)) { var unmarshaller = <#= member.DetermineTypeUnmarshallerInstantiate() #>; - response.<#=member.PropertyName#> = unmarshaller.Unmarshall(context); + response.<#=member.PropertyName#> = unmarshaller.Unmarshall(context, ref reader); continue; } <# @@ -142,7 +143,8 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); + StreamingUtf8JsonReader reader = new StreamingUtf8JsonReader(context.Stream); + var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context, ref reader); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; @@ -153,26 +155,29 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations if (this.Config.ServiceModel.IsAwsQueryCompatible) { #> -<# // Create a copy of context with headers in the response #> +<# // Create a copy of context with headers in the response +#> using (var contextCopy = new JsonUnmarshallerContext(streamCopy, true, context.ResponseData)) <# - } + } else { #> using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) <# + // Create a new reader because the stream has been read already in the original context } #> { + StreamingUtf8JsonReader readerCopy = new StreamingUtf8JsonReader(streamCopy); <# foreach (var exception in this.Operation.Exceptions) { #> if (errorResponse.Code != null && errorResponse.Code.Equals("<#=exception.Code #>")) { - return <#=exception.Name#>Unmarshaller.Instance.Unmarshall(contextCopy, errorResponse); + return <#=exception.Name#>Unmarshaller.Instance.Unmarshall(contextCopy, errorResponse, ref readerCopy); } <# } diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCStructureMarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCStructureMarshaller.cs index 6efe94572797..c9c3f1b2b5d8 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCStructureMarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/JsonRPCStructureMarshaller.cs @@ -38,31 +38,30 @@ public override string TransformText() #line default #line hidden - this.Write("using ThirdParty.Json.LitJson;\r\n\r\n#pragma warning disable CS0612,CS0618\r\nnamespac" + - "e "); + this.Write("#pragma warning disable CS0612,CS0618\r\nnamespace "); - #line 14 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 12 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace)); #line default #line hidden this.Write(".Model.Internal.MarshallTransformations\r\n{\r\n\t/// \r\n\t/// "); - #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 15 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name)); #line default #line hidden this.Write(" Marshaller\r\n\t/// \r\n\tpublic class "); - #line 19 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name)); #line default #line hidden this.Write("Marshaller : IRequestMarshaller<"); - #line 19 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name)); #line default @@ -77,7 +76,7 @@ public override string TransformText() /// public void Marshall("); - #line 27 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 25 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name)); #line default @@ -85,7 +84,7 @@ public override string TransformText() this.Write(" requestObject, JsonMarshallerContext context)\r\n\t\t{\r\n\t\t\tif(requestObject == null)" + "\r\n\t\t\t\treturn;\r\n"); - #line 31 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 29 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" ProcessMembers(0, "requestObject", this.Structure.Members); @@ -95,14 +94,14 @@ public override string TransformText() this.Write("\t\t}\r\n\r\n /// \r\n /// Singleton Marshaller.\r\n /// \r\n\t\tpublic readonly static "); - #line 39 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 37 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name)); #line default #line hidden this.Write("Marshaller Instance = new "); - #line 39 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 37 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name)); #line default @@ -111,7 +110,7 @@ public override string TransformText() return this.GenerationEnvironment.ToString(); } - #line 44 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" + #line 42 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCStructureMarshaller.tt" protected void ProcessMembers(int level, string variableName, IEnumerable members) { @@ -122,91 +121,91 @@ protected void ProcessMembers(int level, string variableName, IEnumerable - #line 1 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 1 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class RestXmlExceptionUnmarshaller : BaseResponseUnmarshaller { @@ -29,7 +29,7 @@ public partial class RestXmlExceptionUnmarshaller : BaseResponseUnmarshaller public override string TransformText() { - #line 6 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 6 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" AddLicenseHeader(); @@ -40,7 +40,7 @@ public override string TransformText() #line hidden this.Write("\r\n#pragma warning disable CS0612,CS0618\r\nnamespace "); - #line 13 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 13 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace)); #line default @@ -48,21 +48,21 @@ public override string TransformText() this.Write(".Model.Internal.MarshallTransformations\r\n{\r\n /// \r\n /// Response U" + "nmarshaller for "); - #line 16 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 16 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" operation\r\n /// \r\n public class "); - #line 18 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 18 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden - this.Write("Unmarshaller : IErrorResponseUnmarshaller<"); + this.Write("Unmarshaller : IXmlErrorResponseUnmarshaller<"); - #line 18 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 18 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -72,7 +72,7 @@ public override string TransformText() "\n /// \r\n /// \r\n " + " public "); - #line 25 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 25 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -90,7 +90,7 @@ public override string TransformText() /// public "); - #line 36 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 36 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -98,14 +98,14 @@ public override string TransformText() this.Write(" Unmarshall(XmlUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse" + " errorResponse)\r\n {\r\n "); - #line 38 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 38 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden this.Write(" response = new "); - #line 38 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 38 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default @@ -119,7 +119,7 @@ public override string TransformText() { "); - #line 45 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 45 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" foreach (var member in this.Structure.Members) { @@ -132,56 +132,56 @@ public override string TransformText() #line hidden this.Write(" if (context.TestExpression(\""); - #line 52 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 52 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallName)); #line default #line hidden this.Write("/"); - #line 52 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 52 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(listMarshallName)); #line default #line hidden this.Write("\"))\r\n {\r\n var unmarshaller = "); - #line 54 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 54 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden this.Write(";\r\n if (response."); - #line 55 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 55 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden this.Write(" == null)\r\n {\r\n response."); - #line 57 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden this.Write(" = new "); - #line 57 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType())); #line default #line hidden this.Write("();\r\n }\r\n response."); - #line 59 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 59 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden this.Write(".Add(unmarshaller.Unmarshall(context));\r\n }\r\n"); - #line 61 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 61 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" } else @@ -192,28 +192,28 @@ public override string TransformText() #line hidden this.Write(" if (context.TestExpression(\""); - #line 66 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 66 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallName)); #line default #line hidden this.Write("\"))\r\n {\r\n var unmarshaller = "); - #line 68 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 68 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate())); #line default #line hidden this.Write(";\r\n response."); - #line 69 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 69 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName)); #line default #line hidden this.Write(" = unmarshaller.Unmarshall(context);\r\n }\r\n"); - #line 71 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 71 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" } } @@ -223,7 +223,7 @@ public override string TransformText() #line hidden this.Write(" }\r\n }\r\n return response;\r\n }\r\n\r\n"); - #line 80 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" + #line 80 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlExceptionUnmarshaller.tt" this.AddStructureSingletonMethod(); diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlExceptionUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlExceptionUnmarshaller.tt index 07d55b10dca8..6c8ce78f5466 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlExceptionUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlExceptionUnmarshaller.tt @@ -15,7 +15,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for <#=this.UnmarshallerBaseName #> operation /// - public class <#=this.UnmarshallerBaseName #>Unmarshaller : IErrorResponseUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext> + public class <#=this.UnmarshallerBaseName #>Unmarshaller : IXmlErrorResponseUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext> { /// /// Unmarshaller the response from the service to the response class. diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.cs index 9fb648ede0a3..74ab4807fd95 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.cs @@ -581,7 +581,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); + ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.tt index e473947324a2..a5b3af7512b1 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlResponseUnmarshaller.tt @@ -246,7 +246,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { - ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); + ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlStructureUnmarshaller.cs b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlStructureUnmarshaller.cs index 42e69ac2f4d0..edb58da33d98 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlStructureUnmarshaller.cs +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlStructureUnmarshaller.cs @@ -60,24 +60,17 @@ public override string TransformText() #line default #line hidden - this.Write("Unmarshaller : IUnmarshaller<"); + this.Write("Unmarshaller : IXmlUnmarshaller<"); #line 18 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); #line default #line hidden - this.Write(", XmlUnmarshallerContext>, IUnmarshaller<"); - - #line 18 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlStructureUnmarshaller.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); - - #line default - #line hidden - this.Write(", JsonUnmarshallerContext>\r\n {\r\n /// \r\n /// Unmarshalle" + - "r the response from the service to the response class.\r\n /// " + - "\r\n /// \r\n /// \r\n " + - " public "); + this.Write(", XmlUnmarshallerContext>\r\n {\r\n /// \r\n /// Unmarshaller" + + " the response from the service to the response class.\r\n /// \r" + + "\n /// \r\n /// \r\n " + + " public "); #line 25 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlStructureUnmarshaller.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); @@ -321,23 +314,9 @@ public override string TransformText() } return unmarshalledObject; } - - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public "); - - #line 128 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlStructureUnmarshaller.tt" - this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName)); - - #line default - #line hidden - this.Write(" Unmarshall(JsonUnmarshallerContext context)\r\n {\r\n throw new No" + - "tImplementedException();\r\n }\r\n\r\n"); +"); - #line 133 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlStructureUnmarshaller.tt" + #line 122 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\RestXmlStructureUnmarshaller.tt" this.AddStructureSingletonMethod(); diff --git a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlStructureUnmarshaller.tt b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlStructureUnmarshaller.tt index 4dd4fe8f796f..1cc56dbbf1de 100644 --- a/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlStructureUnmarshaller.tt +++ b/generator/ServiceClientGeneratorLib/Generators/Marshallers/RestXmlStructureUnmarshaller.tt @@ -15,7 +15,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations /// /// Response Unmarshaller for <#=this.UnmarshallerBaseName #> Object /// - public class <#=this.UnmarshallerBaseName #>Unmarshaller : IUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext>, IUnmarshaller<<#=this.UnmarshallerBaseName #>, JsonUnmarshallerContext> + public class <#=this.UnmarshallerBaseName #>Unmarshaller : IXmlUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext> { /// /// Unmarshaller the response from the service to the response class. @@ -119,17 +119,6 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations } return unmarshalledObject; } - - /// - /// Unmarshaller the response from the service to the response class. - /// - /// - /// - public <#=this.UnmarshallerBaseName #> Unmarshall(JsonUnmarshallerContext context) - { - throw new NotImplementedException(); - } - <# this.AddStructureSingletonMethod(); #> diff --git a/generator/ServiceClientGeneratorLib/Generators/SourceFiles/EventStreamGenerator.cs b/generator/ServiceClientGeneratorLib/Generators/SourceFiles/EventStreamGenerator.cs index ecc5b4f08fee..60f64abc0828 100644 --- a/generator/ServiceClientGeneratorLib/Generators/SourceFiles/EventStreamGenerator.cs +++ b/generator/ServiceClientGeneratorLib/Generators/SourceFiles/EventStreamGenerator.cs @@ -18,7 +18,7 @@ namespace ServiceClientGenerator.Generators.SourceFiles /// Class to produce the template output /// - #line 1 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EventStreamGenerator.tt" + #line 1 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EventStreamGenerator.tt" [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class EventStreamGenerator : StructureGenerator { @@ -29,7 +29,7 @@ public partial class EventStreamGenerator : StructureGenerator public override string TransformText() { - #line 6 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EventStreamGenerator.tt" + #line 6 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EventStreamGenerator.tt" bool isRequest = this.Operation.RequestStructure.Members.Any(x => x.ModelShape.MarshallName == this.Structure.Name); bool isResponse = this.Operation.ResponseStructure.Members.Any(x => x.ModelShape.MarshallName == this.Structure.Name); @@ -40,7 +40,7 @@ public override string TransformText() this.Write(" [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Naming\", \"CA1710:Identifier" + "s should have correct suffix\", Justification = \""); - #line 10 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EventStreamGenerator.tt" + #line 10 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EventStreamGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name)); #line default @@ -49,14 +49,14 @@ public override string TransformText() [System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Design"", ""CA1063"", Justification = ""IDisposable is a transient interface from IEventStream. Users need to be able to call Dispose."")] public sealed class "); - #line 12 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EventStreamGenerator.tt" + #line 12 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EventStreamGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name)); #line default #line hidden this.Write(" : EnumerableEventStream\r\n protected override IDictionary> ExceptionMapping {get;} =\r\n new Dictionary