Base Models#

validate_list_to_single(v)[source]#

Converts a list to a single value (the last element of the list)

Query parameters (in a URI) can be specified multiple times. Therefore, we will always convert them to a list in flask. But that means we have to convert them to single values here

pydantic model RestModelBase[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Config:
  • extra: Extra = Extra.forbid

  • validate_assignment: bool = True

pydantic model CommonBulkGetBody[source]#

Bases: RestModelBase

Common URL parameters for “get_*” functions

These functions typically take a list for ids, and a bool for missing_ok

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Config:
  • extra: Extra = Extra.forbid

  • validate_assignment: bool = True

Fields:
field ids: List[int] [Required]#
field include: List[str] | None = None#
field exclude: List[str] | None = None#
field missing_ok: bool = False#
pydantic model CommonBulkGetNamesBody[source]#

Bases: RestModelBase

Common URL parameters for “get_*” functions

These functions typically take a list for ids, and a bool for missing_ok

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Config:
  • extra: Extra = Extra.forbid

  • validate_assignment: bool = True

Fields:
field names: List[str] [Required]#
field include: List[str] | None = None#
field exclude: List[str] | None = None#
field missing_ok: bool = False#
pydantic model ProjURLParameters[source]#

Bases: RestModelBase

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Config:
  • extra: Extra = Extra.forbid

  • validate_assignment: bool = True

Fields:
field include: List[str] | None = None#
field exclude: List[str] | None = None#
pydantic model QueryModelBase[source]#

Bases: RestModelBase

Common parameters for query_* functions, without include/exclude

These can be either URL parameters or part of a POST body

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Config:
  • extra: Extra = Extra.forbid

  • validate_assignment: bool = True

Fields:
Validators:
field limit: int | None = None#
Validated by:
field cursor: int | None = None#
Validated by:
validator validate_lists  »  limit, cursor[source]#
pydantic model QueryProjModelBase[source]#

Bases: QueryModelBase, ProjURLParameters

Common parameters for query_* functions, with include/exclude (projection)

These can be either URL parameters or part of a POST body

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Config:
  • extra: Extra = Extra.forbid

  • validate_assignment: bool = True

Fields:
Validators:
validator validate_lists  »  cursor, limit#
field limit: int | None = None#
Validated by:
field cursor: int | None = None#
Validated by:
field include: List[str] | None = None#
field exclude: List[str] | None = None#
class QueryIteratorBase(client, query_filters, batch_limit)[source]#

Bases: Generic[T]

Base class for all query result iterators

Query iterators are used to iterate intelligently over the result of a query. This handles pagination, where only batches are downloaded from the server.

Parameters:
reset()[source]#

Starts retrieval of results from the beginning again