public WorkflowExecutionInfos Unmarshall(JsonUnmarshallerContext context) { if (context.CurrentTokenType == JsonToken.Null) { return(null); } WorkflowExecutionInfos workflowExecutionInfos = new WorkflowExecutionInfos(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("executionInfos", targetDepth)) { context.Read(); workflowExecutionInfos.ExecutionInfos = new List <WorkflowExecutionInfo>(); WorkflowExecutionInfoUnmarshaller unmarshaller = WorkflowExecutionInfoUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } workflowExecutionInfos.ExecutionInfos.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("nextPageToken", targetDepth)) { context.Read(); workflowExecutionInfos.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return(workflowExecutionInfos); } } return(workflowExecutionInfos); }
public WorkflowExecutionInfos Unmarshall(JsonUnmarshallerContext context) { WorkflowExecutionInfos workflowExecutionInfos = new WorkflowExecutionInfos(); workflowExecutionInfos.ExecutionInfos = 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("ExecutionInfos", targetDepth)) { workflowExecutionInfos.ExecutionInfos = new List <WorkflowExecutionInfo>(); WorkflowExecutionInfoUnmarshaller unmarshaller = WorkflowExecutionInfoUnmarshaller.GetInstance(); while (context.Read()) { if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth)) { workflowExecutionInfos.ExecutionInfos.Add(unmarshaller.Unmarshall(context)); } else if (context.IsEndArray) { break; } } continue; } if (context.TestExpression("NextPageToken", targetDepth)) { workflowExecutionInfos.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth <= originalDepth) { return(workflowExecutionInfos); } } return(workflowExecutionInfos); }