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

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


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

    :cvar PROCESSED_WITH_ERROR: "PROCESSED_WITH_ERROR"
    :vartype PROCESSED_WITH_ERROR: str
    :cvar VALID: "VALID"
    :vartype VALID: str
    """

    PROCESSED_WITH_ERROR = "PROCESSED_WITH_ERROR"
    VALID = "VALID"

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

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


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

    :cvar CANNOT_PARLAY_LIVE_GAME: "CANNOT_PARLAY_LIVE_GAME"
    :vartype CANNOT_PARLAY_LIVE_GAME: str
    :cvar CORRELATED: "CORRELATED"
    :vartype CORRELATED: str
    :cvar EVENT_NO_LONGER_AVAILABLE_FOR_BETTING: "EVENT_NO_LONGER_AVAILABLE_FOR_BETTING"
    :vartype EVENT_NO_LONGER_AVAILABLE_FOR_BETTING: str
    :cvar EVENT_NOT_OFFERED_FOR_PARLAY: "EVENT_NOT_OFFERED_FOR_PARLAY"
    :vartype EVENT_NOT_OFFERED_FOR_PARLAY: str
    :cvar INVALID_EVENT: "INVALID_EVENT"
    :vartype INVALID_EVENT: str
    :cvar INVALID_LEG_BET_TYPE: "INVALID_LEG_BET_TYPE"
    :vartype INVALID_LEG_BET_TYPE: str
    :cvar INVALID_PARLAY_BET: "INVALID_PARLAY_BET"
    :vartype INVALID_PARLAY_BET: str
    :cvar LINE_CHANGED: "LINE_CHANGED"
    :vartype LINE_CHANGED: str
    :cvar LINE_DOES_NOT_BELONG_TO_EVENT: "LINE_DOES_NOT_BELONG_TO_EVENT"
    :vartype LINE_DOES_NOT_BELONG_TO_EVENT: str
    :cvar ODDS_NO_LONGER_OFFERED_FOR_PARLAY_1: "ODDS_NO_LONGER_OFFERED_FOR_PARLAY_1"
    :vartype ODDS_NO_LONGER_OFFERED_FOR_PARLAY_1: str
    :cvar ODDS_NO_LONGER_OFFERED_FOR_PARLAY_2: "ODDS_NO_LONGER_OFFERED_FOR_PARLAY_2"
    :vartype ODDS_NO_LONGER_OFFERED_FOR_PARLAY_2: str
    :cvar ODDS_NO_LONGER_OFFERED_FOR_PARLAY_3: "ODDS_NO_LONGER_OFFERED_FOR_PARLAY_3"
    :vartype ODDS_NO_LONGER_OFFERED_FOR_PARLAY_3: str
    :cvar OFFLINE_EVENT: "OFFLINE_EVENT"
    :vartype OFFLINE_EVENT: str
    :cvar PAST_CUTOFFTIME: "PAST_CUTOFFTIME"
    :vartype PAST_CUTOFFTIME: str
    :cvar SYSTEM_ERROR_1: "SYSTEM_ERROR_1"
    :vartype SYSTEM_ERROR_1: str
    :cvar SYSTEM_ERROR_2: "SYSTEM_ERROR_2"
    :vartype SYSTEM_ERROR_2: str
    :cvar SYSTEM_ERROR_3: "SYSTEM_ERROR_3"
    :vartype SYSTEM_ERROR_3: str
    :cvar LINE_IS_NOT_AVAILABLE: "LINE_IS_NOT_AVAILABLE"
    :vartype LINE_IS_NOT_AVAILABLE: str
    :cvar PERIOD_IS_DISALLOWED_FOR_SAME_GAME_PARLAY: "PERIOD_IS_DISALLOWED_FOR_SAME_GAME_PARLAY"
    :vartype PERIOD_IS_DISALLOWED_FOR_SAME_GAME_PARLAY: str
    :cvar BETTING_SUSPENDED: "BETTING_SUSPENDED"
    :vartype BETTING_SUSPENDED: str
    """

    CANNOT_PARLAY_LIVE_GAME = "CANNOT_PARLAY_LIVE_GAME"
    CORRELATED = "CORRELATED"
    EVENT_NO_LONGER_AVAILABLE_FOR_BETTING = "EVENT_NO_LONGER_AVAILABLE_FOR_BETTING"
    EVENT_NOT_OFFERED_FOR_PARLAY = "EVENT_NOT_OFFERED_FOR_PARLAY"
    INVALID_EVENT = "INVALID_EVENT"
    INVALID_LEG_BET_TYPE = "INVALID_LEG_BET_TYPE"
    INVALID_PARLAY_BET = "INVALID_PARLAY_BET"
    LINE_CHANGED = "LINE_CHANGED"
    LINE_DOES_NOT_BELONG_TO_EVENT = "LINE_DOES_NOT_BELONG_TO_EVENT"
    ODDS_NO_LONGER_OFFERED_FOR_PARLAY_1 = "ODDS_NO_LONGER_OFFERED_FOR_PARLAY_1"
    ODDS_NO_LONGER_OFFERED_FOR_PARLAY_2 = "ODDS_NO_LONGER_OFFERED_FOR_PARLAY_2"
    ODDS_NO_LONGER_OFFERED_FOR_PARLAY_3 = "ODDS_NO_LONGER_OFFERED_FOR_PARLAY_3"
    OFFLINE_EVENT = "OFFLINE_EVENT"
    PAST_CUTOFFTIME = "PAST_CUTOFFTIME"
    SYSTEM_ERROR_1 = "SYSTEM_ERROR_1"
    SYSTEM_ERROR_2 = "SYSTEM_ERROR_2"
    SYSTEM_ERROR_3 = "SYSTEM_ERROR_3"
    LINE_IS_NOT_AVAILABLE = "LINE_IS_NOT_AVAILABLE"
    PERIOD_IS_DISALLOWED_FOR_SAME_GAME_PARLAY = (
        "PERIOD_IS_DISALLOWED_FOR_SAME_GAME_PARLAY"
    )
    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, ParlayLegResponseErrorCode._member_map_.values())
        )


@JsonMap(
    {
        "error_code": "errorCode",
        "leg_id": "legId",
        "line_id": "lineId",
        "alt_line_id": "altLineId",
        "correlated_legs": "correlatedLegs",
    }
)
class ParlayLegResponse(BaseModel):
    """ParlayLegResponse

    :param status: Status of the request., defaults to None
    :type status: ParlayLegResponseStatus, optional
    :param error_code: When Status is PROCESSED_WITH_ERROR, provides a code indicating the specific problem.<br><br>CANNOT_PARLAY_LIVE_GAME = The wager is placed on Live game,  <br>CORRELATED = The leg is correlated with another one,  <br>EVENT_NO_LONGER_AVAILABLE_FOR_BETTING = The event is no longer offered,  <br>EVENT_NOT_OFFERED_FOR_PARLAY = The event is not offered for parlaying,  <br>INVALID_EVENT = Live betting is not allowed at this moment,  <br>INVALID_LEG_BET_TYPE = Leg bet type is not accepted for parlaying. Accepted values are SPREAD, MONEYLINE, TOTAL_POINTS,  <br>INVALID_PARLAY_BET = The leg did not validated due to error on Parlay Bet. Check the error PlaceParlayBet response for error details,  <br>LINE_CHANGED = Bet is submitted on a line that has changed,  <br>LINE_DOES_NOT_BELONG_TO_EVENT = LineId does not match the EventId specified in the request,  <br>LISTED_PITCHERS_SELECTION_ERROR = If bet was submitted with pitcher1MustStart and/or pitcher2MustStart parameters with values that are not allowed,  <br>ODDS_NO_LONGER_OFFERED_FOR_PARLAY_1 = Due to line change odds are not offered for parlaying,   <br>ODDS_NO_LONGER_OFFERED_FOR_PARLAY_2 = Due to line change odds are not offered for parlaying,   <br>ODDS_NO_LONGER_OFFERED_FOR_PARLAY_3 = Due to line change odds are not offered for parlaying,   <br>OFFLINE_EVENT = Bet is submitted on an event that is offline or with incorrect lineId,  <br>PAST_CUTOFFTIME = Bet is submitted on a game after the betting cutoff time,   <br>SYSTEM_ERROR_1 = Unexpected error,  <br>SYSTEM_ERROR_2 = Unexpected error,  <br>SYSTEM_ERROR_3 = Unexpected error,  <br>LINE_IS_NOT_AVAILABLE = Line is not available for the specified Parlay Leg,  <br>PERIOD_IS_DISALLOWED_FOR_SAME_GAME_PARLAY = Period is not allowed to be parlayed on a same event, <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: ParlayLegResponseErrorCode, optional
    :param leg_id: Echo of the legId from the request., defaults to None
    :type leg_id: str, optional
    :param line_id: Line identification that bet was placed on., defaults to None
    :type line_id: int, optional
    :param alt_line_id: If bet was accepted on alternate line, the altLineId will be returned., defaults to None
    :type alt_line_id: int, optional
    :param price: Price that the bet was placed on., defaults to None
    :type price: float, optional
    :param correlated_legs: If errorCode is CORRELATED will contain legIds of all correlated legs., defaults to None
    :type correlated_legs: List[str], optional
    """

    def __init__(
        self,
        status: ParlayLegResponseStatus = None,
        error_code: ParlayLegResponseErrorCode = None,
        leg_id: str = None,
        line_id: int = None,
        alt_line_id: int = None,
        price: float = None,
        correlated_legs: List[str] = None,
    ):
        if status is not None:
            self.status = self._enum_matching(
                status, ParlayLegResponseStatus.list(), "status"
            )
        if error_code is not None:
            self.error_code = self._enum_matching(
                error_code, ParlayLegResponseErrorCode.list(), "error_code"
            )
        if leg_id is not None:
            self.leg_id = leg_id
        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 price is not None:
            self.price = price
        if correlated_legs is not None:
            self.correlated_legs = correlated_legs
