# 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 .enum import Enum
from .i18n import I18n
from .signature_template_common_field_info import SignatureTemplateCommonFieldInfo
from .signature_template_combination_field_info import SignatureTemplateCombinationFieldInfo
from .signature_template_combination_field_info_v2 import SignatureTemplateCombinationFieldInfoV2


class SignatureTemplateField(object):
    _types = {
        "field_type": Enum,
        "label": List[I18n],
        "common_info": SignatureTemplateCommonFieldInfo,
        "combination_info": SignatureTemplateCombinationFieldInfo,
        "children": str,
        "combination_info_v2": SignatureTemplateCombinationFieldInfoV2,
    }

    def __init__(self, d=None):
        self.field_type: Optional[Enum] = None
        self.label: Optional[List[I18n]] = None
        self.common_info: Optional[SignatureTemplateCommonFieldInfo] = None
        self.combination_info: Optional[SignatureTemplateCombinationFieldInfo] = None
        self.children: Optional[str] = None
        self.combination_info_v2: Optional[SignatureTemplateCombinationFieldInfoV2] = None
        init(self, d, self._types)

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


class SignatureTemplateFieldBuilder(object):
    def __init__(self) -> None:
        self._signature_template_field = SignatureTemplateField()

    def field_type(self, field_type: Enum) -> "SignatureTemplateFieldBuilder":
        self._signature_template_field.field_type = field_type
        return self

    def label(self, label: List[I18n]) -> "SignatureTemplateFieldBuilder":
        self._signature_template_field.label = label
        return self

    def common_info(self, common_info: SignatureTemplateCommonFieldInfo) -> "SignatureTemplateFieldBuilder":
        self._signature_template_field.common_info = common_info
        return self

    def combination_info(self,
                         combination_info: SignatureTemplateCombinationFieldInfo) -> "SignatureTemplateFieldBuilder":
        self._signature_template_field.combination_info = combination_info
        return self

    def children(self, children: str) -> "SignatureTemplateFieldBuilder":
        self._signature_template_field.children = children
        return self

    def combination_info_v2(self,
                            combination_info_v2: SignatureTemplateCombinationFieldInfoV2) -> "SignatureTemplateFieldBuilder":
        self._signature_template_field.combination_info_v2 = combination_info_v2
        return self

    def build(self) -> "SignatureTemplateField":
        return self._signature_template_field
