# 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 .location_country import LocationCountry
from .location_state import LocationState
from .location_city import LocationCity
from .location_district import LocationDistrict


class LocationDto(object):
    _types = {
        "country": LocationCountry,
        "state": LocationState,
        "city": LocationCity,
        "district": LocationDistrict,
    }

    def __init__(self, d=None):
        self.country: Optional[LocationCountry] = None
        self.state: Optional[LocationState] = None
        self.city: Optional[LocationCity] = None
        self.district: Optional[LocationDistrict] = None
        init(self, d, self._types)

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


class LocationDtoBuilder(object):
    def __init__(self) -> None:
        self._location_dto = LocationDto()

    def country(self, country: LocationCountry) -> "LocationDtoBuilder":
        self._location_dto.country = country
        return self

    def state(self, state: LocationState) -> "LocationDtoBuilder":
        self._location_dto.state = state
        return self

    def city(self, city: LocationCity) -> "LocationDtoBuilder":
        self._location_dto.city = city
        return self

    def district(self, district: LocationDistrict) -> "LocationDtoBuilder":
        self._location_dto.district = district
        return self

    def build(self) -> "LocationDto":
        return self._location_dto
