Class Pager<TResource, TParams>Abstract

Abstract base class for all pager implementations. Provides common pagination functionality for list operations.

Abstract

Type Parameters

  • TResource

    The type of resource being paginated

  • TParams extends {
        start?: string;
    }

    The type of parameters for the list operation

Hierarchy (view full)

Constructors

Properties

client: WatsonXAI
hasNextPage: boolean
pageContext: {
    next: undefined | string;
}

Type declaration

  • next: undefined | string
params: TParams

Methods

  • Returns all results by repeatedly invoking getNext() until all pages of results have been retrieved.

    Returns Promise<TResource[]>

    A Promise that resolves to an array of all resources

  • Abstract method to fetch the next page of results. Must be implemented by concrete pager classes.

    Returns Promise<TResource[]>

    A Promise that resolves to an array of resources

    Abstract

    Throws

    If no more results are available

  • Returns true if there are potentially more results to be retrieved by invoking getNext().

    Returns boolean

    True if there are more results available, false otherwise