# 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 .text_element_style import TextElementStyle


class InlineLinkPreview(object):
    _types = {
        "title": str,
        "url": str,
        "url_type": str,
        "text_element_style": TextElementStyle,
    }

    def __init__(self, d=None):
        self.title: Optional[str] = None
        self.url: Optional[str] = None
        self.url_type: Optional[str] = None
        self.text_element_style: Optional[TextElementStyle] = None
        init(self, d, self._types)

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


class InlineLinkPreviewBuilder(object):
    def __init__(self) -> None:
        self._inline_link_preview = InlineLinkPreview()

    def title(self, title: str) -> "InlineLinkPreviewBuilder":
        self._inline_link_preview.title = title
        return self

    def url(self, url: str) -> "InlineLinkPreviewBuilder":
        self._inline_link_preview.url = url
        return self

    def url_type(self, url_type: str) -> "InlineLinkPreviewBuilder":
        self._inline_link_preview.url_type = url_type
        return self

    def text_element_style(self, text_element_style: TextElementStyle) -> "InlineLinkPreviewBuilder":
        self._inline_link_preview.text_element_style = text_element_style
        return self

    def build(self) -> "InlineLinkPreview":
        return self._inline_link_preview
