/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeNetworkInterfaceAttributeResponse response = new DescribeNetworkInterfaceAttributeResponse();

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

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

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("attachment", targetDepth))
                    {
                        var unmarshaller = NetworkInterfaceAttachmentUnmarshaller.Instance;
                        response.Attachment = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("description/value", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Description = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("groupSet/item", targetDepth))
                    {
                        var unmarshaller = GroupIdentifierUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.Groups.Add(item);
                        continue;
                    }
                    if (context.TestExpression("networkInterfaceId", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.NetworkInterfaceId = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("sourceDestCheck/value", targetDepth))
                    {
                        var unmarshaller = BoolUnmarshaller.Instance;
                        response.SourceDestCheck = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return(response);
        }
Exemplo n.º 2
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeNetworkInterfaceAttributeResponse response = new DescribeNetworkInterfaceAttributeResponse();

            int targetDepth = 2;

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

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

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

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

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

                        continue;
                    }
                }
            }


            return(response);
        }
Exemplo n.º 3
0
        public static DescribeNetworkInterfaceAttributeResponse Unmarshall(UnmarshallerContext _ctx)
        {
            DescribeNetworkInterfaceAttributeResponse describeNetworkInterfaceAttributeResponse = new DescribeNetworkInterfaceAttributeResponse();

            describeNetworkInterfaceAttributeResponse.HttpResponse       = _ctx.HttpResponse;
            describeNetworkInterfaceAttributeResponse.RequestId          = _ctx.StringValue("DescribeNetworkInterfaceAttribute.RequestId");
            describeNetworkInterfaceAttributeResponse.NetworkInterfaceId = _ctx.StringValue("DescribeNetworkInterfaceAttribute.NetworkInterfaceId");
            describeNetworkInterfaceAttributeResponse.Status             = _ctx.StringValue("DescribeNetworkInterfaceAttribute.Status");
            describeNetworkInterfaceAttributeResponse.Type                 = _ctx.StringValue("DescribeNetworkInterfaceAttribute.Type");
            describeNetworkInterfaceAttributeResponse.VpcId                = _ctx.StringValue("DescribeNetworkInterfaceAttribute.VpcId");
            describeNetworkInterfaceAttributeResponse.VSwitchId            = _ctx.StringValue("DescribeNetworkInterfaceAttribute.VSwitchId");
            describeNetworkInterfaceAttributeResponse.ZoneId               = _ctx.StringValue("DescribeNetworkInterfaceAttribute.ZoneId");
            describeNetworkInterfaceAttributeResponse.PrivateIpAddress     = _ctx.StringValue("DescribeNetworkInterfaceAttribute.PrivateIpAddress");
            describeNetworkInterfaceAttributeResponse.MacAddress           = _ctx.StringValue("DescribeNetworkInterfaceAttribute.MacAddress");
            describeNetworkInterfaceAttributeResponse.NetworkInterfaceName = _ctx.StringValue("DescribeNetworkInterfaceAttribute.NetworkInterfaceName");
            describeNetworkInterfaceAttributeResponse.Description          = _ctx.StringValue("DescribeNetworkInterfaceAttribute.Description");
            describeNetworkInterfaceAttributeResponse.InstanceId           = _ctx.StringValue("DescribeNetworkInterfaceAttribute.InstanceId");
            describeNetworkInterfaceAttributeResponse.CreationTime         = _ctx.StringValue("DescribeNetworkInterfaceAttribute.CreationTime");
            describeNetworkInterfaceAttributeResponse.ResourceGroupId      = _ctx.StringValue("DescribeNetworkInterfaceAttribute.ResourceGroupId");
            describeNetworkInterfaceAttributeResponse.ServiceID            = _ctx.LongValue("DescribeNetworkInterfaceAttribute.ServiceID");
            describeNetworkInterfaceAttributeResponse.ServiceManaged       = _ctx.BooleanValue("DescribeNetworkInterfaceAttribute.ServiceManaged");
            describeNetworkInterfaceAttributeResponse.QueueNumber          = _ctx.IntegerValue("DescribeNetworkInterfaceAttribute.QueueNumber");
            describeNetworkInterfaceAttributeResponse.OwnerId              = _ctx.StringValue("DescribeNetworkInterfaceAttribute.OwnerId");

            List <string> describeNetworkInterfaceAttributeResponse_securityGroupIds = new List <string>();

            for (int i = 0; i < _ctx.Length("DescribeNetworkInterfaceAttribute.SecurityGroupIds.Length"); i++)
            {
                describeNetworkInterfaceAttributeResponse_securityGroupIds.Add(_ctx.StringValue("DescribeNetworkInterfaceAttribute.SecurityGroupIds[" + i + "]"));
            }
            describeNetworkInterfaceAttributeResponse.SecurityGroupIds = describeNetworkInterfaceAttributeResponse_securityGroupIds;

            DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_AssociatedPublicIp associatedPublicIp = new DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_AssociatedPublicIp();
            associatedPublicIp.PublicIpAddress = _ctx.StringValue("DescribeNetworkInterfaceAttribute.AssociatedPublicIp.PublicIpAddress");
            associatedPublicIp.AllocationId    = _ctx.StringValue("DescribeNetworkInterfaceAttribute.AssociatedPublicIp.AllocationId");
            describeNetworkInterfaceAttributeResponse.AssociatedPublicIp = associatedPublicIp;

            DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Attachment attachment = new DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Attachment();
            attachment.InstanceId = _ctx.StringValue("DescribeNetworkInterfaceAttribute.Attachment.InstanceId");
            attachment.TrunkNetworkInterfaceId = _ctx.StringValue("DescribeNetworkInterfaceAttribute.Attachment.TrunkNetworkInterfaceId");
            attachment.DeviceIndex             = _ctx.IntegerValue("DescribeNetworkInterfaceAttribute.Attachment.DeviceIndex");

            List <string> attachment_memberNetworkInterfaceIds = new List <string>();

            for (int i = 0; i < _ctx.Length("DescribeNetworkInterfaceAttribute.Attachment.MemberNetworkInterfaceIds.Length"); i++)
            {
                attachment_memberNetworkInterfaceIds.Add(_ctx.StringValue("DescribeNetworkInterfaceAttribute.Attachment.MemberNetworkInterfaceIds[" + i + "]"));
            }
            attachment.MemberNetworkInterfaceIds = attachment_memberNetworkInterfaceIds;
            describeNetworkInterfaceAttributeResponse.Attachment = attachment;

            List <DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_PrivateIpSet> describeNetworkInterfaceAttributeResponse_privateIpSets = new List <DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_PrivateIpSet>();

            for (int i = 0; i < _ctx.Length("DescribeNetworkInterfaceAttribute.PrivateIpSets.Length"); i++)
            {
                DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_PrivateIpSet privateIpSet = new DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_PrivateIpSet();
                privateIpSet.PrivateIpAddress = _ctx.StringValue("DescribeNetworkInterfaceAttribute.PrivateIpSets[" + i + "].PrivateIpAddress");
                privateIpSet.Primary          = _ctx.BooleanValue("DescribeNetworkInterfaceAttribute.PrivateIpSets[" + i + "].Primary");

                DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_PrivateIpSet.DescribeNetworkInterfaceAttribute_AssociatedPublicIp1 associatedPublicIp1 = new DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_PrivateIpSet.DescribeNetworkInterfaceAttribute_AssociatedPublicIp1();
                associatedPublicIp1.PublicIpAddress = _ctx.StringValue("DescribeNetworkInterfaceAttribute.PrivateIpSets[" + i + "].AssociatedPublicIp.PublicIpAddress");
                associatedPublicIp1.AllocationId    = _ctx.StringValue("DescribeNetworkInterfaceAttribute.PrivateIpSets[" + i + "].AssociatedPublicIp.AllocationId");
                privateIpSet.AssociatedPublicIp1    = associatedPublicIp1;

                describeNetworkInterfaceAttributeResponse_privateIpSets.Add(privateIpSet);
            }
            describeNetworkInterfaceAttributeResponse.PrivateIpSets = describeNetworkInterfaceAttributeResponse_privateIpSets;

            List <DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Ipv6Set> describeNetworkInterfaceAttributeResponse_ipv6Sets = new List <DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Ipv6Set>();

            for (int i = 0; i < _ctx.Length("DescribeNetworkInterfaceAttribute.Ipv6Sets.Length"); i++)
            {
                DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Ipv6Set ipv6Set = new DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Ipv6Set();
                ipv6Set.Ipv6Address = _ctx.StringValue("DescribeNetworkInterfaceAttribute.Ipv6Sets[" + i + "].Ipv6Address");

                describeNetworkInterfaceAttributeResponse_ipv6Sets.Add(ipv6Set);
            }
            describeNetworkInterfaceAttributeResponse.Ipv6Sets = describeNetworkInterfaceAttributeResponse_ipv6Sets;

            List <DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Tag> describeNetworkInterfaceAttributeResponse_tags = new List <DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Tag>();

            for (int i = 0; i < _ctx.Length("DescribeNetworkInterfaceAttribute.Tags.Length"); i++)
            {
                DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Tag tag = new DescribeNetworkInterfaceAttributeResponse.DescribeNetworkInterfaceAttribute_Tag();
                tag.TagKey   = _ctx.StringValue("DescribeNetworkInterfaceAttribute.Tags[" + i + "].TagKey");
                tag.TagValue = _ctx.StringValue("DescribeNetworkInterfaceAttribute.Tags[" + i + "].TagValue");

                describeNetworkInterfaceAttributeResponse_tags.Add(tag);
            }
            describeNetworkInterfaceAttributeResponse.Tags = describeNetworkInterfaceAttributeResponse_tags;

            return(describeNetworkInterfaceAttributeResponse);
        }