# Copyright (C) 2015-2024 by Vd.
# This file is part of Rocketgram, the modern Telegram bot framework.
# Rocketgram is released under the MIT License (see LICENSE).


from dataclasses import dataclass
from typing import Union

from . import user_chat_boosts
from .request import Request
from ..context import context


@dataclass(frozen=True)
class GetUserChatBoosts(Request):
    """\
    Represents GetUserChatBoosts request object:
    https://core.telegram.org/bots/api#getuserchatboosts
    """

    chat_id: Union[int, str]
    user_id: int

    def parse_result(self, data) -> 'user_chat_boosts.UserChatBoosts':
        assert isinstance(data, dict), "Should be dict."
        return user_chat_boosts.UserChatBoosts.parse(data)

    async def send(self) -> 'user_chat_boosts.UserChatBoosts':
        res = await context.bot.send(self)
        return res.result
