# 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_string import I18nString
from .i18n_string import I18nString
from .enum import Enum
from .language import Language
from .language import Language
from .time_zone import TimeZone


class CountryRegion(object):
    _types = {
        "id": str,
        "update_by": str,
        "create_by": str,
        "update_time": str,
        "create_time": str,
        "alpha_3_code": str,
        "alpha_2_code": str,
        "numeric_code": str,
        "name": I18nString,
        "local_script": str,
        "western_script": str,
        "mdm_code": str,
        "full_name": I18nString,
        "global_code": str,
        "time_zone": List[str],
        "overseas": str,
        "level": str,
        "remark": str,
        "update_reason": str,
        "status": str,
        "continents": Enum,
        "md_local_script": Language,
        "md_western_script": Language,
        "md_time_zone": List[TimeZone],
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.update_by: Optional[str] = None
        self.create_by: Optional[str] = None
        self.update_time: Optional[str] = None
        self.create_time: Optional[str] = None
        self.alpha_3_code: Optional[str] = None
        self.alpha_2_code: Optional[str] = None
        self.numeric_code: Optional[str] = None
        self.name: Optional[I18nString] = None
        self.local_script: Optional[str] = None
        self.western_script: Optional[str] = None
        self.mdm_code: Optional[str] = None
        self.full_name: Optional[I18nString] = None
        self.global_code: Optional[str] = None
        self.time_zone: Optional[List[str]] = None
        self.overseas: Optional[str] = None
        self.level: Optional[str] = None
        self.remark: Optional[str] = None
        self.update_reason: Optional[str] = None
        self.status: Optional[str] = None
        self.continents: Optional[Enum] = None
        self.md_local_script: Optional[Language] = None
        self.md_western_script: Optional[Language] = None
        self.md_time_zone: Optional[List[TimeZone]] = None
        init(self, d, self._types)

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


class CountryRegionBuilder(object):
    def __init__(self) -> None:
        self._country_region = CountryRegion()

    def id(self, id: str) -> "CountryRegionBuilder":
        self._country_region.id = id
        return self

    def update_by(self, update_by: str) -> "CountryRegionBuilder":
        self._country_region.update_by = update_by
        return self

    def create_by(self, create_by: str) -> "CountryRegionBuilder":
        self._country_region.create_by = create_by
        return self

    def update_time(self, update_time: str) -> "CountryRegionBuilder":
        self._country_region.update_time = update_time
        return self

    def create_time(self, create_time: str) -> "CountryRegionBuilder":
        self._country_region.create_time = create_time
        return self

    def alpha_3_code(self, alpha_3_code: str) -> "CountryRegionBuilder":
        self._country_region.alpha_3_code = alpha_3_code
        return self

    def alpha_2_code(self, alpha_2_code: str) -> "CountryRegionBuilder":
        self._country_region.alpha_2_code = alpha_2_code
        return self

    def numeric_code(self, numeric_code: str) -> "CountryRegionBuilder":
        self._country_region.numeric_code = numeric_code
        return self

    def name(self, name: I18nString) -> "CountryRegionBuilder":
        self._country_region.name = name
        return self

    def local_script(self, local_script: str) -> "CountryRegionBuilder":
        self._country_region.local_script = local_script
        return self

    def western_script(self, western_script: str) -> "CountryRegionBuilder":
        self._country_region.western_script = western_script
        return self

    def mdm_code(self, mdm_code: str) -> "CountryRegionBuilder":
        self._country_region.mdm_code = mdm_code
        return self

    def full_name(self, full_name: I18nString) -> "CountryRegionBuilder":
        self._country_region.full_name = full_name
        return self

    def global_code(self, global_code: str) -> "CountryRegionBuilder":
        self._country_region.global_code = global_code
        return self

    def time_zone(self, time_zone: List[str]) -> "CountryRegionBuilder":
        self._country_region.time_zone = time_zone
        return self

    def overseas(self, overseas: str) -> "CountryRegionBuilder":
        self._country_region.overseas = overseas
        return self

    def level(self, level: str) -> "CountryRegionBuilder":
        self._country_region.level = level
        return self

    def remark(self, remark: str) -> "CountryRegionBuilder":
        self._country_region.remark = remark
        return self

    def update_reason(self, update_reason: str) -> "CountryRegionBuilder":
        self._country_region.update_reason = update_reason
        return self

    def status(self, status: str) -> "CountryRegionBuilder":
        self._country_region.status = status
        return self

    def continents(self, continents: Enum) -> "CountryRegionBuilder":
        self._country_region.continents = continents
        return self

    def md_local_script(self, md_local_script: Language) -> "CountryRegionBuilder":
        self._country_region.md_local_script = md_local_script
        return self

    def md_western_script(self, md_western_script: Language) -> "CountryRegionBuilder":
        self._country_region.md_western_script = md_western_script
        return self

    def md_time_zone(self, md_time_zone: List[TimeZone]) -> "CountryRegionBuilder":
        self._country_region.md_time_zone = md_time_zone
        return self

    def build(self) -> "CountryRegion":
        return self._country_region
