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);

            DescribeEventsForOrganizationResponse resp = new DescribeEventsForOrganizationResponse();

            do
            {
                DescribeEventsForOrganizationRequest req = new DescribeEventsForOrganizationRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.Events)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Returns information about events across your organization in AWS Organizations, meeting
        /// the specified filter criteria. Events are returned in a summary form and do not include
        /// the accounts impacted, detailed description, any additional metadata that depends
        /// on the event type, or any affected resources. To retrieve that information, use the
        /// <a>DescribeAffectedAccountsForOrganization</a>, <a>DescribeEventDetailsForOrganization</a>,
        /// and <a>DescribeAffectedEntitiesForOrganization</a> operations.
        ///
        ///
        /// <para>
        /// If no filter criteria are specified, all events across your organization are returned.
        /// Results are sorted by <code>lastModifiedTime</code>, starting with the most recent.
        /// </para>
        ///
        /// <para>
        /// Before you can call this operation, you must first enable Health to work with AWS
        /// Organizations. To do this, call the <a>EnableHealthServiceAccessForOrganization</a>
        /// operation from your organization's master account.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeEventsForOrganization service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the DescribeEventsForOrganization service method, as returned by AWSHealth.</returns>
        /// <exception cref="Amazon.AWSHealth.Model.InvalidPaginationTokenException">
        /// The specified pagination token (<code>nextToken</code>) is not valid.
        /// </exception>
        /// <exception cref="Amazon.AWSHealth.Model.UnsupportedLocaleException">
        /// The specified locale is not supported.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/health-2016-08-04/DescribeEventsForOrganization">REST API Reference for DescribeEventsForOrganization Operation</seealso>
        public virtual Task <DescribeEventsForOrganizationResponse> DescribeEventsForOrganizationAsync(DescribeEventsForOrganizationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeEventsForOrganizationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeEventsForOrganizationResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeEventsForOrganizationResponse>(request, options, cancellationToken));
        }
        internal virtual DescribeEventsForOrganizationResponse DescribeEventsForOrganization(DescribeEventsForOrganizationRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeEventsForOrganizationRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeEventsForOrganizationResponseUnmarshaller.Instance;

            return(Invoke <DescribeEventsForOrganizationResponse>(request, options));
        }