Shared models
Base types and common response models used across the API.
models
Classes:
-
BaseModelWithConfig–Base model with common configuration for all models.
-
CommonOKResponse–
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,
)