# 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 .game_linescore import GameLinescore


@JsonMap(
    {
        "abstract_game_state": "abstractGameState",
        "coded_game_state": "codedGameState",
        "detailed_state": "detailedState",
        "status_code": "statusCode",
        "start_time_tbd": "startTimeTBD",
    }
)
class ScheduleGameStatus(BaseModel):
    """ScheduleGameStatus

    :param abstract_game_state: abstract_game_state, defaults to None
    :type abstract_game_state: str, optional
    :param coded_game_state: coded_game_state, defaults to None
    :type coded_game_state: str, optional
    :param detailed_state: detailed_state, defaults to None
    :type detailed_state: str, optional
    :param status_code: status_code, defaults to None
    :type status_code: str, optional
    :param start_time_tbd: start_time_tbd, defaults to None
    :type start_time_tbd: bool, optional
    """

    def __init__(
        self,
        abstract_game_state: str = None,
        coded_game_state: str = None,
        detailed_state: str = None,
        status_code: str = None,
        start_time_tbd: bool = None,
    ):
        if abstract_game_state is not None:
            self.abstract_game_state = abstract_game_state
        if coded_game_state is not None:
            self.coded_game_state = coded_game_state
        if detailed_state is not None:
            self.detailed_state = detailed_state
        if status_code is not None:
            self.status_code = status_code
        if start_time_tbd is not None:
            self.start_time_tbd = start_time_tbd


@JsonMap({"type_": "type"})
class AwayLeagueRecord2(BaseModel):
    """AwayLeagueRecord2

    :param wins: wins, defaults to None
    :type wins: float, optional
    :param losses: losses, defaults to None
    :type losses: float, optional
    :param ot: ot, defaults to None
    :type ot: float, optional
    :param type_: type_, defaults to None
    :type type_: str, optional
    """

    def __init__(
        self,
        wins: float = None,
        losses: float = None,
        ot: float = None,
        type_: str = None,
    ):
        if wins is not None:
            self.wins = wins
        if losses is not None:
            self.losses = losses
        if ot is not None:
            self.ot = ot
        if type_ is not None:
            self.type_ = type_


@JsonMap({"id_": "id"})
class AwayTeam2(BaseModel):
    """AwayTeam2

    :param id_: id_, defaults to None
    :type id_: float, optional
    :param name: name, defaults to None
    :type name: str, optional
    :param link: link, defaults to None
    :type link: str, optional
    """

    def __init__(self, id_: float = None, name: str = None, link: str = None):
        if id_ is not None:
            self.id_ = id_
        if name is not None:
            self.name = name
        if link is not None:
            self.link = link


@JsonMap({"league_record": "leagueRecord"})
class TeamsAway2(BaseModel):
    """TeamsAway2

    :param league_record: league_record, defaults to None
    :type league_record: AwayLeagueRecord2, optional
    :param score: score, defaults to None
    :type score: float, optional
    :param team: team, defaults to None
    :type team: AwayTeam2, optional
    """

    def __init__(
        self,
        league_record: AwayLeagueRecord2 = None,
        score: float = None,
        team: AwayTeam2 = None,
    ):
        if league_record is not None:
            self.league_record = self._define_object(league_record, AwayLeagueRecord2)
        if score is not None:
            self.score = score
        if team is not None:
            self.team = self._define_object(team, AwayTeam2)


@JsonMap({"type_": "type"})
class HomeLeagueRecord2(BaseModel):
    """HomeLeagueRecord2

    :param wins: wins, defaults to None
    :type wins: float, optional
    :param losses: losses, defaults to None
    :type losses: float, optional
    :param ot: ot, defaults to None
    :type ot: float, optional
    :param type_: type_, defaults to None
    :type type_: str, optional
    """

    def __init__(
        self,
        wins: float = None,
        losses: float = None,
        ot: float = None,
        type_: str = None,
    ):
        if wins is not None:
            self.wins = wins
        if losses is not None:
            self.losses = losses
        if ot is not None:
            self.ot = ot
        if type_ is not None:
            self.type_ = type_


@JsonMap({"id_": "id"})
class HomeTeam2(BaseModel):
    """HomeTeam2

    :param id_: id_, defaults to None
    :type id_: float, optional
    :param name: name, defaults to None
    :type name: str, optional
    :param link: link, defaults to None
    :type link: str, optional
    """

    def __init__(self, id_: float = None, name: str = None, link: str = None):
        if id_ is not None:
            self.id_ = id_
        if name is not None:
            self.name = name
        if link is not None:
            self.link = link


@JsonMap({"league_record": "leagueRecord"})
class TeamsHome2(BaseModel):
    """TeamsHome2

    :param league_record: league_record, defaults to None
    :type league_record: HomeLeagueRecord2, optional
    :param score: score, defaults to None
    :type score: float, optional
    :param team: team, defaults to None
    :type team: HomeTeam2, optional
    """

    def __init__(
        self,
        league_record: HomeLeagueRecord2 = None,
        score: float = None,
        team: HomeTeam2 = None,
    ):
        if league_record is not None:
            self.league_record = self._define_object(league_record, HomeLeagueRecord2)
        if score is not None:
            self.score = score
        if team is not None:
            self.team = self._define_object(team, HomeTeam2)


@JsonMap({})
class ScheduleGameTeams(BaseModel):
    """ScheduleGameTeams

    :param away: away, defaults to None
    :type away: TeamsAway2, optional
    :param home: home, defaults to None
    :type home: TeamsHome2, optional
    """

    def __init__(self, away: TeamsAway2 = None, home: TeamsHome2 = None):
        if away is not None:
            self.away = self._define_object(away, TeamsAway2)
        if home is not None:
            self.home = self._define_object(home, TeamsHome2)


@JsonMap({})
class ScheduleGameVenue(BaseModel):
    """ScheduleGameVenue

    :param name: name, defaults to None
    :type name: str, optional
    :param link: link, defaults to None
    :type link: str, optional
    """

    def __init__(self, name: str = None, link: str = None):
        if name is not None:
            self.name = name
        if link is not None:
            self.link = link


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

    :cvar BUYSELL: "buysell"
    :vartype BUYSELL: str
    :cvar CLUB_BUYSELL: "club buysell"
    :vartype CLUB_BUYSELL: str
    :cvar CLUB_MOBILE: "club mobile"
    :vartype CLUB_MOBILE: str
    :cvar CLUB_MOBILE_BUYSELL: "club mobile buysell"
    :vartype CLUB_MOBILE_BUYSELL: str
    :cvar CLUB_TICKET: "club ticket"
    :vartype CLUB_TICKET: str
    :cvar MOBILE_APP_TICKET: "mobile app ticket"
    :vartype MOBILE_APP_TICKET: str
    :cvar MOBILE_BUYSELL: "mobile buysell"
    :vartype MOBILE_BUYSELL: str
    :cvar MOBILE_TICKET: "mobile ticket"
    :vartype MOBILE_TICKET: str
    :cvar TABLET_APP_TICKET: "tablet app ticket"
    :vartype TABLET_APP_TICKET: str
    :cvar TICKET: "ticket"
    :vartype TICKET: str
    """

    BUYSELL = "buysell"
    CLUB_BUYSELL = "club buysell"
    CLUB_MOBILE = "club mobile"
    CLUB_MOBILE_BUYSELL = "club mobile buysell"
    CLUB_TICKET = "club ticket"
    MOBILE_APP_TICKET = "mobile app ticket"
    MOBILE_BUYSELL = "mobile buysell"
    MOBILE_TICKET = "mobile ticket"
    TABLET_APP_TICKET = "tablet app ticket"
    TICKET = "ticket"

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

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


@JsonMap({"ticket_type": "ticketType", "ticket_link": "ticketLink"})
class Tickets(BaseModel):
    """Tickets

    :param ticket_type: ticket_type, defaults to None
    :type ticket_type: TicketType, optional
    :param ticket_link: ticket_link, defaults to None
    :type ticket_link: str, optional
    """

    def __init__(self, ticket_type: TicketType = None, ticket_link: str = None):
        if ticket_type is not None:
            self.ticket_type = self._enum_matching(
                ticket_type, TicketType.list(), "ticket_type"
            )
        if ticket_link is not None:
            self.ticket_link = ticket_link


@JsonMap({})
class ScheduleGameContent(BaseModel):
    """ScheduleGameContent

    :param link: link, defaults to None
    :type link: str, optional
    """

    def __init__(self, link: str = None):
        if link is not None:
            self.link = link


@JsonMap({"game_pk": "gamePk", "game_type": "gameType", "game_date": "gameDate"})
class ScheduleGame(BaseModel):
    """ScheduleGame

    :param game_pk: game_pk, defaults to None
    :type game_pk: float, optional
    :param link: link, defaults to None
    :type link: str, optional
    :param game_type: game_type, defaults to None
    :type game_type: str, optional
    :param season: season, defaults to None
    :type season: str, optional
    :param game_date: game_date, defaults to None
    :type game_date: str, optional
    :param status: status, defaults to None
    :type status: ScheduleGameStatus, optional
    :param teams: teams, defaults to None
    :type teams: ScheduleGameTeams, optional
    :param linescore: linescore, defaults to None
    :type linescore: GameLinescore, optional
    :param venue: venue, defaults to None
    :type venue: ScheduleGameVenue, optional
    :param tickets: tickets, defaults to None
    :type tickets: List[Tickets], optional
    :param content: content, defaults to None
    :type content: ScheduleGameContent, optional
    """

    def __init__(
        self,
        game_pk: float = None,
        link: str = None,
        game_type: str = None,
        season: str = None,
        game_date: str = None,
        status: ScheduleGameStatus = None,
        teams: ScheduleGameTeams = None,
        linescore: GameLinescore = None,
        venue: ScheduleGameVenue = None,
        tickets: List[Tickets] = None,
        content: ScheduleGameContent = None,
    ):
        if game_pk is not None:
            self.game_pk = game_pk
        if link is not None:
            self.link = link
        if game_type is not None:
            self.game_type = game_type
        if season is not None:
            self.season = season
        if game_date is not None:
            self.game_date = game_date
        if status is not None:
            self.status = self._define_object(status, ScheduleGameStatus)
        if teams is not None:
            self.teams = self._define_object(teams, ScheduleGameTeams)
        if linescore is not None:
            self.linescore = self._define_object(linescore, GameLinescore)
        if venue is not None:
            self.venue = self._define_object(venue, ScheduleGameVenue)
        if tickets is not None:
            self.tickets = self._define_list(tickets, Tickets)
        if content is not None:
            self.content = self._define_object(content, ScheduleGameContent)
