# 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


class BaseLocation(object):
    _types = {
        "name": I18n,
        "code": str,
        "location_type": int,
    }

    def __init__(self, d=None):
        self.name: Optional[I18n] = None
        self.code: Optional[str] = None
        self.location_type: Optional[int] = None
        init(self, d, self._types)

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


class BaseLocationBuilder(object):
    def __init__(self) -> None:
        self._base_location = BaseLocation()

    def name(self, name: I18n) -> "BaseLocationBuilder":
        self._base_location.name = name
        return self

    def code(self, code: str) -> "BaseLocationBuilder":
        self._base_location.code = code
        return self

    def location_type(self, location_type: int) -> "BaseLocationBuilder":
        self._base_location.location_type = location_type
        return self

    def build(self) -> "BaseLocation":
        return self._base_location
