private Amazon.Mgn.Model.DescribeSourceServersResponse CallAWSServiceOperation(IAmazonMgn client, Amazon.Mgn.Model.DescribeSourceServersRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Application Migration Service", "DescribeSourceServers");
     try
     {
         #if DESKTOP
         return(client.DescribeSourceServers(request));
         #elif CORECLR
         return(client.DescribeSourceServersAsync(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;
     }
 }
Пример #2
0
 /// <summary>
 /// Paginator for DescribeSourceServers operation
 ///</summary>
 public IDescribeSourceServersPaginator DescribeSourceServers(DescribeSourceServersRequest request)
 {
     return(new DescribeSourceServersPaginator(this.client, request));
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Mgn.Model.DescribeSourceServersRequest();


            // populate Filters
            var requestFiltersIsNull = true;

            request.Filters = new Amazon.Mgn.Model.DescribeSourceServersRequestFilters();
            System.Boolean?requestFilters_filters_IsArchived = null;
            if (cmdletContext.Filters_IsArchived != null)
            {
                requestFilters_filters_IsArchived = cmdletContext.Filters_IsArchived.Value;
            }
            if (requestFilters_filters_IsArchived != null)
            {
                request.Filters.IsArchived = requestFilters_filters_IsArchived.Value;
                requestFiltersIsNull       = false;
            }
            List <System.String> requestFilters_filters_LifeCycleState = null;

            if (cmdletContext.Filters_LifeCycleState != null)
            {
                requestFilters_filters_LifeCycleState = cmdletContext.Filters_LifeCycleState;
            }
            if (requestFilters_filters_LifeCycleState != null)
            {
                request.Filters.LifeCycleStates = requestFilters_filters_LifeCycleState;
                requestFiltersIsNull            = false;
            }
            List <System.String> requestFilters_filters_ReplicationType = null;

            if (cmdletContext.Filters_ReplicationType != null)
            {
                requestFilters_filters_ReplicationType = cmdletContext.Filters_ReplicationType;
            }
            if (requestFilters_filters_ReplicationType != null)
            {
                request.Filters.ReplicationTypes = requestFilters_filters_ReplicationType;
                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);
        }
Пример #4
0
 internal DescribeSourceServersPaginator(IAmazonMgn client, DescribeSourceServersRequest request)
 {
     this._client  = client;
     this._request = request;
 }