# 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 .user import User
from .review_data_permission_stage import ReviewDataPermissionStage


class ReviewDataPermission(object):
    _types = {
        "user_id": User,
        "semester_id": str,
        "activity_id": str,
        "review_template_id": str,
        "stages": List[ReviewDataPermissionStage],
    }

    def __init__(self, d=None):
        self.user_id: Optional[User] = None
        self.semester_id: Optional[str] = None
        self.activity_id: Optional[str] = None
        self.review_template_id: Optional[str] = None
        self.stages: Optional[List[ReviewDataPermissionStage]] = None
        init(self, d, self._types)

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


class ReviewDataPermissionBuilder(object):
    def __init__(self) -> None:
        self._review_data_permission = ReviewDataPermission()

    def user_id(self, user_id: User) -> "ReviewDataPermissionBuilder":
        self._review_data_permission.user_id = user_id
        return self

    def semester_id(self, semester_id: str) -> "ReviewDataPermissionBuilder":
        self._review_data_permission.semester_id = semester_id
        return self

    def activity_id(self, activity_id: str) -> "ReviewDataPermissionBuilder":
        self._review_data_permission.activity_id = activity_id
        return self

    def review_template_id(self, review_template_id: str) -> "ReviewDataPermissionBuilder":
        self._review_data_permission.review_template_id = review_template_id
        return self

    def stages(self, stages: List[ReviewDataPermissionStage]) -> "ReviewDataPermissionBuilder":
        self._review_data_permission.stages = stages
        return self

    def build(self) -> "ReviewDataPermission":
        return self._review_data_permission
