class ParameterHasType(Condition):
def __init__(self, cond: str, dependee: str, type_: str) -> None:
super().__init__(cond, dependee)
self.type_ = type_
@classmethod
def from_dict(cls, d: dict[str, Any]) -> ParameterHasType:
return cls(d["condition"], d["dependee"], d["type"])
def to_dict(self) -> dict[str, Any]:
return {
"variant": Condition.Variant.HAS_TYPE.value,
"condition": self.condition,
"dependee": self.dependee,
"type": self.type_,
}