コード例 #1
0
        /// <summary>
        /// <para>Returns descriptions for existing application versions.</para>
        /// </summary>
        ///
        /// <param name="describeApplicationVersionsRequest">Container for the necessary parameters to execute the DescribeApplicationVersions service
        ///           method on AmazonElasticBeanstalk.</param>
        ///
        /// <returns>The response from the DescribeApplicationVersions service method, as returned by AmazonElasticBeanstalk.</returns>
        ///
        public DescribeApplicationVersionsResponse DescribeApplicationVersions(DescribeApplicationVersionsRequest describeApplicationVersionsRequest)
        {
            IRequest <DescribeApplicationVersionsRequest> request  = new DescribeApplicationVersionsRequestMarshaller().Marshall(describeApplicationVersionsRequest);
            DescribeApplicationVersionsResponse           response = Invoke <DescribeApplicationVersionsRequest, DescribeApplicationVersionsResponse> (request, this.signer, DescribeApplicationVersionsResponseUnmarshaller.GetInstance());

            return(response);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeApplicationVersionsResponse response)
        {
            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("ApplicationVersions/member", targetDepth))
                    {
                        var unmarshaller = ApplicationVersionDescriptionUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.ApplicationVersions.Add(item);
                        continue;
                    }
                }
            }

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

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("DescribeApplicationVersionsResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeApplicationVersionsResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("ApplicationVersions/member", targetDepth))
                    {
                        response.ApplicationVersions.Add(ApplicationVersionDescriptionUnmarshaller.GetInstance().Unmarshall(context));

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



            return;
        }
コード例 #5
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonElasticBeanstalkConfig config = new AmazonElasticBeanstalkConfig();

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

            DescribeApplicationVersionsResponse resp = new DescribeApplicationVersionsResponse();
            DescribeApplicationVersionsRequest  req  = new DescribeApplicationVersionsRequest
            {
            };

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

            foreach (var obj in resp.ApplicationVersions)
            {
                AddObject(obj);
            }
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeApplicationVersionsResponse response = new DescribeApplicationVersionsResponse();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("DescribeApplicationVersionsResult", 2))
                    {
                        response.DescribeApplicationVersionsResult = DescribeApplicationVersionsResultUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
            }


            return(response);
        }