private static void UnmarshallResult(JsonUnmarshallerContext context, DescribeTimeBasedAutoScalingResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("TimeBasedAutoScalingConfigurations", targetDepth)) { context.Read(); response.TimeBasedAutoScalingConfigurations = new List <TimeBasedAutoScalingConfiguration>(); TimeBasedAutoScalingConfigurationUnmarshaller unmarshaller = TimeBasedAutoScalingConfigurationUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.TimeBasedAutoScalingConfigurations.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }
public DescribeTimeBasedAutoScalingResult Unmarshall(JsonUnmarshallerContext context) { DescribeTimeBasedAutoScalingResult describeTimeBasedAutoScalingResult = new DescribeTimeBasedAutoScalingResult(); describeTimeBasedAutoScalingResult.TimeBasedAutoScalingConfigurations = 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("TimeBasedAutoScalingConfigurations", targetDepth)) { describeTimeBasedAutoScalingResult.TimeBasedAutoScalingConfigurations = new List <TimeBasedAutoScalingConfiguration>(); TimeBasedAutoScalingConfigurationUnmarshaller unmarshaller = TimeBasedAutoScalingConfigurationUnmarshaller.GetInstance(); while (context.Read()) { if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth)) { describeTimeBasedAutoScalingResult.TimeBasedAutoScalingConfigurations.Add(unmarshaller.Unmarshall(context)); } else if (context.IsEndArray) { break; } } continue; } } else if (context.IsEndElement && context.CurrentDepth <= originalDepth) { return(describeTimeBasedAutoScalingResult); } } return(describeTimeBasedAutoScalingResult); }