# 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 .i18n import I18n
from .termination_reason_child_info import TerminationReasonChildInfo


class TerminationReasonInfo(object):
    _types = {
        "id": str,
        "name": I18n,
        "children": List[TerminationReasonChildInfo],
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.name: Optional[I18n] = None
        self.children: Optional[List[TerminationReasonChildInfo]] = None
        init(self, d, self._types)

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


class TerminationReasonInfoBuilder(object):
    def __init__(self) -> None:
        self._termination_reason_info = TerminationReasonInfo()

    def id(self, id: str) -> "TerminationReasonInfoBuilder":
        self._termination_reason_info.id = id
        return self

    def name(self, name: I18n) -> "TerminationReasonInfoBuilder":
        self._termination_reason_info.name = name
        return self

    def children(self, children: List[TerminationReasonChildInfo]) -> "TerminationReasonInfoBuilder":
        self._termination_reason_info.children = children
        return self

    def build(self) -> "TerminationReasonInfo":
        return self._termination_reason_info
