#  Rubio - Rubika API library for python
#  Copyright (C) 2025-present Rubio <https://github.com/RubioTeam>
#  Github - https://github.com/RubioTeam/rubio.core


from __future__ import annotations

from typing import Optional, Union
from dataclasses import dataclass
from .config import Object
import rubio.core


@dataclass
class PollStatus(Object):
    """
    **Represents the status of a poll in Rubigram.**
        `from rubio.core.types import PollStatus`

    Attributes:
        state (`Optional[Union[str, rubio.core.enums.PollStatusType]]`):
            Current state of the poll (Open or Closed).

        selection_index (`Optional[int]`):
            Index of the currently selected option (if any).

        percent_vote_options (`Optional[list[int]]`):
            List of vote percentages for each option.

        total_vote (`Optional[int]`):
            Total number of votes cast in the poll.

        show_total_votes (`Optional[bool]`):
            Whether the total votes are visible to users.
    """
    state: Optional[Union[str, rubio.core.enums.PollStatusType]] = None
    selection_index: Optional[int] = None
    percent_vote_options: Optional[list[int]] = None
    total_vote: Optional[int] = None
    show_total_votes: Optional[bool] = None