Skip to content

Shared models

Base types and common response models used across the API.

models

Classes:

Functions:

  • alias_generator

    Convert snake_case to PascalCase, with special handling for common abbreviations.

BaseModelWithConfig

Bases: BaseModel

Base model with common configuration for all models. Most of the time this config will be able to handle serializetion and deserialization for all models. Sometimes the alias would be different and can be overridden per field. For example, deveui is mostly DevEUI.

Attributes:

model_config class-attribute instance-attribute

model_config = ConfigDict(
    validate_by_name=True,
    validate_by_alias=True,
    serialize_by_alias=True,
    alias_generator=alias_generator,
)

CommonOKResponse

Bases: BaseModelWithConfig

Attributes:

response instance-attribute

response: bool

alias_generator

alias_generator(snake: str) -> str

Convert snake_case to PascalCase, with special handling for common abbreviations.