예제 #1
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeNotificationConfigurationsResponse response = new DescribeNotificationConfigurationsResponse();

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

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

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

            return(response);
        }
예제 #2
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeNotificationConfigurationsResponse 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("NextToken", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.NextToken = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("NotificationConfigurations/member", targetDepth))
                    {
                        var unmarshaller = NotificationConfigurationUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.NotificationConfigurations.Add(item);
                        continue;
                    }
                }
            }

            return;
        }
        /// <summary>
        /// <para> Returns a list of notification actions associated with Auto Scaling groups for specified events. </para>
        /// </summary>
        ///
        /// <param name="describeNotificationConfigurationsRequest">Container for the necessary parameters to execute the
        ///           DescribeNotificationConfigurations service method on AmazonAutoScaling.</param>
        ///
        /// <returns>The response from the DescribeNotificationConfigurations service method, as returned by AmazonAutoScaling.</returns>
        ///
        /// <exception cref="InvalidNextTokenException"/>
        public DescribeNotificationConfigurationsResponse DescribeNotificationConfigurations(DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest)
        {
            IRequest <DescribeNotificationConfigurationsRequest> request  = new DescribeNotificationConfigurationsRequestMarshaller().Marshall(describeNotificationConfigurationsRequest);
            DescribeNotificationConfigurationsResponse           response = Invoke <DescribeNotificationConfigurationsRequest, DescribeNotificationConfigurationsResponse> (request, this.signer, DescribeNotificationConfigurationsResponseUnmarshaller.GetInstance());

            return(response);
        }
        public static DescribeNotificationConfigurationsResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeNotificationConfigurationsResponse describeNotificationConfigurationsResponse = new DescribeNotificationConfigurationsResponse();

            describeNotificationConfigurationsResponse.HttpResponse = context.HttpResponse;
            describeNotificationConfigurationsResponse.RequestId    = context.StringValue("DescribeNotificationConfigurations.RequestId");

            List <DescribeNotificationConfigurationsResponse.DescribeNotificationConfigurations_NotificationConfigurationModel> describeNotificationConfigurationsResponse_notificationConfigurationModels = new List <DescribeNotificationConfigurationsResponse.DescribeNotificationConfigurations_NotificationConfigurationModel>();

            for (int i = 0; i < context.Length("DescribeNotificationConfigurations.NotificationConfigurationModels.Length"); i++)
            {
                DescribeNotificationConfigurationsResponse.DescribeNotificationConfigurations_NotificationConfigurationModel notificationConfigurationModel = new DescribeNotificationConfigurationsResponse.DescribeNotificationConfigurations_NotificationConfigurationModel();
                notificationConfigurationModel.ScalingGroupId  = context.StringValue("DescribeNotificationConfigurations.NotificationConfigurationModels[" + i + "].ScalingGroupId");
                notificationConfigurationModel.NotificationArn = context.StringValue("DescribeNotificationConfigurations.NotificationConfigurationModels[" + i + "].NotificationArn");

                List <string> notificationConfigurationModel_notificationTypes = new List <string>();
                for (int j = 0; j < context.Length("DescribeNotificationConfigurations.NotificationConfigurationModels[" + i + "].NotificationTypes.Length"); j++)
                {
                    notificationConfigurationModel_notificationTypes.Add(context.StringValue("DescribeNotificationConfigurations.NotificationConfigurationModels[" + i + "].NotificationTypes[" + j + "]"));
                }
                notificationConfigurationModel.NotificationTypes = notificationConfigurationModel_notificationTypes;

                describeNotificationConfigurationsResponse_notificationConfigurationModels.Add(notificationConfigurationModel);
            }
            describeNotificationConfigurationsResponse.NotificationConfigurationModels = describeNotificationConfigurationsResponse_notificationConfigurationModels;

            return(describeNotificationConfigurationsResponse);
        }
예제 #5
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonAutoScalingConfig config = new AmazonAutoScalingConfig();

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

            DescribeNotificationConfigurationsResponse resp = new DescribeNotificationConfigurationsResponse();

            do
            {
                DescribeNotificationConfigurationsRequest req = new DescribeNotificationConfigurationsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxRecords = maxItems
                };

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

                foreach (var obj in resp.NotificationConfigurations)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeNotificationConfigurationsResponse response = new DescribeNotificationConfigurationsResponse();

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


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

                        continue;
                    }
                    if (context.TestExpression("NextToken", targetDepth))
                    {
                        response.NextToken = StringUnmarshaller.GetInstance().Unmarshall(context);

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



            return;
        }