/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { TestInvokeMethodResponse response = new TestInvokeMethodResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("body", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Body = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("headers", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Headers = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("latency", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.Latency = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("log", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Log = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("status", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } } return response; }