# Code generated by Lark OpenAPI.

from typing import Optional, List

from lark_oapi.core.construct import init
from .abnormal_reason_element import AbnormalReasonElement


class AbnormalReasonI18nElement(object):
    _types = {
        "lang": str,
        "elements": List[AbnormalReasonElement],
    }

    def __init__(self, d=None):
        self.lang: Optional[str] = None
        self.elements: Optional[List[AbnormalReasonElement]] = None
        init(self, d, self._types)

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


class AbnormalReasonI18nElementBuilder(object):
    def __init__(self) -> None:
        self._abnormal_reason_i18n_element = AbnormalReasonI18nElement()

    def lang(self, lang: str) -> "AbnormalReasonI18nElementBuilder":
        self._abnormal_reason_i18n_element.lang = lang
        return self

    def elements(self, elements: List[AbnormalReasonElement]) -> "AbnormalReasonI18nElementBuilder":
        self._abnormal_reason_i18n_element.elements = elements
        return self

    def build(self) -> "AbnormalReasonI18nElement":
        return self._abnormal_reason_i18n_element
