# 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 .open_app_feed_card_url import OpenAppFeedCardUrl
from .open_app_feed_card_text import OpenAppFeedCardText


class OpenAppFeedCardButton(object):
    _types = {
        "multi_url": OpenAppFeedCardUrl,
        "action_type": str,
        "text": OpenAppFeedCardText,
        "button_type": str,
        "action_map": Dict[str, str],
    }

    def __init__(self, d=None):
        self.multi_url: Optional[OpenAppFeedCardUrl] = None
        self.action_type: Optional[str] = None
        self.text: Optional[OpenAppFeedCardText] = None
        self.button_type: Optional[str] = None
        self.action_map: Optional[Dict[str, str]] = None
        init(self, d, self._types)

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


class OpenAppFeedCardButtonBuilder(object):
    def __init__(self) -> None:
        self._open_app_feed_card_button = OpenAppFeedCardButton()

    def multi_url(self, multi_url: OpenAppFeedCardUrl) -> "OpenAppFeedCardButtonBuilder":
        self._open_app_feed_card_button.multi_url = multi_url
        return self

    def action_type(self, action_type: str) -> "OpenAppFeedCardButtonBuilder":
        self._open_app_feed_card_button.action_type = action_type
        return self

    def text(self, text: OpenAppFeedCardText) -> "OpenAppFeedCardButtonBuilder":
        self._open_app_feed_card_button.text = text
        return self

    def button_type(self, button_type: str) -> "OpenAppFeedCardButtonBuilder":
        self._open_app_feed_card_button.button_type = button_type
        return self

    def action_map(self, action_map: Dict[str, str]) -> "OpenAppFeedCardButtonBuilder":
        self._open_app_feed_card_button.action_map = action_map
        return self

    def build(self) -> "OpenAppFeedCardButton":
        return self._open_app_feed_card_button
