Beispiel #1
0
 internal DescribeRecoverySnapshotsPaginator(IAmazonDrs client, DescribeRecoverySnapshotsRequest 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.DescribeRecoverySnapshotsRequest();


            // populate Filters
            var requestFiltersIsNull = true;

            request.Filters = new Amazon.Drs.Model.DescribeRecoverySnapshotsRequestFilters();
            System.String requestFilters_filters_FromDateTime = null;
            if (cmdletContext.Filters_FromDateTime != null)
            {
                requestFilters_filters_FromDateTime = cmdletContext.Filters_FromDateTime;
            }
            if (requestFilters_filters_FromDateTime != null)
            {
                request.Filters.FromDateTime = requestFilters_filters_FromDateTime;
                requestFiltersIsNull         = false;
            }
            System.String requestFilters_filters_ToDateTime = null;
            if (cmdletContext.Filters_ToDateTime != null)
            {
                requestFilters_filters_ToDateTime = cmdletContext.Filters_ToDateTime;
            }
            if (requestFilters_filters_ToDateTime != null)
            {
                request.Filters.ToDateTime = requestFilters_filters_ToDateTime;
                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;
            }
            if (cmdletContext.Order != null)
            {
                request.Order = cmdletContext.Order;
            }
            if (cmdletContext.SourceServerID != null)
            {
                request.SourceServerID = cmdletContext.SourceServerID;
            }

            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.DescribeRecoverySnapshotsResponse CallAWSServiceOperation(IAmazonDrs client, Amazon.Drs.Model.DescribeRecoverySnapshotsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Elastic Disaster Recovery Service", "DescribeRecoverySnapshots");
     try
     {
         #if DESKTOP
         return(client.DescribeRecoverySnapshots(request));
         #elif CORECLR
         return(client.DescribeRecoverySnapshotsAsync(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;
     }
 }
Beispiel #4
0
 /// <summary>
 /// Paginator for DescribeRecoverySnapshots operation
 ///</summary>
 public IDescribeRecoverySnapshotsPaginator DescribeRecoverySnapshots(DescribeRecoverySnapshotsRequest request)
 {
     return(new DescribeRecoverySnapshotsPaginator(this.client, request));
 }