public TerminateInstanceInAutoScalingGroupResult Unmarshall(UnmarshallerContext context)
        {
            TerminateInstanceInAutoScalingGroupResult terminateInstanceInAutoScalingGroupResult = new TerminateInstanceInAutoScalingGroupResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Activity", targetDepth))
                    {
                        terminateInstanceInAutoScalingGroupResult.Activity = ActivityUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(terminateInstanceInAutoScalingGroupResult);
                }
            }

            return(terminateInstanceInAutoScalingGroupResult);
        }
Ejemplo n.º 2
0
        public DescribeScalingActivitiesResult Unmarshall(UnmarshallerContext context)
        {
            DescribeScalingActivitiesResult describeScalingActivitiesResult = new DescribeScalingActivitiesResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Activities/member", targetDepth))
                    {
                        describeScalingActivitiesResult.Activities.Add(ActivityUnmarshaller.GetInstance().Unmarshall(context));

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

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(describeScalingActivitiesResult);
                }
            }

            return(describeScalingActivitiesResult);
        }