Page

@Serializable
data class Page<T>(val embedded: Page.Embedded<T>? = null, val links: Page.Links? = null) : Response

Represents a page of objects in a paginated response.

Parameters

T

The type of records in the page

See also

Constructors

Link copied to clipboard
constructor(embedded: Page.Embedded<T>? = null, links: Page.Links? = null)

Types

Link copied to clipboard
@Serializable
data class Embedded<T>(val records: List<T>)

Embedded records in the page response.

Link copied to clipboard
@Serializable
data class Links(val next: Link? = null, val prev: Link? = null, val self: Link)

Links for navigating between pages.

Properties

Link copied to clipboard
@SerialName(value = "_embedded")
val embedded: Page.Embedded<T>?
Link copied to clipboard
@SerialName(value = "_links")
val links: Page.Links?

Navigation links for pagination

Link copied to clipboard
val records: List<T>

Returns the records in this page. This is a convenience method to access records from the embedded object.

Functions

Link copied to clipboard
inline suspend fun <T> getNextPage(httpClient: HttpClient): Page<T>?

Fetches the next page of results.