public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { QueryObjectsResponse response = new QueryObjectsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("hasMoreResults", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.HasMoreResults = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ids", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.Ids = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("marker", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Marker = unmarshaller.Unmarshall(context); continue; } } return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { QueryObjectsResponse response = new QueryObjectsResponse(); context.Read(); UnmarshallResult(context,response); return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { QueryObjectsResponse response = new QueryObjectsResponse(); context.Read(); response.QueryObjectsResult = QueryObjectsResultUnmarshaller.GetInstance().Unmarshall(context); return response; }
private static void UnmarshallResult(JsonUnmarshallerContext context,QueryObjectsResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("ids", targetDepth)) { context.Read(); response.Ids = new List<String>(); StringUnmarshaller unmarshaller = StringUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.Ids.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("marker", targetDepth)) { context.Read(); response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("hasMoreResults", targetDepth)) { context.Read(); response.HasMoreResults = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }