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

from __future__ import annotations
from enum import Enum
from .utils.json_map import JsonMap
from .base import BaseModel
from .odds_format import OddsFormat


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

    :cvar WIN: "WIN"
    :vartype WIN: str
    :cvar RISK: "RISK"
    :vartype RISK: str
    """

    WIN = "WIN"
    RISK = "RISK"

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

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


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

    :cvar NORMAL: "NORMAL"
    :vartype NORMAL: str
    :cvar FILLANDKILL: "FILLANDKILL"
    :vartype FILLANDKILL: str
    :cvar FILLMAXLIMIT: "FILLMAXLIMIT"
    :vartype FILLMAXLIMIT: str
    """

    NORMAL = "NORMAL"
    FILLANDKILL = "FILLANDKILL"
    FILLMAXLIMIT = "FILLMAXLIMIT"

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

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


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

    :cvar MONEYLINE: "MONEYLINE"
    :vartype MONEYLINE: str
    :cvar TEAM_TOTAL_POINTS: "TEAM_TOTAL_POINTS"
    :vartype TEAM_TOTAL_POINTS: str
    :cvar SPREAD: "SPREAD"
    :vartype SPREAD: str
    :cvar TOTAL_POINTS: "TOTAL_POINTS"
    :vartype TOTAL_POINTS: str
    """

    MONEYLINE = "MONEYLINE"
    TEAM_TOTAL_POINTS = "TEAM_TOTAL_POINTS"
    SPREAD = "SPREAD"
    TOTAL_POINTS = "TOTAL_POINTS"

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

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


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

    :cvar TEAM1: "TEAM1"
    :vartype TEAM1: str
    :cvar TEAM2: "TEAM2"
    :vartype TEAM2: str
    :cvar DRAW: "DRAW"
    :vartype DRAW: str
    """

    TEAM1 = "TEAM1"
    TEAM2 = "TEAM2"
    DRAW = "DRAW"

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

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


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

    :cvar OVER: "OVER"
    :vartype OVER: str
    :cvar UNDER: "UNDER"
    :vartype UNDER: str
    """

    OVER = "OVER"
    UNDER = "UNDER"

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

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


@JsonMap(
    {
        "odds_format": "oddsFormat",
        "unique_request_id": "uniqueRequestId",
        "accept_better_line": "acceptBetterLine",
        "win_risk_stake": "winRiskStake",
        "line_id": "lineId",
        "alt_line_id": "altLineId",
        "fill_type": "fillType",
        "sport_id": "sportId",
        "event_id": "eventId",
        "period_number": "periodNumber",
        "bet_type": "betType",
    }
)
class PlaceBetRequest(BaseModel):
    """Request to place a bet.

    :param odds_format: Bet odds format.  <br>AMERICAN = American odds format,  <br>DECIMAL = Decimal (European) odds format,  <br>HONGKONG = Hong Kong odds format,  <br>INDONESIAN = Indonesian odds format,  <br>MALAY = Malaysian odds format <br>, defaults to None
    :type odds_format: OddsFormat, optional
    :param unique_request_id: This is a Unique ID for PlaceBet requests. This is to support idempotent requests., defaults to None
    :type unique_request_id: str, optional
    :param accept_better_line: Whether or not to accept a bet when there is a line change in favor of the client., defaults to None
    :type accept_better_line: bool, optional
    :param stake: amount in client’s currency., defaults to None
    :type stake: float, optional
    :param win_risk_stake: Whether the stake amount is risk or win amount., defaults to None
    :type win_risk_stake: PlaceBetRequestWinRiskStake, optional
    :param line_id: Line identification., defaults to None
    :type line_id: int, optional
    :param alt_line_id: Alternate line identification., defaults to None
    :type alt_line_id: int, optional
    :param fill_type: NORMAL - bet will be placed on specified stake.  <br>FILLANDKILL - If the stake is over the max limit, bet will be placed on max limit, otherwise it will be placed on specified stake.  <br>FILLMAXLIMIT - bet will be places on max limit, stake amount will be ignored. Please note that maximum limits can change at any moment, which may result in risking more than anticipated. This option is replacement of isMaxStakeBet from v1/bets/place'<br>, defaults to None
    :type fill_type: FillType, optional
    :param sport_id: sport_id, defaults to None
    :type sport_id: int, optional
    :param event_id: event_id, defaults to None
    :type event_id: int, optional
    :param period_number: period_number, defaults to None
    :type period_number: int, optional
    :param bet_type: Bet type., defaults to None
    :type bet_type: PlaceBetRequestBetType, optional
    :param team: Team type., defaults to None
    :type team: Team, optional
    :param side: Side type., defaults to None
    :type side: PlaceBetRequestSide, optional
    """

    def __init__(
        self,
        odds_format: OddsFormat = None,
        unique_request_id: str = None,
        accept_better_line: bool = None,
        stake: float = None,
        win_risk_stake: PlaceBetRequestWinRiskStake = None,
        line_id: int = None,
        alt_line_id: int = None,
        fill_type: FillType = None,
        sport_id: int = None,
        event_id: int = None,
        period_number: int = None,
        bet_type: PlaceBetRequestBetType = None,
        team: Team = None,
        side: PlaceBetRequestSide = None,
    ):
        if odds_format is not None:
            self.odds_format = self._enum_matching(
                odds_format, OddsFormat.list(), "odds_format"
            )
        if unique_request_id is not None:
            self.unique_request_id = unique_request_id
        if accept_better_line is not None:
            self.accept_better_line = accept_better_line
        if stake is not None:
            self.stake = stake
        if win_risk_stake is not None:
            self.win_risk_stake = self._enum_matching(
                win_risk_stake, PlaceBetRequestWinRiskStake.list(), "win_risk_stake"
            )
        if line_id is not None:
            self.line_id = line_id
        if alt_line_id is not None:
            self.alt_line_id = alt_line_id
        if fill_type is not None:
            self.fill_type = self._enum_matching(
                fill_type, FillType.list(), "fill_type"
            )
        if sport_id is not None:
            self.sport_id = sport_id
        if event_id is not None:
            self.event_id = event_id
        if period_number is not None:
            self.period_number = period_number
        if bet_type is not None:
            self.bet_type = self._enum_matching(
                bet_type, PlaceBetRequestBetType.list(), "bet_type"
            )
        if team is not None:
            self.team = self._enum_matching(team, Team.list(), "team")
        if side is not None:
            self.side = self._enum_matching(side, PlaceBetRequestSide.list(), "side")
