internal DescribeRecoveryInstancesPaginator(IAmazonDrs client, DescribeRecoveryInstancesRequest request) { this._client = client; this._request = request; }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Drs.Model.DescribeRecoveryInstancesRequest(); // populate Filters var requestFiltersIsNull = true; request.Filters = new Amazon.Drs.Model.DescribeRecoveryInstancesRequestFilters(); List <System.String> requestFilters_filters_RecoveryInstanceIDs = null; if (cmdletContext.Filters_RecoveryInstanceIDs != null) { requestFilters_filters_RecoveryInstanceIDs = cmdletContext.Filters_RecoveryInstanceIDs; } if (requestFilters_filters_RecoveryInstanceIDs != null) { request.Filters.RecoveryInstanceIDs = requestFilters_filters_RecoveryInstanceIDs; requestFiltersIsNull = false; } List <System.String> requestFilters_filters_SourceServerIDs = null; if (cmdletContext.Filters_SourceServerIDs != null) { requestFilters_filters_SourceServerIDs = cmdletContext.Filters_SourceServerIDs; } if (requestFilters_filters_SourceServerIDs != null) { request.Filters.SourceServerIDs = requestFilters_filters_SourceServerIDs; 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; } if (cmdletContext.NextToken != null) { request.NextToken = cmdletContext.NextToken; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
private Amazon.Drs.Model.DescribeRecoveryInstancesResponse CallAWSServiceOperation(IAmazonDrs client, Amazon.Drs.Model.DescribeRecoveryInstancesRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Disaster Recovery Service", "DescribeRecoveryInstances"); try { #if DESKTOP return(client.DescribeRecoveryInstances(request)); #elif CORECLR return(client.DescribeRecoveryInstancesAsync(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; } }
/// <summary> /// Paginator for DescribeRecoveryInstances operation ///</summary> public IDescribeRecoveryInstancesPaginator DescribeRecoveryInstances(DescribeRecoveryInstancesRequest request) { return(new DescribeRecoveryInstancesPaginator(this.client, request)); }