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; }