/// <summary> /// Paginator for ListOrganizationInsights operation ///</summary> public IListOrganizationInsightsPaginator ListOrganizationInsights(ListOrganizationInsightsRequest request) { return(new ListOrganizationInsightsPaginator(this.client, request)); }
private Amazon.DevOpsGuru.Model.ListOrganizationInsightsResponse CallAWSServiceOperation(IAmazonDevOpsGuru client, Amazon.DevOpsGuru.Model.ListOrganizationInsightsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon DevOps Guru", "ListOrganizationInsights"); try { #if DESKTOP return(client.ListOrganizationInsights(request)); #elif CORECLR return(client.ListOrganizationInsightsAsync(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 ListOrganizationInsightsPaginator(IAmazonDevOpsGuru client, ListOrganizationInsightsRequest request) { this._client = client; this._request = request; }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; var useParameterSelect = this.Select.StartsWith("^"); // create request and set iteration invariants var request = new Amazon.DevOpsGuru.Model.ListOrganizationInsightsRequest(); if (cmdletContext.AccountId != null) { request.AccountIds = cmdletContext.AccountId; } if (cmdletContext.MaxResult != null) { request.MaxResults = cmdletContext.MaxResult.Value; } if (cmdletContext.OrganizationalUnitId != null) { request.OrganizationalUnitIds = cmdletContext.OrganizationalUnitId; } // populate StatusFilter var requestStatusFilterIsNull = true; request.StatusFilter = new Amazon.DevOpsGuru.Model.ListInsightsStatusFilter(); Amazon.DevOpsGuru.Model.ListInsightsOngoingStatusFilter requestStatusFilter_statusFilter_Ongoing = null; // populate Ongoing var requestStatusFilter_statusFilter_OngoingIsNull = true; requestStatusFilter_statusFilter_Ongoing = new Amazon.DevOpsGuru.Model.ListInsightsOngoingStatusFilter(); Amazon.DevOpsGuru.InsightType requestStatusFilter_statusFilter_Ongoing_ongoing_Type = null; if (cmdletContext.Ongoing_Type != null) { requestStatusFilter_statusFilter_Ongoing_ongoing_Type = cmdletContext.Ongoing_Type; } if (requestStatusFilter_statusFilter_Ongoing_ongoing_Type != null) { requestStatusFilter_statusFilter_Ongoing.Type = requestStatusFilter_statusFilter_Ongoing_ongoing_Type; requestStatusFilter_statusFilter_OngoingIsNull = false; } // determine if requestStatusFilter_statusFilter_Ongoing should be set to null if (requestStatusFilter_statusFilter_OngoingIsNull) { requestStatusFilter_statusFilter_Ongoing = null; } if (requestStatusFilter_statusFilter_Ongoing != null) { request.StatusFilter.Ongoing = requestStatusFilter_statusFilter_Ongoing; requestStatusFilterIsNull = false; } Amazon.DevOpsGuru.Model.ListInsightsAnyStatusFilter requestStatusFilter_statusFilter_Any = null; // populate Any var requestStatusFilter_statusFilter_AnyIsNull = true; requestStatusFilter_statusFilter_Any = new Amazon.DevOpsGuru.Model.ListInsightsAnyStatusFilter(); Amazon.DevOpsGuru.InsightType requestStatusFilter_statusFilter_Any_any_Type = null; if (cmdletContext.Any_Type != null) { requestStatusFilter_statusFilter_Any_any_Type = cmdletContext.Any_Type; } if (requestStatusFilter_statusFilter_Any_any_Type != null) { requestStatusFilter_statusFilter_Any.Type = requestStatusFilter_statusFilter_Any_any_Type; requestStatusFilter_statusFilter_AnyIsNull = false; } Amazon.DevOpsGuru.Model.StartTimeRange requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange = null; // populate StartTimeRange var requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRangeIsNull = true; requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange = new Amazon.DevOpsGuru.Model.StartTimeRange(); System.DateTime?requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange_startTimeRange_FromTime = null; if (cmdletContext.StartTimeRange_FromTime != null) { requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange_startTimeRange_FromTime = cmdletContext.StartTimeRange_FromTime.Value; } if (requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange_startTimeRange_FromTime != null) { requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange.FromTime = requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange_startTimeRange_FromTime.Value; requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRangeIsNull = false; } System.DateTime?requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange_startTimeRange_ToTime = null; if (cmdletContext.StartTimeRange_ToTime != null) { requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange_startTimeRange_ToTime = cmdletContext.StartTimeRange_ToTime.Value; } if (requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange_startTimeRange_ToTime != null) { requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange.ToTime = requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange_startTimeRange_ToTime.Value; requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRangeIsNull = false; } // determine if requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange should be set to null if (requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRangeIsNull) { requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange = null; } if (requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange != null) { requestStatusFilter_statusFilter_Any.StartTimeRange = requestStatusFilter_statusFilter_Any_statusFilter_Any_StartTimeRange; requestStatusFilter_statusFilter_AnyIsNull = false; } // determine if requestStatusFilter_statusFilter_Any should be set to null if (requestStatusFilter_statusFilter_AnyIsNull) { requestStatusFilter_statusFilter_Any = null; } if (requestStatusFilter_statusFilter_Any != null) { request.StatusFilter.Any = requestStatusFilter_statusFilter_Any; requestStatusFilterIsNull = false; } Amazon.DevOpsGuru.Model.ListInsightsClosedStatusFilter requestStatusFilter_statusFilter_Closed = null; // populate Closed var requestStatusFilter_statusFilter_ClosedIsNull = true; requestStatusFilter_statusFilter_Closed = new Amazon.DevOpsGuru.Model.ListInsightsClosedStatusFilter(); Amazon.DevOpsGuru.InsightType requestStatusFilter_statusFilter_Closed_closed_Type = null; if (cmdletContext.Closed_Type != null) { requestStatusFilter_statusFilter_Closed_closed_Type = cmdletContext.Closed_Type; } if (requestStatusFilter_statusFilter_Closed_closed_Type != null) { requestStatusFilter_statusFilter_Closed.Type = requestStatusFilter_statusFilter_Closed_closed_Type; requestStatusFilter_statusFilter_ClosedIsNull = false; } Amazon.DevOpsGuru.Model.EndTimeRange requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange = null; // populate EndTimeRange var requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRangeIsNull = true; requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange = new Amazon.DevOpsGuru.Model.EndTimeRange(); System.DateTime?requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange_endTimeRange_FromTime = null; if (cmdletContext.EndTimeRange_FromTime != null) { requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange_endTimeRange_FromTime = cmdletContext.EndTimeRange_FromTime.Value; } if (requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange_endTimeRange_FromTime != null) { requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange.FromTime = requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange_endTimeRange_FromTime.Value; requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRangeIsNull = false; } System.DateTime?requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange_endTimeRange_ToTime = null; if (cmdletContext.EndTimeRange_ToTime != null) { requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange_endTimeRange_ToTime = cmdletContext.EndTimeRange_ToTime.Value; } if (requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange_endTimeRange_ToTime != null) { requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange.ToTime = requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange_endTimeRange_ToTime.Value; requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRangeIsNull = false; } // determine if requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange should be set to null if (requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRangeIsNull) { requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange = null; } if (requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange != null) { requestStatusFilter_statusFilter_Closed.EndTimeRange = requestStatusFilter_statusFilter_Closed_statusFilter_Closed_EndTimeRange; requestStatusFilter_statusFilter_ClosedIsNull = false; } // determine if requestStatusFilter_statusFilter_Closed should be set to null if (requestStatusFilter_statusFilter_ClosedIsNull) { requestStatusFilter_statusFilter_Closed = null; } if (requestStatusFilter_statusFilter_Closed != null) { request.StatusFilter.Closed = requestStatusFilter_statusFilter_Closed; requestStatusFilterIsNull = false; } // determine if request.StatusFilter should be set to null if (requestStatusFilterIsNull) { request.StatusFilter = null; } // 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); }