/// <summary>
        /// <para>Returns the descriptions of existing applications.</para>
        /// </summary>
        ///
        /// <param name="describeApplicationsRequest">Container for the necessary parameters to execute the DescribeApplications service method on
        ///           AmazonElasticBeanstalk.</param>
        ///
        /// <returns>The response from the DescribeApplications service method, as returned by AmazonElasticBeanstalk.</returns>
        ///
        public DescribeApplicationsResponse DescribeApplications(DescribeApplicationsRequest describeApplicationsRequest)
        {
            IRequest <DescribeApplicationsRequest> request  = new DescribeApplicationsRequestMarshaller().Marshall(describeApplicationsRequest);
            DescribeApplicationsResponse           response = Invoke <DescribeApplicationsRequest, DescribeApplicationsResponse> (request, this.signer, DescribeApplicationsResponseUnmarshaller.GetInstance());

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

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

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

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

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

            return(response);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeApplicationsResponse response = new DescribeApplicationsResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Applications", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <Application, ApplicationUnmarshaller>(ApplicationUnmarshaller.Instance);
                    response.Applications = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("NextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeApplicationsResponse 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("Applications/member", targetDepth))
                    {
                        response.Applications.Add(ApplicationDescriptionUnmarshaller.GetInstance().Unmarshall(context));

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



            return;
        }
Ejemplo n.º 6
0
        public void CRUDApplication()
        {
            string applicationName = "dotnet-integ-app" + DateTime.Now.Ticks;
            CreateApplicationRequest createRequest = new CreateApplicationRequest()
            {
                ApplicationName = applicationName,
                Description     = "Test Application"
            };

            CreateApplicationResponse createResponse = Client.CreateApplication(createRequest);

            Assert.IsNotNull(createResponse.ResponseMetadata.RequestId);

            try
            {
                DescribeApplicationsResponse describeResponse = Client.DescribeApplications(new DescribeApplicationsRequest()
                {
                    ApplicationNames = new List <string>()
                    {
                        applicationName
                    }
                });
                Assert.AreEqual(1, describeResponse.Applications.Count);
                ApplicationDescription app = describeResponse.Applications[0];
                Assert.AreEqual(applicationName, app.ApplicationName);
                Assert.AreEqual("Test Application", app.Description);
                Assert.AreNotEqual(DateTime.MinValue, app.DateCreated);
                Assert.AreNotEqual(DateTime.MinValue, app.DateUpdated);

                UpdateApplicationRequest updateRequest = new UpdateApplicationRequest()
                {
                    ApplicationName = applicationName,
                    Description     = "updated description"
                };
                UpdateApplicationResponse updateResponse = Client.UpdateApplication(updateRequest);
                Assert.AreEqual(applicationName, updateResponse.Application.ApplicationName);
                Assert.AreEqual("updated description", updateResponse.Application.Description);
            }
            finally
            {
                Client.DeleteApplication(new DeleteApplicationRequest()
                {
                    ApplicationName = applicationName
                });
            }
        }
        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);

            DescribeApplicationsResponse resp = new DescribeApplicationsResponse();
            DescribeApplicationsRequest  req  = new DescribeApplicationsRequest
            {
            };

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

            foreach (var obj in resp.Applications)
            {
                AddObject(obj);
            }
        }
Ejemplo n.º 8
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeApplicationsResponse response = new DescribeApplicationsResponse();

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


            return(response);
        }