public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeCommunicationsResponse response = new DescribeCommunicationsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("communications", targetDepth)) { var unmarshaller = new ListUnmarshaller<Communication,CommunicationUnmarshaller>( CommunicationUnmarshaller.GetInstance()); response.Communications = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { response.NextToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeCommunicationsResponse response = new DescribeCommunicationsResponse(); context.Read(); UnmarshallResult(context,response); return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeCommunicationsResponse response = new DescribeCommunicationsResponse(); context.Read(); response.DescribeCommunicationsResult = DescribeCommunicationsResultUnmarshaller.GetInstance().Unmarshall(context); return response; }
private static void UnmarshallResult(JsonUnmarshallerContext context,DescribeCommunicationsResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("communications", targetDepth)) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { response.Communications = null; continue; } response.Communications = new List<Communication>(); CommunicationUnmarshaller unmarshaller = CommunicationUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.Communications.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("nextToken", targetDepth)) { context.Read(); response.NextToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }