public static VpcAttachmentUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new VpcAttachmentUnmarshaller();
            }

            return(instance);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            AttachVpnGatewayResponse response = new AttachVpnGatewayResponse();

            int targetDepth = 2;

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("attachment", targetDepth))
                    {
                        response.VpcAttachment = VpcAttachmentUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
            }


            return(response);
        }
Ejemplo n.º 3
0
        public VpnGateway Unmarshall(XmlUnmarshallerContext context)
        {
            VpnGateway vpnGateway    = new VpnGateway();
            int        originalDepth = context.CurrentDepth;
            int        targetDepth   = originalDepth + 1;

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

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

                        continue;
                    }
                    if (context.TestExpression("state", targetDepth))
                    {
                        vpnGateway.State = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("type", targetDepth))
                    {
                        vpnGateway.Type = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("attachments/item", targetDepth))
                    {
                        vpnGateway.VpcAttachments.Add(VpcAttachmentUnmarshaller.GetInstance().Unmarshall(context));

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

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



            return(vpnGateway);
        }