public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListPipelinesResponse response = new ListPipelinesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("pipelineIdList", targetDepth)) { var unmarshaller = new ListUnmarshaller <PipelineIdName, PipelineIdNameUnmarshaller>( PipelineIdNameUnmarshaller.GetInstance()); response.PipelineIdList = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("marker", targetDepth)) { response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("hasMoreResults", targetDepth)) { response.HasMoreResults = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } } return(response); }
public static PipelineIdNameUnmarshaller GetInstance() { if (instance == null) { instance = new PipelineIdNameUnmarshaller(); } return(instance); }
public ListPipelinesResult Unmarshall(JsonUnmarshallerContext context) { ListPipelinesResult listPipelinesResult = new ListPipelinesResult(); listPipelinesResult.PipelineIdList = null; int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if ((context.IsKey) && (context.CurrentDepth == targetDepth)) { context.Read(); context.Read(); if (context.TestExpression("PipelineIdList", targetDepth)) { listPipelinesResult.PipelineIdList = new List <PipelineIdName>(); PipelineIdNameUnmarshaller unmarshaller = PipelineIdNameUnmarshaller.GetInstance(); while (context.Read()) { if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth)) { listPipelinesResult.PipelineIdList.Add(unmarshaller.Unmarshall(context)); } else if (context.IsEndArray) { break; } } continue; } if (context.TestExpression("Marker", targetDepth)) { listPipelinesResult.Marker = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("HasMoreResults", targetDepth)) { listPipelinesResult.HasMoreResults = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth <= originalDepth) { return(listPipelinesResult); } } return(listPipelinesResult); }
private static void UnmarshallResult(JsonUnmarshallerContext context, ListPipelinesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("pipelineIdList", targetDepth)) { context.Read(); response.PipelineIdList = new List <PipelineIdName>(); PipelineIdNameUnmarshaller unmarshaller = PipelineIdNameUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.PipelineIdList.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; }