/// <summary>
        /// Gets the final result of the long-running operation in synchronously.
        /// </summary>
        /// <remarks>
        /// Operation must complete successfully (HasValue is true) for it to provide values.
        /// </remarks>
        public override Pageable <AnalyzeHealthcareEntitiesResultCollection> GetValues(CancellationToken cancellationToken = default)
        {
            // Validates that the operation has completed successfully.
            _ = _operationInternal.Value;

            Page <AnalyzeHealthcareEntitiesResultCollection> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                //diagnostics scope?
                try
                {
                    Response <HealthcareJobState> jobState = _serviceClient.HealthStatusNextPage(nextLink, cancellationToken);

                    AnalyzeHealthcareEntitiesResultCollection result = Transforms.ConvertToAnalyzeHealthcareEntitiesResultCollection(jobState.Value.Results, _idToIndexMap);
                    return(Page.FromValues(new List <AnalyzeHealthcareEntitiesResultCollection>()
                    {
                        result
                    }, jobState.Value.NextLink, jobState.GetRawResponse()));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(_ => _firstPage, NextPageFunc));
        }
        /// <summary>
        /// Gets the final result of the long-running operation in synchronously.
        /// </summary>
        /// <remarks>
        /// Operation must complete successfully (HasValue is true) for it to provide values.
        /// </remarks>
        public override Pageable <AnalyzeHealthcareEntitiesResultCollection> GetValues()
        {
            ValidateOperationStatus();

            Page <AnalyzeHealthcareEntitiesResultCollection> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                //diagnostics scope?
                try
                {
                    Response <HealthcareJobState> jobState = _serviceClient.HealthStatusNextPage(_apiVersion, nextLink, _showStats);

                    AnalyzeHealthcareEntitiesResultCollection result = Transforms.ConvertToAnalyzeHealthcareEntitiesResultCollection(jobState.Value.Results, _idToIndexMap);
                    return(Page.FromValues(new List <AnalyzeHealthcareEntitiesResultCollection>()
                    {
                        result
                    }, jobState.Value.NextLink, jobState.GetRawResponse()));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(_ => _firstPage, NextPageFunc));
        }
        /// <summary>
        /// Gets the final result of the long-running operation in an asynchronous way.
        /// </summary>
        /// <remarks>
        /// Operation must complete successfully (HasValue is true) for it to provide values.
        /// </remarks>
        public override Pageable <AnalyzeHealthcareEntitiesResultCollection> GetValues()
        {
            if (!HasCompleted)
            {
                throw new InvalidOperationException("The operation has not completed yet.");
            }
            if (HasCompleted && !HasValue)
            {
                throw _requestFailedException;
            }

            Page <AnalyzeHealthcareEntitiesResultCollection> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                //diagnostics scope?
                try
                {
                    Response <HealthcareJobState> jobState = _serviceClient.HealthStatusNextPage(_apiVersion, nextLink, _showStats);

                    AnalyzeHealthcareEntitiesResultCollection result = Transforms.ConvertToAnalyzeHealthcareEntitiesResultCollection(jobState.Value.Results, _idToIndexMap);
                    return(Page.FromValues(new List <AnalyzeHealthcareEntitiesResultCollection>()
                    {
                        result
                    }, jobState.Value.NextLink, jobState.GetRawResponse()));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(_ => _firstPage, NextPageFunc));
        }