public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListPipelinesResponse response = new ListPipelinesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextPageToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextPageToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Pipelines", targetDepth)) { var unmarshaller = new ListUnmarshaller<Pipeline, PipelineUnmarshaller>(PipelineUnmarshaller.Instance); response.Pipelines = unmarshaller.Unmarshall(context); continue; } } return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListPipelinesResponse response = new ListPipelinesResponse(); context.Read(); UnmarshallResult(context,response); return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListPipelinesResponse response = new ListPipelinesResponse(); context.Read(); response.ListPipelinesResult = ListPipelinesResultUnmarshaller.GetInstance().Unmarshall(context); return response; }
private static void UnmarshallResult(JsonUnmarshallerContext context,ListPipelinesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("Pipelines", targetDepth)) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { response.Pipelines = null; continue; } response.Pipelines = new List<Pipeline>(); PipelineUnmarshaller unmarshaller = PipelineUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.Pipelines.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; }