Beispiel #1
0
 /// <summary>
 /// Paginator for ListFHIRDatastores operation
 ///</summary>
 public IListFHIRDatastoresPaginator ListFHIRDatastores(ListFHIRDatastoresRequest request)
 {
     return(new ListFHIRDatastoresPaginator(this.client, request));
 }
        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.HealthLake.Model.ListFHIRDatastoresRequest();


            // populate Filter
            var requestFilterIsNull = true;

            request.Filter = new Amazon.HealthLake.Model.DatastoreFilter();
            System.DateTime?requestFilter_filter_CreatedAfter = null;
            if (cmdletContext.Filter_CreatedAfter != null)
            {
                requestFilter_filter_CreatedAfter = cmdletContext.Filter_CreatedAfter.Value;
            }
            if (requestFilter_filter_CreatedAfter != null)
            {
                request.Filter.CreatedAfter = requestFilter_filter_CreatedAfter.Value;
                requestFilterIsNull         = false;
            }
            System.DateTime?requestFilter_filter_CreatedBefore = null;
            if (cmdletContext.Filter_CreatedBefore != null)
            {
                requestFilter_filter_CreatedBefore = cmdletContext.Filter_CreatedBefore.Value;
            }
            if (requestFilter_filter_CreatedBefore != null)
            {
                request.Filter.CreatedBefore = requestFilter_filter_CreatedBefore.Value;
                requestFilterIsNull          = false;
            }
            System.String requestFilter_filter_DatastoreName = null;
            if (cmdletContext.Filter_DatastoreName != null)
            {
                requestFilter_filter_DatastoreName = cmdletContext.Filter_DatastoreName;
            }
            if (requestFilter_filter_DatastoreName != null)
            {
                request.Filter.DatastoreName = requestFilter_filter_DatastoreName;
                requestFilterIsNull          = false;
            }
            Amazon.HealthLake.DatastoreStatus requestFilter_filter_DatastoreStatus = null;
            if (cmdletContext.Filter_DatastoreStatus != null)
            {
                requestFilter_filter_DatastoreStatus = cmdletContext.Filter_DatastoreStatus;
            }
            if (requestFilter_filter_DatastoreStatus != null)
            {
                request.Filter.DatastoreStatus = requestFilter_filter_DatastoreStatus;
                requestFilterIsNull            = false;
            }
            // determine if request.Filter should be set to null
            if (requestFilterIsNull)
            {
                request.Filter = null;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = cmdletContext.MaxResult.Value;
            }

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

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

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

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

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


            return(null);
        }
 private Amazon.HealthLake.Model.ListFHIRDatastoresResponse CallAWSServiceOperation(IAmazonHealthLake client, Amazon.HealthLake.Model.ListFHIRDatastoresRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon HealthLake", "ListFHIRDatastores");
     try
     {
         #if DESKTOP
         return(client.ListFHIRDatastores(request));
         #elif CORECLR
         return(client.ListFHIRDatastoresAsync(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
 internal ListFHIRDatastoresPaginator(IAmazonHealthLake client, ListFHIRDatastoresRequest request)
 {
     this._client  = client;
     this._request = request;
 }