# This file was generated by liblab | https://liblab.com/

from enum import Enum
from .utils.json_map import JsonMap
from .base import BaseModel


class ManualBetBetStatus(Enum):
    """An enumeration representing different categories.

    :cvar ACCEPTED: "ACCEPTED"
    :vartype ACCEPTED: str
    :cvar CANCELLED: "CANCELLED"
    :vartype CANCELLED: str
    :cvar LOSE: "LOSE"
    :vartype LOSE: str
    :cvar REFUNDED: "REFUNDED"
    :vartype REFUNDED: str
    :cvar WON: "WON"
    :vartype WON: str
    """

    ACCEPTED = "ACCEPTED"
    CANCELLED = "CANCELLED"
    LOSE = "LOSE"
    REFUNDED = "REFUNDED"
    WON = "WON"

    def list():
        """Lists all category values.

        :return: A list of all category values.
        :rtype: list
        """
        return list(map(lambda x: x.value, ManualBetBetStatus._member_map_.values()))


@JsonMap(
    {
        "bet_id": "betId",
        "wager_number": "wagerNumber",
        "placed_at": "placedAt",
        "bet_status": "betStatus",
        "bet_type": "betType",
        "win_loss": "winLoss",
        "update_sequence": "updateSequence",
        "reference_bet_id": "referenceBetId",
    }
)
class ManualBet(BaseModel):
    """ManualBet

    :param bet_id: Bet identification
    :type bet_id: int
    :param wager_number: Wager identification. All bets placed thru the API will have value 1. Website Classic view supports multiple contest(special) bets placement in the same bet slip in that case the bet would have appropriate wager number, as well as all round robin parlay bets.
    :type wager_number: int
    :param placed_at: Date time when the bet was placed.
    :type placed_at: str
    :param bet_status: Bet Status. <br><br>ACCEPTED = Bet was accepted,  <br>CANCELLED = Bet is cancelled as per Pinnacle betting rules,  <br>LOSE = The bet is settled as lose,  <br>REFUNDED = When an event is cancelled or when the bet is settled as push, the bet will have REFUNDED status,  <br>WON = The bet is settled as won <br>
    :type bet_status: ManualBetBetStatus
    :param bet_type: bet_type
    :type bet_type: str
    :param win: Win amount.
    :type win: float
    :param risk: Risk amount.
    :type risk: float
    :param win_loss: Win-Loss for settled bets., defaults to None
    :type win_loss: float, optional
    :param update_sequence: Update Sequence
    :type update_sequence: int
    :param description: Manual bet description.
    :type description: str
    :param reference_bet_id: Referenced original bet id., defaults to None
    :type reference_bet_id: int, optional
    """

    def __init__(
        self,
        bet_id: int,
        wager_number: int,
        placed_at: str,
        bet_status: ManualBetBetStatus,
        bet_type: str,
        win: float,
        risk: float,
        update_sequence: int,
        description: str,
        win_loss: float = None,
        reference_bet_id: int = None,
    ):
        self.bet_id = bet_id
        self.wager_number = wager_number
        self.placed_at = placed_at
        self.bet_status = self._enum_matching(
            bet_status, ManualBetBetStatus.list(), "bet_status"
        )
        self.bet_type = bet_type
        self.win = win
        self.risk = risk
        if win_loss is not None:
            self.win_loss = win_loss
        self.update_sequence = update_sequence
        self.description = description
        if reference_bet_id is not None:
            self.reference_bet_id = reference_bet_id
