async IAsyncEnumerable <DescribePortfolioSharesResponse> IPaginator <DescribePortfolioSharesResponse> .PaginateAsync(CancellationToken cancellationToken = default)
        {
            if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
            {
                throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
            }
            PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
            var pageToken = _request.PageToken;
            DescribePortfolioSharesResponse response;

            do
            {
                _request.PageToken = pageToken;
                response           = await _client.DescribePortfolioSharesAsync(_request, cancellationToken).ConfigureAwait(false);

                pageToken = response.NextPageToken;
                cancellationToken.ThrowIfCancellationRequested();
                yield return(response);
            }while (!string.IsNullOrEmpty(pageToken));
        }
 private Amazon.ServiceCatalog.Model.DescribePortfolioSharesResponse CallAWSServiceOperation(IAmazonServiceCatalog client, Amazon.ServiceCatalog.Model.DescribePortfolioSharesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Service Catalog", "DescribePortfolioShares");
     try
     {
         #if DESKTOP
         return(client.DescribePortfolioShares(request));
         #elif CORECLR
         return(client.DescribePortfolioSharesAsync(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;
     }
 }