Ejemplo n.º 1
0
 /// <summary>
 /// Paginator for DescribeReservedNodeExchangeStatus operation
 ///</summary>
 public IDescribeReservedNodeExchangeStatusPaginator DescribeReservedNodeExchangeStatus(DescribeReservedNodeExchangeStatusRequest request)
 {
     return(new DescribeReservedNodeExchangeStatusPaginator(this.client, request));
 }
Ejemplo n.º 2
0
        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.Redshift.Model.DescribeReservedNodeExchangeStatusRequest();

            if (cmdletContext.MaxRecord != null)
            {
                request.MaxRecords = cmdletContext.MaxRecord.Value;
            }
            if (cmdletContext.ReservedNodeExchangeRequestId != null)
            {
                request.ReservedNodeExchangeRequestId = cmdletContext.ReservedNodeExchangeRequestId;
            }
            if (cmdletContext.ReservedNodeId != null)
            {
                request.ReservedNodeId = cmdletContext.ReservedNodeId;
            }

            // Initialize loop variant and commence piping
            var _nextToken             = cmdletContext.Marker;
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.Marker));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            do
            {
                request.Marker = _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.Marker;
                }
                catch (Exception e)
                {
                    output = new CmdletOutput {
                        ErrorResponse = e
                    };
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken));

            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }
Ejemplo n.º 3
0
 private Amazon.Redshift.Model.DescribeReservedNodeExchangeStatusResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.DescribeReservedNodeExchangeStatusRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "DescribeReservedNodeExchangeStatus");
     try
     {
         #if DESKTOP
         return(client.DescribeReservedNodeExchangeStatus(request));
         #elif CORECLR
         return(client.DescribeReservedNodeExchangeStatusAsync(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 DescribeReservedNodeExchangeStatusPaginator(IAmazonRedshift client, DescribeReservedNodeExchangeStatusRequest request)
 {
     this._client  = client;
     this._request = request;
 }