List items with a declared bound
zotListItems.RdBounded, version-stable listing of a library, a collection or an item's
children. One page is returned unless all = TRUE, which follows the
pagination up to max results and refuses a larger listing before
downloading it. The library version is read from every page and a change
between pages is reported as an error, so a listing never mixes two states.
Usage
zotListItems(
config,
library = "user",
collectionKey = NULL,
parentKey = NULL,
top = FALSE,
since = NULL,
itemType = NULL,
includeTrashed = FALSE,
versions = FALSE,
fields = NULL,
limit = PAGE_LIMIT,
all = FALSE,
max = NULL
)Arguments
- config
A
zotConfig()object.- library
"user"or a group id.- collectionKey
Restrict to the members of this collection.
- parentKey
Restrict to the children of this item.
- top
Top-level items only; it cannot be combined with
parentKey.- since
Only objects modified after this library version.
- itemType
An API item type filter, for example
"-note".- includeTrashed
Whether items in the Trash are returned.
- versions
Return the key-to-version map instead of the records.
- fields
Optional character vector: keep only these
datafields.- limit
Page size, at most one hundred.
- all
Follow the pagination to the end of the listing.
- max
Required with
all: the largest listing accepted.
Examples
Performer <- function(config, method, path, query, body, version) {
Page <- if (query$start == 0L) list(list(key = "A"), list(key = "B")) else list(list(key = "C"))
list(status = 200L,
headers = list(`total-results` = "3", `last-modified-version` = "7"),
body = Page)
}
Config <- structure(
list(userID = "42", key = "example", apiBase = "https://example.invalid",
performer = Performer),
class = "zotConfig"
)
zotListItems(Config, top = TRUE, limit = 2L)$truncated
#> [1] TRUE
zotListItems(Config, top = TRUE, limit = 2L, all = TRUE, max = 10L)$total
#> [1] 3