// ------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.Marshallers
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
///
/// Class to produce the template output
///
#line 1 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class JsonRPCExceptionUnmarshaller : BaseResponseUnmarshaller
{
#line hidden
///
/// Create the template output
///
public override string TransformText()
{
#line 6 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
AddLicenseHeader();
AddCommonUsingStatements();
#line default
#line hidden
this.Write("using ThirdParty.Json.LitJson;\r\n\r\nnamespace ");
#line 13 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model.Internal.MarshallTransformations\r\n{\r\n /// \r\n /// Response U" +
"nmarshaller for ");
#line 16 "C:\Users\ezhilani\source\repos\aws-sdk-net\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 18 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
#line default
#line hidden
this.Write("Unmarshaller : IErrorResponseUnmarshaller<");
#line 18 "C:\Users\ezhilani\source\repos\aws-sdk-net\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 ");
#line 25 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
#line default
#line hidden
this.Write(@" Unmarshall(JsonUnmarshallerContext context)
{
return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse());
}
///
/// Unmarshaller the response from the service to the response class.
///
///
///
///
public ");
#line 36 "C:\Users\ezhilani\source\repos\aws-sdk-net\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");
#line 40 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
if (this.Config.ServiceModel.IsAwsQueryCompatible)
{
GenerateAWSQueryCompatibleBlock();
#line default
#line hidden
this.Write(" ");
#line 45 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
#line default
#line hidden
this.Write(" unmarshalledObject = new ");
#line 45 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
#line default
#line hidden
this.Write("(errorResponse.Message, errorResponse.InnerException,\r\n errorType," +
" errorCode, errorResponse.RequestId, errorResponse.StatusCode);\r\n");
#line 47 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
}
else
{
#line default
#line hidden
this.Write(" ");
#line 52 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
#line default
#line hidden
this.Write(" unmarshalledObject = new ");
#line 52 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
#line default
#line hidden
this.Write("(errorResponse.Message, errorResponse.InnerException,\r\n errorRespo" +
"nse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode)" +
";\r\n");
#line 54 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
}
#line default
#line hidden
this.Write(" \r\n int targetDepth = context.CurrentDepth;\r\n while " +
"(context.ReadAtDepth(targetDepth))\r\n {\r\n");
#line 61 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
if(this.Structure != null)
{
foreach (var member in this.Structure.Members)
{
#line default
#line hidden
this.Write(" if (context.TestExpression(\"");
#line 67 "C:\Users\ezhilani\source\repos\aws-sdk-net\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 69 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate()));
#line default
#line hidden
this.Write(";\r\n unmarshalledObject.");
#line 70 "C:\Users\ezhilani\source\repos\aws-sdk-net\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");
#line 73 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n \r\n return unmarshalledObject;\r\n }\r\n\r\n");
#line 82 "C:\Users\ezhilani\source\repos\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\Marshallers\JsonRPCExceptionUnmarshaller.tt"
this.AddStructureSingletonMethod();
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}