FileList

@Serializable
class FileList(val object: String, val data: List<FileObject>, val hasMore: Boolean, val firstId: String? = null, val lastId: String? = null)

One page of the files stored by the Files API.

Pages are walked with the lastId cursor:

var page = client.listFiles()
while (page.hasMore) {
page.data.forEach { println(it.filename) }
page = client.listFiles(after = page.lastId)
}

See also

Constructors

Link copied to clipboard
constructor(object: String, data: List<FileObject>, hasMore: Boolean, firstId: String? = null, lastId: String? = null)

Properties

Link copied to clipboard

Files on this page, ordered by creation time per the requested SortOrder.

Link copied to clipboard

Identifier of the first file on the page; null for an empty page.

Link copied to clipboard

true when further files follow this page.

Link copied to clipboard

Identifier of the last file on the page; pass it as after to fetch the next page. null for an empty page.

Link copied to clipboard

Object type discriminator; always list.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String