# 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 .venue import Venue
from .franchise import Franchise
from .roster import Roster


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

    :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({"id_": "id"})
class TeamConference(BaseModel):
    """TeamConference

    :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({})
class TeamRoster(BaseModel):
    """TeamRoster

    :param roster: roster, defaults to None
    :type roster: List[Roster], optional
    """

    def __init__(self, roster: List[Roster] = None):
        if roster is not None:
            self.roster = self._define_list(roster, Roster)


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

    :cvar LIVE: "Live"
    :vartype LIVE: str
    :cvar PREVIEW: "Preview"
    :vartype PREVIEW: str
    """

    LIVE = "Live"
    PREVIEW = "Preview"

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

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


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

    :cvar _2: "2"
    :vartype _2: str
    :cvar _3: "3"
    :vartype _3: str
    """

    _2 = "2"
    _3 = "3"

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

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


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

    :cvar IN_PROGRESS: "In Progress"
    :vartype IN_PROGRESS: str
    :cvar PRE_GAME: "Pre-Game"
    :vartype PRE_GAME: str
    """

    IN_PROGRESS = "In Progress"
    PRE_GAME = "Pre-Game"

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

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


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

    :cvar _2: "2"
    :vartype _2: str
    :cvar _3: "3"
    :vartype _3: str
    """

    _2 = "2"
    _3 = "3"

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

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


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

    :param abstract_game_state: abstract_game_state, defaults to None
    :type abstract_game_state: AbstractGameState, optional
    :param coded_game_state: coded_game_state, defaults to None
    :type coded_game_state: CodedGameState, optional
    :param detailed_state: detailed_state, defaults to None
    :type detailed_state: DetailedState, optional
    :param status_code: status_code, defaults to None
    :type status_code: StatusCode, optional
    :param start_time_tbd: start_time_tbd, defaults to None
    :type start_time_tbd: bool, optional
    """

    def __init__(
        self,
        abstract_game_state: AbstractGameState = None,
        coded_game_state: CodedGameState = None,
        detailed_state: DetailedState = None,
        status_code: StatusCode = None,
        start_time_tbd: bool = None,
    ):
        if abstract_game_state is not None:
            self.abstract_game_state = self._enum_matching(
                abstract_game_state, AbstractGameState.list(), "abstract_game_state"
            )
        if coded_game_state is not None:
            self.coded_game_state = self._enum_matching(
                coded_game_state, CodedGameState.list(), "coded_game_state"
            )
        if detailed_state is not None:
            self.detailed_state = self._enum_matching(
                detailed_state, DetailedState.list(), "detailed_state"
            )
        if status_code is not None:
            self.status_code = self._enum_matching(
                status_code, StatusCode.list(), "status_code"
            )
        if start_time_tbd is not None:
            self.start_time_tbd = start_time_tbd


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

    :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 AwayTeam1(BaseModel):
    """AwayTeam1

    :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 TeamsAway1(BaseModel):
    """TeamsAway1

    :param league_record: league_record, defaults to None
    :type league_record: AwayLeagueRecord1, optional
    :param score: score, defaults to None
    :type score: float, optional
    :param team: team, defaults to None
    :type team: AwayTeam1, optional
    """

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


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

    :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 HomeTeam1(BaseModel):
    """HomeTeam1

    :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 TeamsHome1(BaseModel):
    """TeamsHome1

    :param league_record: league_record, defaults to None
    :type league_record: HomeLeagueRecord1, optional
    :param score: score, defaults to None
    :type score: float, optional
    :param team: team, defaults to None
    :type team: HomeTeam1, optional
    """

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


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

    :param away: away, defaults to None
    :type away: TeamsAway1, optional
    :param home: home, defaults to None
    :type home: TeamsHome1, optional
    """

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


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

    :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


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

    :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 Games(BaseModel):
    """Games

    :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: GamesStatus, optional
    :param teams: teams, defaults to None
    :type teams: GamesTeams, optional
    :param venue: venue, defaults to None
    :type venue: GamesVenue, optional
    :param content: content, defaults to None
    :type content: GamesContent, optional
    """

    def __init__(
        self,
        game_pk: float = None,
        link: str = None,
        game_type: str = None,
        season: str = None,
        game_date: str = None,
        status: GamesStatus = None,
        teams: GamesTeams = None,
        venue: GamesVenue = None,
        content: GamesContent = 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, GamesStatus)
        if teams is not None:
            self.teams = self._define_object(teams, GamesTeams)
        if venue is not None:
            self.venue = self._define_object(venue, GamesVenue)
        if content is not None:
            self.content = self._define_object(content, GamesContent)


@JsonMap(
    {
        "date_": "date",
        "total_items": "totalItems",
        "total_events": "totalEvents",
        "total_games": "totalGames",
        "total_matches": "totalMatches",
    }
)
class Dates(BaseModel):
    """Dates

    :param date_: date_, defaults to None
    :type date_: str, optional
    :param total_items: total_items, defaults to None
    :type total_items: float, optional
    :param total_events: total_events, defaults to None
    :type total_events: float, optional
    :param total_games: total_games, defaults to None
    :type total_games: float, optional
    :param total_matches: total_matches, defaults to None
    :type total_matches: float, optional
    :param games: games, defaults to None
    :type games: List[Games], optional
    :param events: events, defaults to None
    :type events: List[dict], optional
    :param matches: matches, defaults to None
    :type matches: List[dict], optional
    """

    def __init__(
        self,
        date_: str = None,
        total_items: float = None,
        total_events: float = None,
        total_games: float = None,
        total_matches: float = None,
        games: List[Games] = None,
        events: List[dict] = None,
        matches: List[dict] = None,
    ):
        if date_ is not None:
            self.date_ = date_
        if total_items is not None:
            self.total_items = total_items
        if total_events is not None:
            self.total_events = total_events
        if total_games is not None:
            self.total_games = total_games
        if total_matches is not None:
            self.total_matches = total_matches
        if games is not None:
            self.games = self._define_list(games, Games)
        if events is not None:
            self.events = events
        if matches is not None:
            self.matches = matches


@JsonMap(
    {
        "total_items": "totalItems",
        "total_events": "totalEvents",
        "total_games": "totalGames",
        "total_matches": "totalMatches",
    }
)
class NextGameSchedule(BaseModel):
    """NextGameSchedule

    :param total_items: total_items, defaults to None
    :type total_items: float, optional
    :param total_events: total_events, defaults to None
    :type total_events: float, optional
    :param total_games: total_games, defaults to None
    :type total_games: float, optional
    :param total_matches: total_matches, defaults to None
    :type total_matches: float, optional
    :param dates: dates, defaults to None
    :type dates: List[Dates], optional
    """

    def __init__(
        self,
        total_items: float = None,
        total_events: float = None,
        total_games: float = None,
        total_matches: float = None,
        dates: List[Dates] = None,
    ):
        if total_items is not None:
            self.total_items = total_items
        if total_events is not None:
            self.total_events = total_events
        if total_games is not None:
            self.total_games = total_games
        if total_matches is not None:
            self.total_matches = total_matches
        if dates is not None:
            self.dates = self._define_list(dates, Dates)


@JsonMap(
    {
        "id_": "id",
        "tri_code": "triCode",
        "team_name": "teamName",
        "location_name": "locationName",
        "first_year_of_play": "firstYearOfPlay",
        "next_game_schedule": "nextGameSchedule",
        "short_name": "shortName",
        "official_site_url": "officialSiteUrl",
        "franchise_id": "franchiseId",
    }
)
class Team(BaseModel):
    """Team

    :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
    :param venue: venue, defaults to None
    :type venue: Venue, optional
    :param abbreviation: abbreviation, defaults to None
    :type abbreviation: str, optional
    :param tri_code: tri_code, defaults to None
    :type tri_code: str, optional
    :param team_name: team_name, defaults to None
    :type team_name: str, optional
    :param location_name: location_name, defaults to None
    :type location_name: str, optional
    :param first_year_of_play: first_year_of_play, defaults to None
    :type first_year_of_play: float, optional
    :param division: division, defaults to None
    :type division: TeamDivision, optional
    :param conference: conference, defaults to None
    :type conference: TeamConference, optional
    :param franchise: franchise, defaults to None
    :type franchise: Franchise, optional
    :param roster: roster, defaults to None
    :type roster: TeamRoster, optional
    :param next_game_schedule: next_game_schedule, defaults to None
    :type next_game_schedule: NextGameSchedule, optional
    :param short_name: short_name, defaults to None
    :type short_name: str, optional
    :param official_site_url: official_site_url, defaults to None
    :type official_site_url: str, optional
    :param franchise_id: franchise_id, defaults to None
    :type franchise_id: float, optional
    :param active: active, defaults to None
    :type active: bool, optional
    """

    def __init__(
        self,
        id_: float = None,
        name: str = None,
        link: str = None,
        venue: Venue = None,
        abbreviation: str = None,
        tri_code: str = None,
        team_name: str = None,
        location_name: str = None,
        first_year_of_play: float = None,
        division: TeamDivision = None,
        conference: TeamConference = None,
        franchise: Franchise = None,
        roster: TeamRoster = None,
        next_game_schedule: NextGameSchedule = None,
        short_name: str = None,
        official_site_url: str = None,
        franchise_id: float = None,
        active: bool = 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
        if venue is not None:
            self.venue = self._define_object(venue, Venue)
        if abbreviation is not None:
            self.abbreviation = abbreviation
        if tri_code is not None:
            self.tri_code = tri_code
        if team_name is not None:
            self.team_name = team_name
        if location_name is not None:
            self.location_name = location_name
        if first_year_of_play is not None:
            self.first_year_of_play = first_year_of_play
        if division is not None:
            self.division = self._define_object(division, TeamDivision)
        if conference is not None:
            self.conference = self._define_object(conference, TeamConference)
        if franchise is not None:
            self.franchise = self._define_object(franchise, Franchise)
        if roster is not None:
            self.roster = self._define_object(roster, TeamRoster)
        if next_game_schedule is not None:
            self.next_game_schedule = self._define_object(
                next_game_schedule, NextGameSchedule
            )
        if short_name is not None:
            self.short_name = short_name
        if official_site_url is not None:
            self.official_site_url = official_site_url
        if franchise_id is not None:
            self.franchise_id = franchise_id
        if active is not None:
            self.active = active
