public TimeBasedAutoScalingConfiguration Unmarshall(JsonUnmarshallerContext context)
        {
            TimeBasedAutoScalingConfiguration timeBasedAutoScalingConfiguration = new TimeBasedAutoScalingConfiguration();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("InstanceId", targetDepth))
                    {
                        timeBasedAutoScalingConfiguration.InstanceId = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("AutoScalingSchedule", targetDepth))
                    {
                        timeBasedAutoScalingConfiguration.AutoScalingSchedule = WeeklyAutoScalingScheduleUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(timeBasedAutoScalingConfiguration);
                }
            }


            return(timeBasedAutoScalingConfiguration);
        }
        public TimeBasedAutoScalingConfiguration Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            TimeBasedAutoScalingConfiguration timeBasedAutoScalingConfiguration = new TimeBasedAutoScalingConfiguration();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("InstanceId", targetDepth))
                {
                    timeBasedAutoScalingConfiguration.InstanceId = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("AutoScalingSchedule", targetDepth))
                {
                    timeBasedAutoScalingConfiguration.AutoScalingSchedule = WeeklyAutoScalingScheduleUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(timeBasedAutoScalingConfiguration);
        }
Beispiel #3
0
 public static WeeklyAutoScalingScheduleUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new WeeklyAutoScalingScheduleUnmarshaller();
     }
     return(instance);
 }