public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeCustomerGatewaysResponse response = new DescribeCustomerGatewaysResponse();

            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("customerGatewaySet/item", targetDepth))
                    {
                        var unmarshaller = CustomerGatewayUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.CustomerGateways.Add(item);
                        continue;
                    }
                }
            }

            return(response);
        }
Пример #2
0
        public static DescribeCustomerGatewaysResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeCustomerGatewaysResponse describeCustomerGatewaysResponse = new DescribeCustomerGatewaysResponse();

            describeCustomerGatewaysResponse.HttpResponse = context.HttpResponse;
            describeCustomerGatewaysResponse.RequestId    = context.StringValue("DescribeCustomerGateways.RequestId");
            describeCustomerGatewaysResponse.TotalCount   = context.IntegerValue("DescribeCustomerGateways.TotalCount");
            describeCustomerGatewaysResponse.PageNumber   = context.IntegerValue("DescribeCustomerGateways.PageNumber");
            describeCustomerGatewaysResponse.PageSize     = context.IntegerValue("DescribeCustomerGateways.PageSize");

            List <DescribeCustomerGatewaysResponse.DescribeCustomerGateways_CustomerGateway> describeCustomerGatewaysResponse_customerGateways = new List <DescribeCustomerGatewaysResponse.DescribeCustomerGateways_CustomerGateway>();

            for (int i = 0; i < context.Length("DescribeCustomerGateways.CustomerGateways.Length"); i++)
            {
                DescribeCustomerGatewaysResponse.DescribeCustomerGateways_CustomerGateway customerGateway = new DescribeCustomerGatewaysResponse.DescribeCustomerGateways_CustomerGateway();
                customerGateway.CustomerGatewayId = context.StringValue("DescribeCustomerGateways.CustomerGateways[" + i + "].CustomerGatewayId");
                customerGateway.Name        = context.StringValue("DescribeCustomerGateways.CustomerGateways[" + i + "].Name");
                customerGateway.IpAddress   = context.StringValue("DescribeCustomerGateways.CustomerGateways[" + i + "].IpAddress");
                customerGateway.Description = context.StringValue("DescribeCustomerGateways.CustomerGateways[" + i + "].Description");
                customerGateway.CreateTime  = context.LongValue("DescribeCustomerGateways.CustomerGateways[" + i + "].CreateTime");

                describeCustomerGatewaysResponse_customerGateways.Add(customerGateway);
            }
            describeCustomerGatewaysResponse.CustomerGateways = describeCustomerGatewaysResponse_customerGateways;

            return(describeCustomerGatewaysResponse);
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonEC2Config config = new AmazonEC2Config();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonEC2Client client = new AmazonEC2Client(creds, config);

            DescribeCustomerGatewaysResponse resp = new DescribeCustomerGatewaysResponse();
            DescribeCustomerGatewaysRequest  req  = new DescribeCustomerGatewaysRequest
            {
            };

            resp = client.DescribeCustomerGateways(req);
            CheckError(resp.HttpStatusCode, "200");

            foreach (var obj in resp.CustomerGateways)
            {
                AddObject(obj);
            }
        }
Пример #4
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeCustomerGatewaysResponse response = new DescribeCustomerGatewaysResponse();

            int targetDepth = 2;

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("customerGatewaySet/item", targetDepth))
                    {
                        response.CustomerGateways.Add(CustomerGatewayUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                }
            }


            return(response);
        }