Пример #1
0
        public static PrivateIpAddressSpecificationUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new PrivateIpAddressSpecificationUnmarshaller();
            }

            return(instance);
        }
Пример #2
0
        public InstanceNetworkInterfaceSpecification Unmarshall(XmlUnmarshallerContext context)
        {
            InstanceNetworkInterfaceSpecification instanceNetworkInterfaceSpecification = new InstanceNetworkInterfaceSpecification();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("deviceIndex", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.DeviceIndex = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("subnetId", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.SubnetId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("description", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.Description = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("privateIpAddress", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.PrivateIpAddress = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("groupSet/item/groupId", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.Groups.Add(StringUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("deleteOnTermination", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.DeleteOnTermination = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("privateIpAddressesSet/item", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.PrivateIpAddresses.Add(PrivateIpAddressSpecificationUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("secondaryPrivateIpAddressCount", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.SecondaryPrivateIpAddressCount = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("associatePublicIpAddress", targetDepth))
                    {
                        instanceNetworkInterfaceSpecification.AssociatePublicIpAddress = BoolUnmarshaller.GetInstance().Unmarshall(context);

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



            return(instanceNetworkInterfaceSpecification);
        }