@dataclass
class RequiredAnnotation(ValueAnnotation):
variant = ValueAnnotation.Variant.REQUIRED
def to_json(self) -> dict:
return {
"target": self.target,
"authors": self.authors,
"reviewers": self.reviewers,
"comment": self.comment,
"reviewResult": self.reviewResult.value,
"variant": self.variant.value,
}
@staticmethod
def from_json(json: Any) -> RequiredAnnotation:
annotation = AbstractAnnotation.from_json(json)
return RequiredAnnotation(
annotation.target,
annotation.authors,
annotation.reviewers,
annotation.comment,
annotation.reviewResult,
)