public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListJobsResponse response = new ListJobsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("JobList", targetDepth)) { var unmarshaller = new ListUnmarshaller<GlacierJobDescription,GlacierJobDescriptionUnmarshaller>( GlacierJobDescriptionUnmarshaller.GetInstance()); response.JobList = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Marker", targetDepth)) { response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListJobsResponse response = new ListJobsResponse(); context.Read(); UnmarshallResult(context,response); return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListJobsResponse response = new ListJobsResponse(); context.Read(); response.ListJobsResult = ListJobsResultUnmarshaller.GetInstance().Unmarshall(context); return response; }
private static void UnmarshallResult(JsonUnmarshallerContext context,ListJobsResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("JobList", targetDepth)) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { response.JobList = null; continue; } response.JobList = new List<GlacierJobDescription>(); GlacierJobDescriptionUnmarshaller unmarshaller = GlacierJobDescriptionUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.JobList.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("Marker", targetDepth)) { context.Read(); response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }