DTO Module
Contains the DTOMixin
class.
- class arrowhead_client.dto.DTOMixin(**data)
-
Mixin to create data-transfer objects from class.
This class is a customized version of
pydantic.BaseModel
, which gives it some quirks:When subclassing
DTOMixin
, you should not specify__init__
, instead you use the attribute syntax(?).A subclass of
DTOMixin
must be instantiated with keyword arguments.A subclass of
DTOMixin
can alternatively be instantiated with keyword arguments in camelCase form.
For a more detailed explanation of how to use
DTOMixin
, check the data transfer object user guide.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.
- Return type
None