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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("entityAggregates", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <EntityAggregate, EntityAggregateUnmarshaller>(EntityAggregateUnmarshaller.Instance);
                    response.EntityAggregates = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

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

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

            DescribeEntityAggregatesResponse resp = new DescribeEntityAggregatesResponse();
            DescribeEntityAggregatesRequest  req  = new DescribeEntityAggregatesRequest
            {
            };

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

            foreach (var obj in resp.EntityAggregates)
            {
                AddObject(obj);
            }
        }