# 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 .chat_pin_icon import ChatPinIcon
from .i18n_names import I18nNames


class UrlPin(object):
    _types = {
        "url": str,
        "icon": ChatPinIcon,
        "title": str,
        "i18n_title": I18nNames,
        "title_dynamic_update": bool,
        "icon_dynamic_update": bool,
    }

    def __init__(self, d=None):
        self.url: Optional[str] = None
        self.icon: Optional[ChatPinIcon] = None
        self.title: Optional[str] = None
        self.i18n_title: Optional[I18nNames] = None
        self.title_dynamic_update: Optional[bool] = None
        self.icon_dynamic_update: Optional[bool] = None
        init(self, d, self._types)

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


class UrlPinBuilder(object):
    def __init__(self) -> None:
        self._url_pin = UrlPin()

    def url(self, url: str) -> "UrlPinBuilder":
        self._url_pin.url = url
        return self

    def icon(self, icon: ChatPinIcon) -> "UrlPinBuilder":
        self._url_pin.icon = icon
        return self

    def title(self, title: str) -> "UrlPinBuilder":
        self._url_pin.title = title
        return self

    def i18n_title(self, i18n_title: I18nNames) -> "UrlPinBuilder":
        self._url_pin.i18n_title = i18n_title
        return self

    def title_dynamic_update(self, title_dynamic_update: bool) -> "UrlPinBuilder":
        self._url_pin.title_dynamic_update = title_dynamic_update
        return self

    def icon_dynamic_update(self, icon_dynamic_update: bool) -> "UrlPinBuilder":
        self._url_pin.icon_dynamic_update = icon_dynamic_update
        return self

    def build(self) -> "UrlPin":
        return self._url_pin
