@dataclass
class Dependency:
hasDependentParameter: Parameter # noqa: N815
isDependingOn: Parameter # noqa: N815
hasCondition: Condition # noqa: N815
hasAction: Action # noqa: N815
@classmethod
def from_dict(cls, d: dict[str, Any]) -> Dependency:
return cls(
Parameter.from_dict(d["hasDependentParameter"]),
Parameter.from_dict(d["isDependingOn"]),
Condition.from_dict(d["hasCondition"]),
Action.from_dict(d["hasAction"]),
)
def to_dict(self) -> dict[str, Any]:
return {
"hasDependentParameter": self.hasDependentParameter.to_dict(),
"isDependingOn": self.isDependingOn.to_dict(),
"hasCondition": self.hasCondition.to_dict(),
"hasAction": self.hasAction.to_dict(),
}