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

from __future__ import annotations
from enum import Enum
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel
from .odds_format import OddsFormat
from .parlay_leg_request import ParlayLegRequest


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

    :cvar PARLAY: "Parlay"
    :vartype PARLAY: str
    :cvar TWOLEGROUNDROBIN: "TwoLegRoundRobin"
    :vartype TWOLEGROUNDROBIN: str
    :cvar THREELEGROUNDROBIN: "ThreeLegRoundRobin"
    :vartype THREELEGROUNDROBIN: str
    :cvar FOURLEGROUNDROBIN: "FourLegRoundRobin"
    :vartype FOURLEGROUNDROBIN: str
    :cvar FIVELEGROUNDROBIN: "FiveLegRoundRobin"
    :vartype FIVELEGROUNDROBIN: str
    :cvar SIXLEGROUNDROBIN: "SixLegRoundRobin"
    :vartype SIXLEGROUNDROBIN: str
    :cvar SEVENLEGROUNDROBIN: "SevenLegRoundRobin"
    :vartype SEVENLEGROUNDROBIN: str
    :cvar EIGHTLEGROUNDROBIN: "EightLegRoundRobin"
    :vartype EIGHTLEGROUNDROBIN: str
    """

    PARLAY = "Parlay"
    TWOLEGROUNDROBIN = "TwoLegRoundRobin"
    THREELEGROUNDROBIN = "ThreeLegRoundRobin"
    FOURLEGROUNDROBIN = "FourLegRoundRobin"
    FIVELEGROUNDROBIN = "FiveLegRoundRobin"
    SIXLEGROUNDROBIN = "SixLegRoundRobin"
    SEVENLEGROUNDROBIN = "SevenLegRoundRobin"
    EIGHTLEGROUNDROBIN = "EightLegRoundRobin"

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

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


@JsonMap(
    {
        "unique_request_id": "uniqueRequestId",
        "accept_better_line": "acceptBetterLine",
        "risk_amount": "riskAmount",
        "odds_format": "oddsFormat",
        "round_robin_options": "roundRobinOptions",
    }
)
class PlaceParlayBetRequest(BaseModel):
    """Request to place a bet

    :param unique_request_id: This unique id of the place bet 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 risk_amount: Amount in client’s currency. It is always risk amount when placing Parlay bets NOTE: If round robin options is used this amount will apply for all parlays so actual amount wagered will be riskAmount X number of Parlays., defaults to None
    :type risk_amount: float, optional
    :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 legs: Collection of parlay legs., defaults to None
    :type legs: List[ParlayLegRequest], optional
    :param round_robin_options: round_robin_options, defaults to None
    :type round_robin_options: List[RoundRobinOptions], optional
    """

    def __init__(
        self,
        unique_request_id: str = None,
        accept_better_line: bool = None,
        risk_amount: float = None,
        odds_format: OddsFormat = None,
        legs: List[ParlayLegRequest] = None,
        round_robin_options: List[RoundRobinOptions] = None,
    ):
        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 risk_amount is not None:
            self.risk_amount = risk_amount
        if odds_format is not None:
            self.odds_format = self._enum_matching(
                odds_format, OddsFormat.list(), "odds_format"
            )
        if legs is not None:
            self.legs = self._define_list(legs, ParlayLegRequest)
        if round_robin_options is not None:
            self.round_robin_options = self._define_list(
                round_robin_options, RoundRobinOptions
            )
