Example #1
0
 /// <summary>
 /// Paginator for ListEvents operation
 ///</summary>
 public IListEventsPaginator ListEvents(ListEventsRequest request)
 {
     return(new ListEventsPaginator(this.client, request));
 }
Example #2
0
 private Amazon.DevOpsGuru.Model.ListEventsResponse CallAWSServiceOperation(IAmazonDevOpsGuru client, Amazon.DevOpsGuru.Model.ListEventsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon DevOps Guru", "ListEvents");
     try
     {
         #if DESKTOP
         return(client.ListEvents(request));
         #elif CORECLR
         return(client.ListEventsAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
 internal ListEventsPaginator(IAmazonDevOpsGuru client, ListEventsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
Example #4
0
        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.DevOpsGuru.Model.ListEventsRequest();


            // populate Filters
            var requestFiltersIsNull = true;
            request.Filters = new Amazon.DevOpsGuru.Model.ListEventsFilters();
            Amazon.DevOpsGuru.EventDataSource requestFilters_filters_DataSource = null;
            if (cmdletContext.Filters_DataSource != null)
            {
                requestFilters_filters_DataSource = cmdletContext.Filters_DataSource;
            }
            if (requestFilters_filters_DataSource != null)
            {
                request.Filters.DataSource = requestFilters_filters_DataSource;
                requestFiltersIsNull       = false;
            }
            Amazon.DevOpsGuru.EventClass requestFilters_filters_EventClass = null;
            if (cmdletContext.Filters_EventClass != null)
            {
                requestFilters_filters_EventClass = cmdletContext.Filters_EventClass;
            }
            if (requestFilters_filters_EventClass != null)
            {
                request.Filters.EventClass = requestFilters_filters_EventClass;
                requestFiltersIsNull       = false;
            }
            System.String requestFilters_filters_EventSource = null;
            if (cmdletContext.Filters_EventSource != null)
            {
                requestFilters_filters_EventSource = cmdletContext.Filters_EventSource;
            }
            if (requestFilters_filters_EventSource != null)
            {
                request.Filters.EventSource = requestFilters_filters_EventSource;
                requestFiltersIsNull        = false;
            }
            Amazon.DevOpsGuru.Model.EventTimeRange requestFilters_filters_EventTimeRange = null;
            if (cmdletContext.Filters_EventTimeRange != null)
            {
                requestFilters_filters_EventTimeRange = cmdletContext.Filters_EventTimeRange;
            }
            if (requestFilters_filters_EventTimeRange != null)
            {
                request.Filters.EventTimeRange = requestFilters_filters_EventTimeRange;
                requestFiltersIsNull           = false;
            }
            System.String requestFilters_filters_InsightId = null;
            if (cmdletContext.Filters_InsightId != null)
            {
                requestFilters_filters_InsightId = cmdletContext.Filters_InsightId;
            }
            if (requestFilters_filters_InsightId != null)
            {
                request.Filters.InsightId = requestFilters_filters_InsightId;
                requestFiltersIsNull      = false;
            }
            Amazon.DevOpsGuru.Model.ResourceCollection requestFilters_filters_ResourceCollection = null;
            if (cmdletContext.Filters_ResourceCollection != null)
            {
                requestFilters_filters_ResourceCollection = cmdletContext.Filters_ResourceCollection;
            }
            if (requestFilters_filters_ResourceCollection != null)
            {
                request.Filters.ResourceCollection = requestFilters_filters_ResourceCollection;
                requestFiltersIsNull = false;
            }
            // determine if request.Filters should be set to null
            if (requestFiltersIsNull)
            {
                request.Filters = null;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = 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);
        }