예제 #1
0
 /// <summary>
 /// Paginator for DescribeJobs operation
 ///</summary>
 public IDescribeJobsPaginator DescribeJobs(DescribeJobsRequest request)
 {
     return(new DescribeJobsPaginator(this.client, request));
 }
 private Amazon.Mgn.Model.DescribeJobsResponse CallAWSServiceOperation(IAmazonMgn client, Amazon.Mgn.Model.DescribeJobsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Application Migration Service", "DescribeJobs");
     try
     {
         #if DESKTOP
         return(client.DescribeJobs(request));
         #elif CORECLR
         return(client.DescribeJobsAsync(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 DescribeJobsPaginator(IAmazonMgn client, DescribeJobsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Mgn.Model.DescribeJobsRequest();


            // populate Filters
            var requestFiltersIsNull = true;

            request.Filters = new Amazon.Mgn.Model.DescribeJobsRequestFilters();
            System.String requestFilters_filters_FromDate = null;
            if (cmdletContext.Filters_FromDate != null)
            {
                requestFilters_filters_FromDate = cmdletContext.Filters_FromDate;
            }
            if (requestFilters_filters_FromDate != null)
            {
                request.Filters.FromDate = requestFilters_filters_FromDate;
                requestFiltersIsNull     = false;
            }
            List <System.String> requestFilters_filters_JobIDs = null;

            if (cmdletContext.Filters_JobIDs != null)
            {
                requestFilters_filters_JobIDs = cmdletContext.Filters_JobIDs;
            }
            if (requestFilters_filters_JobIDs != null)
            {
                request.Filters.JobIDs = requestFilters_filters_JobIDs;
                requestFiltersIsNull   = false;
            }
            System.String requestFilters_filters_ToDate = null;
            if (cmdletContext.Filters_ToDate != null)
            {
                requestFilters_filters_ToDate = cmdletContext.Filters_ToDate;
            }
            if (requestFilters_filters_ToDate != null)
            {
                request.Filters.ToDate = requestFilters_filters_ToDate;
                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);
        }