Skip to content

OmittedAnnotation

Bases: ValueAnnotation

Source code in library_analyzer/processing/annotations/model/_annotations.py
@dataclass
class OmittedAnnotation(ValueAnnotation):
    variant = ValueAnnotation.Variant.OMITTED

    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) -> OmittedAnnotation:
        annotation = AbstractAnnotation.from_json(json)
        return OmittedAnnotation(
            annotation.target,
            annotation.authors,
            annotation.reviewers,
            annotation.comment,
            annotation.reviewResult,
        )

variant = ValueAnnotation.Variant.OMITTED class-attribute

from_json(json) staticmethod

Source code in library_analyzer/processing/annotations/model/_annotations.py
@staticmethod
def from_json(json: Any) -> OmittedAnnotation:
    annotation = AbstractAnnotation.from_json(json)
    return OmittedAnnotation(
        annotation.target,
        annotation.authors,
        annotation.reviewers,
        annotation.comment,
        annotation.reviewResult,
    )

to_json()

Source code in library_analyzer/processing/annotations/model/_annotations.py
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,
    }