PaginatedResponse

@Serializable
data class PaginatedResponse<T>(val items: List<T>, val page: Int, val limit: Int, val totalItems: Long, val totalPages: Int, val hasNext: Boolean, val hasPrevious: Boolean)

A response containing a paginated list of items.

Parameters

items

The list of items.

page

The current page.

limit

The number of items per page.

totalItems

The total number of items.

totalPages

The total number of pages.

hasNext

Whether there is a next page.

hasPrevious

Whether there is a previous page.

Type Parameters

T

The type of the items in the list.

Constructors

Link copied to clipboard
constructor(items: List<T>, page: Int, limit: Int, totalItems: Long, totalPages: Int, hasNext: Boolean, hasPrevious: Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val items: List<T>
Link copied to clipboard
val limit: Int
Link copied to clipboard
val page: Int
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun <R> map(transform: (T) -> R): PaginatedResponse<R>

Maps the items of this response to a new type R.