|
from pydantic import BaseModel, Field |
|
from typing import Literal, List, Union, Optional |
|
|
|
|
|
CommonAnomaliesSimple = Literal["injury", "abnormal position"] |
|
|
|
|
|
|
|
class BeakAnomaly(BaseModel): |
|
type: Literal["beak"] |
|
anomaly_type: List[Literal["adhesion/discharge", CommonAnomaliesSimple]] |
|
|
|
|
|
|
|
class BodyAnomaly(BaseModel): |
|
type: Literal["body"] |
|
anomaly_type: List[Literal[CommonAnomaliesSimple]] |
|
|
|
|
|
|
|
class FeathersWingsTailAnomaly(BaseModel): |
|
type: Literal["feathers/wings/tail"] |
|
anomaly_type: List[Literal["feather and skin change", CommonAnomaliesSimple]] |
|
|
|
|
|
|
|
class HeadAnomaly(BaseModel): |
|
type: Literal["head incl. eyes"] |
|
anomaly_type: List[Literal["eye changes", CommonAnomaliesSimple]] |
|
|
|
|
|
|
|
class LegAnomaly(BaseModel): |
|
type: Literal["legs"] |
|
anomaly_type: List[Literal[CommonAnomaliesSimple]] |
|
|
|
|
|
|
|
AnomalyTypeSimple = Union[ |
|
BeakAnomaly, BodyAnomaly, LegAnomaly, FeathersWingsTailAnomaly, HeadAnomaly |
|
] |
|
|
|
|
|
|
|
class PhysicalAnomaliesSimple(BaseModel): |
|
physical_radio: str |
|
physical_anomalies_type: Optional[List[AnomalyTypeSimple]] = None |
|
|