# 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 .template import Template
from .unit import Unit
from .i18n import I18n
from .i18n import I18n


class ReviewTemplate(object):
    _types = {
        "templates": List[Template],
        "units": List[Unit],
        "review_template_id": str,
        "name": I18n,
        "description": I18n,
        "status": str,
    }

    def __init__(self, d=None):
        self.templates: Optional[List[Template]] = None
        self.units: Optional[List[Unit]] = None
        self.review_template_id: Optional[str] = None
        self.name: Optional[I18n] = None
        self.description: Optional[I18n] = None
        self.status: Optional[str] = None
        init(self, d, self._types)

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


class ReviewTemplateBuilder(object):
    def __init__(self) -> None:
        self._review_template = ReviewTemplate()

    def templates(self, templates: List[Template]) -> "ReviewTemplateBuilder":
        self._review_template.templates = templates
        return self

    def units(self, units: List[Unit]) -> "ReviewTemplateBuilder":
        self._review_template.units = units
        return self

    def review_template_id(self, review_template_id: str) -> "ReviewTemplateBuilder":
        self._review_template.review_template_id = review_template_id
        return self

    def name(self, name: I18n) -> "ReviewTemplateBuilder":
        self._review_template.name = name
        return self

    def description(self, description: I18n) -> "ReviewTemplateBuilder":
        self._review_template.description = description
        return self

    def status(self, status: str) -> "ReviewTemplateBuilder":
        self._review_template.status = status
        return self

    def build(self) -> "ReviewTemplate":
        return self._review_template
