cmem_client.repositories.base.plain_list¤
Repository implementation for simple list API endpoints.
This module provides PlainListRepository, a repository implementation for API endpoints that return a simple array of objects without pagination. It’s commonly used with Corporate Memory’s DataIntegration (build) APIs that provide straightforward list responses.
The PlainListRepository fetches the entire list in a single request and provides dictionary-like access to the items by their ID.
Classes:
- PlainListRepository – Subclass of a ReadRepository that uses a plain list endpoint.
PlainListRepository¤
Bases: Repository
Subclass of a ReadRepository that uses a plain list endpoint.
Attributes:
- _dict (
dict[str, PlainListRepository[ItemType]]) – Cached contents of the repository, mapping the key of each item to the item itself. Backs the Mapping interface and is populated byfetch_data(). - _client (
Client) – Corporate Memory client used for the HTTP requests of this repository. - _config (
RepositoryConfig) – Describes which endpoint the repository fetches its data from.
Functions:
- fetch_data – Fetch simple list from a JSON endpoint via a type adapter
- items – Get the items of the repository
- keys – Get the keys of the repository
- values – Get the values of the repository
fetch_data¤
Fetch simple list from a JSON endpoint via a type adapter
Use this method to fetch data when your result set is an array of objects.
items¤
Get the items of the repository
keys¤
Get the keys of the repository
logger¤
Gets the client logger
values¤
Get the values of the repository