Example #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, RegisterInstancesWithLoadBalancerResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Instances/member", targetDepth))
                    {
                        response.Instances.Add(InstanceUnmarshaller.GetInstance().Unmarshall(context));

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



            return;
        }
Example #2
0
        public DeregisterInstancesFromLoadBalancerResult Unmarshall(XmlUnmarshallerContext context)
        {
            DeregisterInstancesFromLoadBalancerResult deregisterInstancesFromLoadBalancerResult = new DeregisterInstancesFromLoadBalancerResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Instances/member", targetDepth))
                    {
                        deregisterInstancesFromLoadBalancerResult.Instances.Add(InstanceUnmarshaller.GetInstance().Unmarshall(context));

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



            return(deregisterInstancesFromLoadBalancerResult);
        }
Example #3
0
        public static InstanceUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new InstanceUnmarshaller();
            }

            return(instance);
        }
Example #4
0
        public LoadBalancerDescription Unmarshall(XmlUnmarshallerContext context)
        {
            LoadBalancerDescription loadBalancerDescription = new LoadBalancerDescription();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("LoadBalancerName", targetDepth))
                    {
                        loadBalancerDescription.LoadBalancerName = StringUnmarshaller.GetInstance().Unmarshall(context);

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

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

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

                        continue;
                    }
                    if (context.TestExpression("ListenerDescriptions/member", targetDepth))
                    {
                        loadBalancerDescription.ListenerDescriptions.Add(ListenerDescriptionUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("Policies", targetDepth))
                    {
                        loadBalancerDescription.Policies = PoliciesUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("BackendServerDescriptions/member", targetDepth))
                    {
                        loadBalancerDescription.BackendServerDescriptions.Add(BackendServerDescriptionUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("AvailabilityZones/member", targetDepth))
                    {
                        loadBalancerDescription.AvailabilityZones.Add(StringUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("Subnets/member", targetDepth))
                    {
                        loadBalancerDescription.Subnets.Add(StringUnmarshaller.GetInstance().Unmarshall(context));

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

                        continue;
                    }
                    if (context.TestExpression("Instances/member", targetDepth))
                    {
                        loadBalancerDescription.Instances.Add(InstanceUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("HealthCheck", targetDepth))
                    {
                        loadBalancerDescription.HealthCheck = HealthCheckUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SourceSecurityGroup", targetDepth))
                    {
                        loadBalancerDescription.SourceSecurityGroup = SourceSecurityGroupUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SecurityGroups/member", targetDepth))
                    {
                        loadBalancerDescription.SecurityGroups.Add(StringUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("CreatedTime", targetDepth))
                    {
                        loadBalancerDescription.CreatedTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

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



            return(loadBalancerDescription);
        }