public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListJobsByPipelineResponse response = new ListJobsByPipelineResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Jobs", targetDepth)) { var unmarshaller = new ListUnmarshaller <Job, JobUnmarshaller>( JobUnmarshaller.GetInstance()); response.Jobs = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextPageToken", targetDepth)) { response.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } return(response); }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListJobsByPipelineResponse response = new ListJobsByPipelineResponse(); context.Read(); UnmarshallResult(context, response); return(response); }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListJobsByPipelineResponse response = new ListJobsByPipelineResponse(); context.Read(); response.ListJobsByPipelineResult = ListJobsByPipelineResultUnmarshaller.GetInstance().Unmarshall(context); return(response); }
private static void UnmarshallResult(JsonUnmarshallerContext context, ListJobsByPipelineResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("Jobs", targetDepth)) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { response.Jobs = null; continue; } response.Jobs = new List <Job>(); JobUnmarshaller unmarshaller = JobUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.Jobs.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("NextPageToken", targetDepth)) { context.Read(); response.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }