# 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_data_permission_unit import ReviewDataPermissionUnit


class ReviewDataPermissionStage(object):
    _types = {
        "stage_id": str,
        "stage_type": str,
        "units": List[ReviewDataPermissionUnit],
    }

    def __init__(self, d=None):
        self.stage_id: Optional[str] = None
        self.stage_type: Optional[str] = None
        self.units: Optional[List[ReviewDataPermissionUnit]] = None
        init(self, d, self._types)

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


class ReviewDataPermissionStageBuilder(object):
    def __init__(self) -> None:
        self._review_data_permission_stage = ReviewDataPermissionStage()

    def stage_id(self, stage_id: str) -> "ReviewDataPermissionStageBuilder":
        self._review_data_permission_stage.stage_id = stage_id
        return self

    def stage_type(self, stage_type: str) -> "ReviewDataPermissionStageBuilder":
        self._review_data_permission_stage.stage_type = stage_type
        return self

    def units(self, units: List[ReviewDataPermissionUnit]) -> "ReviewDataPermissionStageBuilder":
        self._review_data_permission_stage.units = units
        return self

    def build(self) -> "ReviewDataPermissionStage":
        return self._review_data_permission_stage
