# 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 .base_location import BaseLocation
from .base_location import BaseLocation
from .base_location import BaseLocation
from .base_location import BaseLocation


class BaseAddressV2(object):
    _types = {
        "id": str,
        "name": I18n,
        "district": BaseLocation,
        "city": BaseLocation,
        "state": BaseLocation,
        "country": BaseLocation,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.name: Optional[I18n] = None
        self.district: Optional[BaseLocation] = None
        self.city: Optional[BaseLocation] = None
        self.state: Optional[BaseLocation] = None
        self.country: Optional[BaseLocation] = None
        init(self, d, self._types)

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


class BaseAddressV2Builder(object):
    def __init__(self) -> None:
        self._base_address_v2 = BaseAddressV2()

    def id(self, id: str) -> "BaseAddressV2Builder":
        self._base_address_v2.id = id
        return self

    def name(self, name: I18n) -> "BaseAddressV2Builder":
        self._base_address_v2.name = name
        return self

    def district(self, district: BaseLocation) -> "BaseAddressV2Builder":
        self._base_address_v2.district = district
        return self

    def city(self, city: BaseLocation) -> "BaseAddressV2Builder":
        self._base_address_v2.city = city
        return self

    def state(self, state: BaseLocation) -> "BaseAddressV2Builder":
        self._base_address_v2.state = state
        return self

    def country(self, country: BaseLocation) -> "BaseAddressV2Builder":
        self._base_address_v2.country = country
        return self

    def build(self) -> "BaseAddressV2":
        return self._base_address_v2
