# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .review_unit import ReviewUnit
from .invited_review_record_info import InvitedReviewRecordInfo
from .direct_project_leader_record_info import DirectProjectLeaderRecordInfo


class ReviewRecord(object):
    _types = {
        "progress": int,
        "units": List[ReviewUnit],
        "invited_review_record_info": InvitedReviewRecordInfo,
        "direct_project_leader_record_info": DirectProjectLeaderRecordInfo,
        "record_id": str,
    }

    def __init__(self, d=None):
        self.progress: Optional[int] = None
        self.units: Optional[List[ReviewUnit]] = None
        self.invited_review_record_info: Optional[InvitedReviewRecordInfo] = None
        self.direct_project_leader_record_info: Optional[DirectProjectLeaderRecordInfo] = None
        self.record_id: Optional[str] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "ReviewRecordBuilder":
        return ReviewRecordBuilder()


class ReviewRecordBuilder(object):
    def __init__(self) -> None:
        self._review_record = ReviewRecord()

    def progress(self, progress: int) -> "ReviewRecordBuilder":
        self._review_record.progress = progress
        return self

    def units(self, units: List[ReviewUnit]) -> "ReviewRecordBuilder":
        self._review_record.units = units
        return self

    def invited_review_record_info(self, invited_review_record_info: InvitedReviewRecordInfo) -> "ReviewRecordBuilder":
        self._review_record.invited_review_record_info = invited_review_record_info
        return self

    def direct_project_leader_record_info(self,
                                          direct_project_leader_record_info: DirectProjectLeaderRecordInfo) -> "ReviewRecordBuilder":
        self._review_record.direct_project_leader_record_info = direct_project_leader_record_info
        return self

    def record_id(self, record_id: str) -> "ReviewRecordBuilder":
        self._review_record.record_id = record_id
        return self

    def build(self) -> "ReviewRecord":
        return self._review_record
