The date and time range for the timestamp field. If "from" is set and "to" is set: match records where the timestmp between "from" and "to" inclusive. If "from" is set and "to" is not set: match records which the timestamp value after is equal or after "from". If "from" is not set and "to" is set: match records where the timestamp value is equal or before "to".
        public object Execute(ExecutorContext context)
        {
            var cmdletContext      = context as CmdletContext;
            var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent;

            // create request and set iteration invariants
            var request = new Amazon.AWSHealth.Model.DescribeEventsForOrganizationRequest();

            // populate Filter
            var requestFilterIsNull = true;

            request.Filter = new Amazon.AWSHealth.Model.OrganizationEventFilter();
            List <System.String> requestFilter_filter_AwsAccountId = null;

            if (cmdletContext.Filter_AwsAccountId != null)
            {
                requestFilter_filter_AwsAccountId = cmdletContext.Filter_AwsAccountId;
            }
            if (requestFilter_filter_AwsAccountId != null)
            {
                request.Filter.AwsAccountIds = requestFilter_filter_AwsAccountId;
                requestFilterIsNull          = false;
            }
            List <System.String> requestFilter_filter_EntityArn = null;

            if (cmdletContext.Filter_EntityArn != null)
            {
                requestFilter_filter_EntityArn = cmdletContext.Filter_EntityArn;
            }
            if (requestFilter_filter_EntityArn != null)
            {
                request.Filter.EntityArns = requestFilter_filter_EntityArn;
                requestFilterIsNull       = false;
            }
            List <System.String> requestFilter_filter_EntityValue = null;

            if (cmdletContext.Filter_EntityValue != null)
            {
                requestFilter_filter_EntityValue = cmdletContext.Filter_EntityValue;
            }
            if (requestFilter_filter_EntityValue != null)
            {
                request.Filter.EntityValues = requestFilter_filter_EntityValue;
                requestFilterIsNull         = false;
            }
            List <System.String> requestFilter_filter_EventStatusCode = null;

            if (cmdletContext.Filter_EventStatusCode != null)
            {
                requestFilter_filter_EventStatusCode = cmdletContext.Filter_EventStatusCode;
            }
            if (requestFilter_filter_EventStatusCode != null)
            {
                request.Filter.EventStatusCodes = requestFilter_filter_EventStatusCode;
                requestFilterIsNull             = false;
            }
            List <System.String> requestFilter_filter_EventTypeCategory = null;

            if (cmdletContext.Filter_EventTypeCategory != null)
            {
                requestFilter_filter_EventTypeCategory = cmdletContext.Filter_EventTypeCategory;
            }
            if (requestFilter_filter_EventTypeCategory != null)
            {
                request.Filter.EventTypeCategories = requestFilter_filter_EventTypeCategory;
                requestFilterIsNull = false;
            }
            List <System.String> requestFilter_filter_EventTypeCode = null;

            if (cmdletContext.Filter_EventTypeCode != null)
            {
                requestFilter_filter_EventTypeCode = cmdletContext.Filter_EventTypeCode;
            }
            if (requestFilter_filter_EventTypeCode != null)
            {
                request.Filter.EventTypeCodes = requestFilter_filter_EventTypeCode;
                requestFilterIsNull           = false;
            }
            List <System.String> requestFilter_filter_Region = null;

            if (cmdletContext.Filter_Region != null)
            {
                requestFilter_filter_Region = cmdletContext.Filter_Region;
            }
            if (requestFilter_filter_Region != null)
            {
                request.Filter.Regions = requestFilter_filter_Region;
                requestFilterIsNull    = false;
            }
            List <System.String> requestFilter_filter_Service = null;

            if (cmdletContext.Filter_Service != null)
            {
                requestFilter_filter_Service = cmdletContext.Filter_Service;
            }
            if (requestFilter_filter_Service != null)
            {
                request.Filter.Services = requestFilter_filter_Service;
                requestFilterIsNull     = false;
            }
            Amazon.AWSHealth.Model.DateTimeRange requestFilter_filter_EndTime = null;

            // populate EndTime
            var requestFilter_filter_EndTimeIsNull = true;

            requestFilter_filter_EndTime = new Amazon.AWSHealth.Model.DateTimeRange();
            System.DateTime?requestFilter_filter_EndTime_endTime_From = null;
            if (cmdletContext.EndTime_From != null)
            {
                requestFilter_filter_EndTime_endTime_From = cmdletContext.EndTime_From.Value;
            }
            if (requestFilter_filter_EndTime_endTime_From != null)
            {
                requestFilter_filter_EndTime.From  = requestFilter_filter_EndTime_endTime_From.Value;
                requestFilter_filter_EndTimeIsNull = false;
            }
            System.DateTime?requestFilter_filter_EndTime_endTime_To = null;
            if (cmdletContext.EndTime_To != null)
            {
                requestFilter_filter_EndTime_endTime_To = cmdletContext.EndTime_To.Value;
            }
            if (requestFilter_filter_EndTime_endTime_To != null)
            {
                requestFilter_filter_EndTime.To    = requestFilter_filter_EndTime_endTime_To.Value;
                requestFilter_filter_EndTimeIsNull = false;
            }
            // determine if requestFilter_filter_EndTime should be set to null
            if (requestFilter_filter_EndTimeIsNull)
            {
                requestFilter_filter_EndTime = null;
            }
            if (requestFilter_filter_EndTime != null)
            {
                request.Filter.EndTime = requestFilter_filter_EndTime;
                requestFilterIsNull    = false;
            }
            Amazon.AWSHealth.Model.DateTimeRange requestFilter_filter_LastUpdatedTime = null;

            // populate LastUpdatedTime
            var requestFilter_filter_LastUpdatedTimeIsNull = true;

            requestFilter_filter_LastUpdatedTime = new Amazon.AWSHealth.Model.DateTimeRange();
            System.DateTime?requestFilter_filter_LastUpdatedTime_lastUpdatedTime_From = null;
            if (cmdletContext.LastUpdatedTime_From != null)
            {
                requestFilter_filter_LastUpdatedTime_lastUpdatedTime_From = cmdletContext.LastUpdatedTime_From.Value;
            }
            if (requestFilter_filter_LastUpdatedTime_lastUpdatedTime_From != null)
            {
                requestFilter_filter_LastUpdatedTime.From  = requestFilter_filter_LastUpdatedTime_lastUpdatedTime_From.Value;
                requestFilter_filter_LastUpdatedTimeIsNull = false;
            }
            System.DateTime?requestFilter_filter_LastUpdatedTime_lastUpdatedTime_To = null;
            if (cmdletContext.LastUpdatedTime_To != null)
            {
                requestFilter_filter_LastUpdatedTime_lastUpdatedTime_To = cmdletContext.LastUpdatedTime_To.Value;
            }
            if (requestFilter_filter_LastUpdatedTime_lastUpdatedTime_To != null)
            {
                requestFilter_filter_LastUpdatedTime.To    = requestFilter_filter_LastUpdatedTime_lastUpdatedTime_To.Value;
                requestFilter_filter_LastUpdatedTimeIsNull = false;
            }
            // determine if requestFilter_filter_LastUpdatedTime should be set to null
            if (requestFilter_filter_LastUpdatedTimeIsNull)
            {
                requestFilter_filter_LastUpdatedTime = null;
            }
            if (requestFilter_filter_LastUpdatedTime != null)
            {
                request.Filter.LastUpdatedTime = requestFilter_filter_LastUpdatedTime;
                requestFilterIsNull            = false;
            }
            Amazon.AWSHealth.Model.DateTimeRange requestFilter_filter_StartTime = null;

            // populate StartTime
            var requestFilter_filter_StartTimeIsNull = true;

            requestFilter_filter_StartTime = new Amazon.AWSHealth.Model.DateTimeRange();
            System.DateTime?requestFilter_filter_StartTime_startTime_From = null;
            if (cmdletContext.StartTime_From != null)
            {
                requestFilter_filter_StartTime_startTime_From = cmdletContext.StartTime_From.Value;
            }
            if (requestFilter_filter_StartTime_startTime_From != null)
            {
                requestFilter_filter_StartTime.From  = requestFilter_filter_StartTime_startTime_From.Value;
                requestFilter_filter_StartTimeIsNull = false;
            }
            System.DateTime?requestFilter_filter_StartTime_startTime_To = null;
            if (cmdletContext.StartTime_To != null)
            {
                requestFilter_filter_StartTime_startTime_To = cmdletContext.StartTime_To.Value;
            }
            if (requestFilter_filter_StartTime_startTime_To != null)
            {
                requestFilter_filter_StartTime.To    = requestFilter_filter_StartTime_startTime_To.Value;
                requestFilter_filter_StartTimeIsNull = false;
            }
            // determine if requestFilter_filter_StartTime should be set to null
            if (requestFilter_filter_StartTimeIsNull)
            {
                requestFilter_filter_StartTime = null;
            }
            if (requestFilter_filter_StartTime != null)
            {
                request.Filter.StartTime = requestFilter_filter_StartTime;
                requestFilterIsNull      = false;
            }
            // determine if request.Filter should be set to null
            if (requestFilterIsNull)
            {
                request.Filter = null;
            }
            if (cmdletContext.Locale != null)
            {
                request.Locale = cmdletContext.Locale;
            }

            // Initialize loop variants and commence piping
            System.String _nextToken      = null;
            int?          _emitLimit      = null;
            int           _retrievedSoFar = 0;

            if (AutoIterationHelpers.HasValue(cmdletContext.NextToken))
            {
                _nextToken = cmdletContext.NextToken;
            }
            if (AutoIterationHelpers.HasValue(cmdletContext.MaxResult))
            {
                // The service has a maximum page size of 100. If the user has
                // asked for more items than page max, and there is no page size
                // configured, we rely on the service ignoring the set maximum
                // and giving us 100 items back. If a page size is set, that will
                // be used to configure the pagination.
                // We'll make further calls to satisfy the user's request.
                _emitLimit = cmdletContext.MaxResult;
            }
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            do
            {
                request.NextToken = _nextToken;
                if (_emitLimit.HasValue)
                {
                    int correctPageSize = AutoIterationHelpers.Min(100, _emitLimit.Value);
                    request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToInt32(correctPageSize);
                }

                CmdletOutput output;

                try
                {
                    var    response       = CallAWSServiceOperation(client, request);
                    object pipelineOutput = null;
                    if (!useParameterSelect)
                    {
                        pipelineOutput = cmdletContext.Select(response, this);
                    }
                    output = new CmdletOutput
                    {
                        PipelineOutput  = pipelineOutput,
                        ServiceResponse = response
                    };
                    int _receivedThisCall = response.Events.Count;

                    _nextToken       = response.NextToken;
                    _retrievedSoFar += _receivedThisCall;
                    if (_emitLimit.HasValue)
                    {
                        _emitLimit -= _receivedThisCall;
                    }
                }
                catch (Exception e)
                {
                    if (_retrievedSoFar == 0 || !_emitLimit.HasValue)
                    {
                        output = new CmdletOutput {
                            ErrorResponse = e
                        };
                    }
                    else
                    {
                        break;
                    }
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 10));


            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;

            #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
            var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent;
            #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute

            // create request and set iteration invariants
            var request = new Amazon.AWSHealth.Model.DescribeEventsForOrganizationRequest();


            // populate Filter
            var requestFilterIsNull = true;
            request.Filter = new Amazon.AWSHealth.Model.OrganizationEventFilter();
            List <System.String> requestFilter_filter_AwsAccountId = null;
            if (cmdletContext.Filter_AwsAccountId != null)
            {
                requestFilter_filter_AwsAccountId = cmdletContext.Filter_AwsAccountId;
            }
            if (requestFilter_filter_AwsAccountId != null)
            {
                request.Filter.AwsAccountIds = requestFilter_filter_AwsAccountId;
                requestFilterIsNull          = false;
            }
            List <System.String> requestFilter_filter_EntityArn = null;
            if (cmdletContext.Filter_EntityArn != null)
            {
                requestFilter_filter_EntityArn = cmdletContext.Filter_EntityArn;
            }
            if (requestFilter_filter_EntityArn != null)
            {
                request.Filter.EntityArns = requestFilter_filter_EntityArn;
                requestFilterIsNull       = false;
            }
            List <System.String> requestFilter_filter_EntityValue = null;
            if (cmdletContext.Filter_EntityValue != null)
            {
                requestFilter_filter_EntityValue = cmdletContext.Filter_EntityValue;
            }
            if (requestFilter_filter_EntityValue != null)
            {
                request.Filter.EntityValues = requestFilter_filter_EntityValue;
                requestFilterIsNull         = false;
            }
            List <System.String> requestFilter_filter_EventStatusCode = null;
            if (cmdletContext.Filter_EventStatusCode != null)
            {
                requestFilter_filter_EventStatusCode = cmdletContext.Filter_EventStatusCode;
            }
            if (requestFilter_filter_EventStatusCode != null)
            {
                request.Filter.EventStatusCodes = requestFilter_filter_EventStatusCode;
                requestFilterIsNull             = false;
            }
            List <System.String> requestFilter_filter_EventTypeCategory = null;
            if (cmdletContext.Filter_EventTypeCategory != null)
            {
                requestFilter_filter_EventTypeCategory = cmdletContext.Filter_EventTypeCategory;
            }
            if (requestFilter_filter_EventTypeCategory != null)
            {
                request.Filter.EventTypeCategories = requestFilter_filter_EventTypeCategory;
                requestFilterIsNull = false;
            }
            List <System.String> requestFilter_filter_EventTypeCode = null;
            if (cmdletContext.Filter_EventTypeCode != null)
            {
                requestFilter_filter_EventTypeCode = cmdletContext.Filter_EventTypeCode;
            }
            if (requestFilter_filter_EventTypeCode != null)
            {
                request.Filter.EventTypeCodes = requestFilter_filter_EventTypeCode;
                requestFilterIsNull           = false;
            }
            List <System.String> requestFilter_filter_Region = null;
            if (cmdletContext.Filter_Region != null)
            {
                requestFilter_filter_Region = cmdletContext.Filter_Region;
            }
            if (requestFilter_filter_Region != null)
            {
                request.Filter.Regions = requestFilter_filter_Region;
                requestFilterIsNull    = false;
            }
            List <System.String> requestFilter_filter_Service = null;
            if (cmdletContext.Filter_Service != null)
            {
                requestFilter_filter_Service = cmdletContext.Filter_Service;
            }
            if (requestFilter_filter_Service != null)
            {
                request.Filter.Services = requestFilter_filter_Service;
                requestFilterIsNull     = false;
            }
            Amazon.AWSHealth.Model.DateTimeRange requestFilter_filter_EndTime = null;

            // populate EndTime
            var requestFilter_filter_EndTimeIsNull = true;
            requestFilter_filter_EndTime = new Amazon.AWSHealth.Model.DateTimeRange();
            System.DateTime?requestFilter_filter_EndTime_endTime_From = null;
            if (cmdletContext.EndTime_From != null)
            {
                requestFilter_filter_EndTime_endTime_From = cmdletContext.EndTime_From.Value;
            }
            if (requestFilter_filter_EndTime_endTime_From != null)
            {
                requestFilter_filter_EndTime.From  = requestFilter_filter_EndTime_endTime_From.Value;
                requestFilter_filter_EndTimeIsNull = false;
            }
            System.DateTime?requestFilter_filter_EndTime_endTime_To = null;
            if (cmdletContext.EndTime_To != null)
            {
                requestFilter_filter_EndTime_endTime_To = cmdletContext.EndTime_To.Value;
            }
            if (requestFilter_filter_EndTime_endTime_To != null)
            {
                requestFilter_filter_EndTime.To    = requestFilter_filter_EndTime_endTime_To.Value;
                requestFilter_filter_EndTimeIsNull = false;
            }
            // determine if requestFilter_filter_EndTime should be set to null
            if (requestFilter_filter_EndTimeIsNull)
            {
                requestFilter_filter_EndTime = null;
            }
            if (requestFilter_filter_EndTime != null)
            {
                request.Filter.EndTime = requestFilter_filter_EndTime;
                requestFilterIsNull    = false;
            }
            Amazon.AWSHealth.Model.DateTimeRange requestFilter_filter_LastUpdatedTime = null;

            // populate LastUpdatedTime
            var requestFilter_filter_LastUpdatedTimeIsNull = true;
            requestFilter_filter_LastUpdatedTime = new Amazon.AWSHealth.Model.DateTimeRange();
            System.DateTime?requestFilter_filter_LastUpdatedTime_lastUpdatedTime_From = null;
            if (cmdletContext.LastUpdatedTime_From != null)
            {
                requestFilter_filter_LastUpdatedTime_lastUpdatedTime_From = cmdletContext.LastUpdatedTime_From.Value;
            }
            if (requestFilter_filter_LastUpdatedTime_lastUpdatedTime_From != null)
            {
                requestFilter_filter_LastUpdatedTime.From  = requestFilter_filter_LastUpdatedTime_lastUpdatedTime_From.Value;
                requestFilter_filter_LastUpdatedTimeIsNull = false;
            }
            System.DateTime?requestFilter_filter_LastUpdatedTime_lastUpdatedTime_To = null;
            if (cmdletContext.LastUpdatedTime_To != null)
            {
                requestFilter_filter_LastUpdatedTime_lastUpdatedTime_To = cmdletContext.LastUpdatedTime_To.Value;
            }
            if (requestFilter_filter_LastUpdatedTime_lastUpdatedTime_To != null)
            {
                requestFilter_filter_LastUpdatedTime.To    = requestFilter_filter_LastUpdatedTime_lastUpdatedTime_To.Value;
                requestFilter_filter_LastUpdatedTimeIsNull = false;
            }
            // determine if requestFilter_filter_LastUpdatedTime should be set to null
            if (requestFilter_filter_LastUpdatedTimeIsNull)
            {
                requestFilter_filter_LastUpdatedTime = null;
            }
            if (requestFilter_filter_LastUpdatedTime != null)
            {
                request.Filter.LastUpdatedTime = requestFilter_filter_LastUpdatedTime;
                requestFilterIsNull            = false;
            }
            Amazon.AWSHealth.Model.DateTimeRange requestFilter_filter_StartTime = null;

            // populate StartTime
            var requestFilter_filter_StartTimeIsNull = true;
            requestFilter_filter_StartTime = new Amazon.AWSHealth.Model.DateTimeRange();
            System.DateTime?requestFilter_filter_StartTime_startTime_From = null;
            if (cmdletContext.StartTime_From != null)
            {
                requestFilter_filter_StartTime_startTime_From = cmdletContext.StartTime_From.Value;
            }
            if (requestFilter_filter_StartTime_startTime_From != null)
            {
                requestFilter_filter_StartTime.From  = requestFilter_filter_StartTime_startTime_From.Value;
                requestFilter_filter_StartTimeIsNull = false;
            }
            System.DateTime?requestFilter_filter_StartTime_startTime_To = null;
            if (cmdletContext.StartTime_To != null)
            {
                requestFilter_filter_StartTime_startTime_To = cmdletContext.StartTime_To.Value;
            }
            if (requestFilter_filter_StartTime_startTime_To != null)
            {
                requestFilter_filter_StartTime.To    = requestFilter_filter_StartTime_startTime_To.Value;
                requestFilter_filter_StartTimeIsNull = false;
            }
            // determine if requestFilter_filter_StartTime should be set to null
            if (requestFilter_filter_StartTimeIsNull)
            {
                requestFilter_filter_StartTime = null;
            }
            if (requestFilter_filter_StartTime != null)
            {
                request.Filter.StartTime = requestFilter_filter_StartTime;
                requestFilterIsNull      = false;
            }
            // determine if request.Filter should be set to null
            if (requestFilterIsNull)
            {
                request.Filter = null;
            }
            if (cmdletContext.Locale != null)
            {
                request.Locale = cmdletContext.Locale;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.MaxResult.Value);
            }

            // Initialize loop variant and commence piping
            var _nextToken             = cmdletContext.NextToken;
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
            do
            {
                request.NextToken = _nextToken;

                CmdletOutput output;

                try
                {
                    var response = CallAWSServiceOperation(client, request);

                    object pipelineOutput = null;
                    if (!useParameterSelect)
                    {
                        pipelineOutput = cmdletContext.Select(response, this);
                    }
                    output = new CmdletOutput
                    {
                        PipelineOutput  = pipelineOutput,
                        ServiceResponse = response
                    };

                    _nextToken = response.NextToken;
                }
                catch (Exception e)
                {
                    output = new CmdletOutput {
                        ErrorResponse = e
                    };
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken));

            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }