aim.digifeeds.database.schemas module

Digifeeds Pydantic Models

class aim.digifeeds.database.schemas.Item(*, item_barcode: str, created_at: datetime, statuses: list[ItemStatus] = [])[source]

Bases: ItemBase

created_at: datetime
model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'examples': [{'barcode': '39015040218748', 'created_at': '2024-09-25T17:12:39', 'statuses': [{'created_at': '2024-09-25T17:13:28', 'description': 'Item is in zephir', 'name': 'in_zephir'}]}]}, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

statuses: list[ItemStatus]
class aim.digifeeds.database.schemas.ItemBase(*, item_barcode: str)[source]

Bases: BaseModel

barcode: str
model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class aim.digifeeds.database.schemas.ItemCreate(*, item_barcode: str)[source]

Bases: ItemBase

model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class aim.digifeeds.database.schemas.ItemFilters(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

in_zephir = 'in_zephir'
not_found_in_alma = 'not_found_in_alma'
not_in_zephir = 'not_in_zephir'
not_pending_deletion = 'not_pending_deletion'
pending_deletion = 'pending_deletion'
class aim.digifeeds.database.schemas.ItemStatus(*, status_name: str, status_description: str, created_at: datetime)[source]

Bases: BaseModel

created_at: datetime
description: str
model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'populate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
class aim.digifeeds.database.schemas.PageOfItems(*, items: list[Item], limit: int = 10, offset: int = 0, total: int = 1)[source]

Bases: BaseModel

items: list[Item]
limit: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

offset: int
total: int
class aim.digifeeds.database.schemas.Response(*, detail: str)[source]

Bases: BaseModel

detail: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class aim.digifeeds.database.schemas.Response400(*, detail: str)[source]

Bases: Response

model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'examples': [{'detail': 'Item already exists'}]}}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class aim.digifeeds.database.schemas.Response404(*, detail: str)[source]

Bases: Response

model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'examples': [{'detail': 'Item not found'}]}}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class aim.digifeeds.database.schemas.Status(*, name: str, description: str)[source]

Bases: StatusBase

description: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class aim.digifeeds.database.schemas.StatusBase(*, name: str)[source]

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str