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

            return(instance);
        }
Пример #2
0
        public NetworkInterface Unmarshall(XmlUnmarshallerContext context)
        {
            NetworkInterface networkInterface = new NetworkInterface();
            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))
                    {
                        networkInterface.NetworkInterfaceId = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("vpcId", targetDepth))
                    {
                        networkInterface.VpcId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("availabilityZone", targetDepth))
                    {
                        networkInterface.AvailabilityZone = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("ownerId", targetDepth))
                    {
                        networkInterface.OwnerId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("requesterId", targetDepth))
                    {
                        networkInterface.RequesterId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("requesterManaged", targetDepth))
                    {
                        networkInterface.RequesterManaged = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("status", targetDepth))
                    {
                        networkInterface.Status = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("macAddress", targetDepth))
                    {
                        networkInterface.MacAddress = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("privateDnsName", targetDepth))
                    {
                        networkInterface.PrivateDnsName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("sourceDestCheck", targetDepth))
                    {
                        networkInterface.SourceDestCheck = BoolUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("attachment", targetDepth))
                    {
                        networkInterface.Attachment = NetworkInterfaceAttachmentUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("association", targetDepth))
                    {
                        networkInterface.Association = NetworkInterfaceAssociationUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("tagSet/item", targetDepth))
                    {
                        networkInterface.TagSet.Add(TagUnmarshaller.GetInstance().Unmarshall(context));

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

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



            return(networkInterface);
        }