Пример #1
0
 private Amazon.CloudControlApi.Model.ListResourceRequestsResponse CallAWSServiceOperation(IAmazonCloudControlApi client, Amazon.CloudControlApi.Model.ListResourceRequestsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Cloud Control API", "ListResourceRequests");
     try
     {
         #if DESKTOP
         return(client.ListResourceRequests(request));
         #elif CORECLR
         return(client.ListResourceRequestsAsync(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 ListResourceRequests operation
 ///</summary>
 public IListResourceRequestsPaginator ListResourceRequests(ListResourceRequestsRequest request)
 {
     return(new ListResourceRequestsPaginator(this.client, request));
 }
Пример #3
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudControlApi.Model.ListResourceRequestsRequest();

            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = cmdletContext.MaxResult.Value;
            }
            if (cmdletContext.NextToken != null)
            {
                request.NextToken = cmdletContext.NextToken;
            }

            // populate ResourceRequestStatusFilter
            var requestResourceRequestStatusFilterIsNull = true;

            request.ResourceRequestStatusFilter = new Amazon.CloudControlApi.Model.ResourceRequestStatusFilter();
            List <System.String> requestResourceRequestStatusFilter_resourceRequestStatusFilter_Operation = null;

            if (cmdletContext.ResourceRequestStatusFilter_Operation != null)
            {
                requestResourceRequestStatusFilter_resourceRequestStatusFilter_Operation = cmdletContext.ResourceRequestStatusFilter_Operation;
            }
            if (requestResourceRequestStatusFilter_resourceRequestStatusFilter_Operation != null)
            {
                request.ResourceRequestStatusFilter.Operations = requestResourceRequestStatusFilter_resourceRequestStatusFilter_Operation;
                requestResourceRequestStatusFilterIsNull       = false;
            }
            List <System.String> requestResourceRequestStatusFilter_resourceRequestStatusFilter_OperationStatus = null;

            if (cmdletContext.ResourceRequestStatusFilter_OperationStatus != null)
            {
                requestResourceRequestStatusFilter_resourceRequestStatusFilter_OperationStatus = cmdletContext.ResourceRequestStatusFilter_OperationStatus;
            }
            if (requestResourceRequestStatusFilter_resourceRequestStatusFilter_OperationStatus != null)
            {
                request.ResourceRequestStatusFilter.OperationStatuses = requestResourceRequestStatusFilter_resourceRequestStatusFilter_OperationStatus;
                requestResourceRequestStatusFilterIsNull = false;
            }
            // determine if request.ResourceRequestStatusFilter should be set to null
            if (requestResourceRequestStatusFilterIsNull)
            {
                request.ResourceRequestStatusFilter = null;
            }

            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 ListResourceRequestsPaginator(IAmazonCloudControlApi client, ListResourceRequestsRequest request)
 {
     this._client  = client;
     this._request = request;
 }