# 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_field import ReviewDataPermissionField


class ReviewDataPermissionUnit(object):
    _types = {
        "unit_id": str,
        "fields": List[ReviewDataPermissionField],
    }

    def __init__(self, d=None):
        self.unit_id: Optional[str] = None
        self.fields: Optional[List[ReviewDataPermissionField]] = None
        init(self, d, self._types)

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


class ReviewDataPermissionUnitBuilder(object):
    def __init__(self) -> None:
        self._review_data_permission_unit = ReviewDataPermissionUnit()

    def unit_id(self, unit_id: str) -> "ReviewDataPermissionUnitBuilder":
        self._review_data_permission_unit.unit_id = unit_id
        return self

    def fields(self, fields: List[ReviewDataPermissionField]) -> "ReviewDataPermissionUnitBuilder":
        self._review_data_permission_unit.fields = fields
        return self

    def build(self) -> "ReviewDataPermissionUnit":
        return self._review_data_permission_unit
