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

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


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

    :cvar ACCEPTED: "ACCEPTED"
    :vartype ACCEPTED: str
    :cvar PENDING_ACCEPTANCE: "PENDING_ACCEPTANCE"
    :vartype PENDING_ACCEPTANCE: str
    :cvar PROCESSED_WITH_ERROR: "PROCESSED_WITH_ERROR"
    :vartype PROCESSED_WITH_ERROR: str
    """

    ACCEPTED = "ACCEPTED"
    PENDING_ACCEPTANCE = "PENDING_ACCEPTANCE"
    PROCESSED_WITH_ERROR = "PROCESSED_WITH_ERROR"

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

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


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

    :cvar ALL_BETTING_CLOSED: "ALL_BETTING_CLOSED"
    :vartype ALL_BETTING_CLOSED: str
    :cvar ALL_LIVE_BETTING_CLOSED: "ALL_LIVE_BETTING_CLOSED"
    :vartype ALL_LIVE_BETTING_CLOSED: str
    :cvar ABOVE_EVENT_MAX: "ABOVE_EVENT_MAX"
    :vartype ABOVE_EVENT_MAX: str
    :cvar ABOVE_MAX_BET_AMOUNT: "ABOVE_MAX_BET_AMOUNT"
    :vartype ABOVE_MAX_BET_AMOUNT: str
    :cvar BELOW_MIN_BET_AMOUNT: "BELOW_MIN_BET_AMOUNT"
    :vartype BELOW_MIN_BET_AMOUNT: str
    :cvar BLOCKED_BETTING: "BLOCKED_BETTING"
    :vartype BLOCKED_BETTING: str
    :cvar BLOCKED_CLIENT: "BLOCKED_CLIENT"
    :vartype BLOCKED_CLIENT: str
    :cvar INSUFFICIENT_FUNDS: "INSUFFICIENT_FUNDS"
    :vartype INSUFFICIENT_FUNDS: str
    :cvar INVALID_COUNTRY: "INVALID_COUNTRY"
    :vartype INVALID_COUNTRY: str
    :cvar INVALID_EVENT: "INVALID_EVENT"
    :vartype INVALID_EVENT: str
    :cvar INVALID_ODDS_FORMAT: "INVALID_ODDS_FORMAT"
    :vartype INVALID_ODDS_FORMAT: str
    :cvar LINE_CHANGED: "LINE_CHANGED"
    :vartype LINE_CHANGED: str
    :cvar LISTED_PITCHERS_SELECTION_ERROR: "LISTED_PITCHERS_SELECTION_ERROR"
    :vartype LISTED_PITCHERS_SELECTION_ERROR: str
    :cvar OFFLINE_EVENT: "OFFLINE_EVENT"
    :vartype OFFLINE_EVENT: str
    :cvar PAST_CUTOFFTIME: "PAST_CUTOFFTIME"
    :vartype PAST_CUTOFFTIME: str
    :cvar RED_CARDS_CHANGED: "RED_CARDS_CHANGED"
    :vartype RED_CARDS_CHANGED: str
    :cvar SCORE_CHANGED: "SCORE_CHANGED"
    :vartype SCORE_CHANGED: str
    :cvar TIME_RESTRICTION: "TIME_RESTRICTION"
    :vartype TIME_RESTRICTION: str
    :cvar DUPLICATED_REQUEST: "DUPLICATED_REQUEST"
    :vartype DUPLICATED_REQUEST: str
    :cvar INCOMPLETE_CUSTOMER_BETTING_PROFILE: "INCOMPLETE_CUSTOMER_BETTING_PROFILE"
    :vartype INCOMPLETE_CUSTOMER_BETTING_PROFILE: str
    :cvar INVALID_CUSTOMER_PROFILE: "INVALID_CUSTOMER_PROFILE"
    :vartype INVALID_CUSTOMER_PROFILE: str
    :cvar LIMITS_CONFIGURATION_ISSUE: "LIMITS_CONFIGURATION_ISSUE"
    :vartype LIMITS_CONFIGURATION_ISSUE: str
    :cvar RESPONSIBLE_BETTING_LOSS_LIMIT_EXCEEDED: "RESPONSIBLE_BETTING_LOSS_LIMIT_EXCEEDED"
    :vartype RESPONSIBLE_BETTING_LOSS_LIMIT_EXCEEDED: str
    :cvar RESPONSIBLE_BETTING_RISK_LIMIT_EXCEEDED: "RESPONSIBLE_BETTING_RISK_LIMIT_EXCEEDED"
    :vartype RESPONSIBLE_BETTING_RISK_LIMIT_EXCEEDED: str
    :cvar SYSTEM_ERROR_3: "SYSTEM_ERROR_3"
    :vartype SYSTEM_ERROR_3: str
    :cvar LICENCE_RESTRICTION_LIVE_BETTING_BLOCKED: "LICENCE_RESTRICTION_LIVE_BETTING_BLOCKED"
    :vartype LICENCE_RESTRICTION_LIVE_BETTING_BLOCKED: str
    :cvar BETTING_SUSPENDED: "BETTING_SUSPENDED"
    :vartype BETTING_SUSPENDED: str
    """

    ALL_BETTING_CLOSED = "ALL_BETTING_CLOSED"
    ALL_LIVE_BETTING_CLOSED = "ALL_LIVE_BETTING_CLOSED"
    ABOVE_EVENT_MAX = "ABOVE_EVENT_MAX"
    ABOVE_MAX_BET_AMOUNT = "ABOVE_MAX_BET_AMOUNT"
    BELOW_MIN_BET_AMOUNT = "BELOW_MIN_BET_AMOUNT"
    BLOCKED_BETTING = "BLOCKED_BETTING"
    BLOCKED_CLIENT = "BLOCKED_CLIENT"
    INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS"
    INVALID_COUNTRY = "INVALID_COUNTRY"
    INVALID_EVENT = "INVALID_EVENT"
    INVALID_ODDS_FORMAT = "INVALID_ODDS_FORMAT"
    LINE_CHANGED = "LINE_CHANGED"
    LISTED_PITCHERS_SELECTION_ERROR = "LISTED_PITCHERS_SELECTION_ERROR"
    OFFLINE_EVENT = "OFFLINE_EVENT"
    PAST_CUTOFFTIME = "PAST_CUTOFFTIME"
    RED_CARDS_CHANGED = "RED_CARDS_CHANGED"
    SCORE_CHANGED = "SCORE_CHANGED"
    TIME_RESTRICTION = "TIME_RESTRICTION"
    DUPLICATED_REQUEST = "DUPLICATED_REQUEST"
    INCOMPLETE_CUSTOMER_BETTING_PROFILE = "INCOMPLETE_CUSTOMER_BETTING_PROFILE"
    INVALID_CUSTOMER_PROFILE = "INVALID_CUSTOMER_PROFILE"
    LIMITS_CONFIGURATION_ISSUE = "LIMITS_CONFIGURATION_ISSUE"
    RESPONSIBLE_BETTING_LOSS_LIMIT_EXCEEDED = "RESPONSIBLE_BETTING_LOSS_LIMIT_EXCEEDED"
    RESPONSIBLE_BETTING_RISK_LIMIT_EXCEEDED = "RESPONSIBLE_BETTING_RISK_LIMIT_EXCEEDED"
    SYSTEM_ERROR_3 = "SYSTEM_ERROR_3"
    LICENCE_RESTRICTION_LIVE_BETTING_BLOCKED = (
        "LICENCE_RESTRICTION_LIVE_BETTING_BLOCKED"
    )
    BETTING_SUSPENDED = "BETTING_SUSPENDED"

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

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


@JsonMap(
    {
        "error_code": "errorCode",
        "unique_request_id": "uniqueRequestId",
        "bet_id": "betId",
        "better_line_was_accepted": "betterLineWasAccepted",
    }
)
class PlaceStraightBetResponse(BaseModel):
    """PlaceStraightBetResponse

    :param status: Status of the response., defaults to None
    :type status: PlaceStraightBetResponseStatus, optional
    :param error_code: If Status is PROCESSED_WITH_ERROR, errorCode will be in the response. <br><br>ALL_BETTING_CLOSED = Betting is not allowed at this moment. This may happen during system maintenance,  <br>ALL_LIVE_BETTING_CLOSED = Live betting is not allowed at this moment. This may happen during system maintenance,  <br>ABOVE_EVENT_MAX = Bet cannot be placed because client exceeded allowed maximum of risk on a line,  <br>ABOVE_MAX_BET_AMOUNT = Stake is above allowed maximum amount,   <br>BELOW_MIN_BET_AMOUNT = Stake is below allowed minimum amount,  <br>BLOCKED_BETTING = Betting is suspended for the client,  <br>BLOCKED_CLIENT = Client is no longer active,   <br>INSUFFICIENT_FUNDS = Bet is submitted by a client with insufficient funds,  <br>INVALID_COUNTRY = Client country is not allowed for betting,  <br>INVALID_EVENT = Invalid eventid,  <br>INVALID_ODDS_FORMAT = If a bet was submitted with the odds format that is not allowed for the client,  <br>LINE_CHANGED = Bet is submitted on a line that has changed,  <br>OFFLINE_EVENT = Bet is submitted on an event that is offline or the submitted line is not offered at the moment due to points/handicap change or the submitted bet type is just not offered at the moment,  <br>PAST_CUTOFFTIME = Bet is submitted on a game after the betting cutoff time,  <br>RED_CARDS_CHANGED = Bet is submitted on a live soccer event with changed red card count,  <br>SCORE_CHANGED = Bet is submitted on a live soccer event with changed score,  <br>TIME_RESTRICTION = Bet is submitted within too short of a period from the same bet previously placed by a client,  <br>DUPLICATED_REQUEST = Request with the same uniqueRequestId was already processed. Please set the new value if you still want the request to be processed,  <br>INCOMPLETE_CUSTOMER_BETTING_PROFILE = System configuration issue,  <br>INVALID_CUSTOMER_PROFILE = System configuration issue,  <br>LIMITS_CONFIGURATION_ISSUE = System configuration issue,  <br>RESPONSIBLE_BETTING_LOSS_LIMIT_EXCEEDED = Client has reached his total loss limit,  <br>RESPONSIBLE_BETTING_RISK_LIMIT_EXCEEDED = Client has reached his total risk limit,  <br>SYSTEM_ERROR_3 = Unexpected error,  <br>LICENCE_RESTRICTION_LIVE_BETTING_BLOCKED - Live betting blocked due to licence restrictions, <br>BETTING_SUSPENDED - Due to anomalous market circumstances bets are not currently being accepted on this line. Try again with next LineId.<br>, defaults to None
    :type error_code: PlaceStraightBetResponseErrorCode, optional
    :param unique_request_id: Echo of the uniqueRequestId from the request., defaults to None
    :type unique_request_id: str, optional
    :param bet_id: Bet identification. Populated in case of accepted bet., defaults to None
    :type bet_id: int, optional
    :param win: Win amount. Populated in case of accepted bet., defaults to None
    :type win: float, optional
    :param risk: Risk amount.  Populated in case of accepted bet., defaults to None
    :type risk: float, optional
    :param price: Bet price. Populated in case of accepted bet., defaults to None
    :type price: float, optional
    :param better_line_was_accepted: Whether or not the bet was accepted on the line that changed in favour of client. This can be true only if `acceptBetterLine` in the Place Bet request is set to TRUE., defaults to None
    :type better_line_was_accepted: bool, optional
    """

    def __init__(
        self,
        status: PlaceStraightBetResponseStatus = None,
        error_code: PlaceStraightBetResponseErrorCode = None,
        unique_request_id: str = None,
        bet_id: int = None,
        win: float = None,
        risk: float = None,
        price: float = None,
        better_line_was_accepted: bool = None,
    ):
        if status is not None:
            self.status = self._enum_matching(
                status, PlaceStraightBetResponseStatus.list(), "status"
            )
        if error_code is not None:
            self.error_code = self._enum_matching(
                error_code, PlaceStraightBetResponseErrorCode.list(), "error_code"
            )
        if unique_request_id is not None:
            self.unique_request_id = unique_request_id
        if bet_id is not None:
            self.bet_id = bet_id
        if win is not None:
            self.win = win
        if risk is not None:
            self.risk = risk
        if price is not None:
            self.price = price
        if better_line_was_accepted is not None:
            self.better_line_was_accepted = better_line_was_accepted
