# 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 StandingsType(Enum):
    """An enumeration representing different categories.

    :cvar REGULARSEASON: "regularSeason"
    :vartype REGULARSEASON: str
    """

    REGULARSEASON = "regularSeason"

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

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


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

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

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

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

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

    :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(
    {
        "streak_type": "streakType",
        "streak_number": "streakNumber",
        "streak_code": "streakCode",
    }
)
class Streak(BaseModel):
    """Streak

    :param streak_type: streak_type, defaults to None
    :type streak_type: str, optional
    :param streak_number: streak_number, defaults to None
    :type streak_number: float, optional
    :param streak_code: streak_code, defaults to None
    :type streak_code: str, optional
    """

    def __init__(
        self,
        streak_type: str = None,
        streak_number: float = None,
        streak_code: str = None,
    ):
        if streak_type is not None:
            self.streak_type = streak_type
        if streak_number is not None:
            self.streak_number = streak_number
        if streak_code is not None:
            self.streak_code = streak_code


@JsonMap(
    {
        "league_record": "leagueRecord",
        "goals_against": "goalsAgainst",
        "goals_scored": "goalsScored",
        "division_rank": "divisionRank",
        "conference_rank": "conferenceRank",
        "league_rank": "leagueRank",
        "wild_card_rank": "wildCardRank",
        "games_played": "gamesPlayed",
        "last_updated": "lastUpdated",
    }
)
class TeamRecords(BaseModel):
    """TeamRecords

    :param team: team, defaults to None
    :type team: TeamRecordsTeam, optional
    :param league_record: league_record, defaults to None
    :type league_record: TeamRecordsLeagueRecord, optional
    :param goals_against: goals_against, defaults to None
    :type goals_against: float, optional
    :param goals_scored: goals_scored, defaults to None
    :type goals_scored: float, optional
    :param points: points, defaults to None
    :type points: float, optional
    :param division_rank: division_rank, defaults to None
    :type division_rank: str, optional
    :param conference_rank: conference_rank, defaults to None
    :type conference_rank: str, optional
    :param league_rank: league_rank, defaults to None
    :type league_rank: str, optional
    :param wild_card_rank: wild_card_rank, defaults to None
    :type wild_card_rank: str, optional
    :param row: row, defaults to None
    :type row: float, optional
    :param games_played: games_played, defaults to None
    :type games_played: float, optional
    :param streak: streak, defaults to None
    :type streak: Streak, optional
    :param last_updated: last_updated, defaults to None
    :type last_updated: str, optional
    """

    def __init__(
        self,
        team: TeamRecordsTeam = None,
        league_record: TeamRecordsLeagueRecord = None,
        goals_against: float = None,
        goals_scored: float = None,
        points: float = None,
        division_rank: str = None,
        conference_rank: str = None,
        league_rank: str = None,
        wild_card_rank: str = None,
        row: float = None,
        games_played: float = None,
        streak: Streak = None,
        last_updated: str = None,
    ):
        if team is not None:
            self.team = self._define_object(team, TeamRecordsTeam)
        if league_record is not None:
            self.league_record = self._define_object(
                league_record, TeamRecordsLeagueRecord
            )
        if goals_against is not None:
            self.goals_against = goals_against
        if goals_scored is not None:
            self.goals_scored = goals_scored
        if points is not None:
            self.points = points
        if division_rank is not None:
            self.division_rank = division_rank
        if conference_rank is not None:
            self.conference_rank = conference_rank
        if league_rank is not None:
            self.league_rank = league_rank
        if wild_card_rank is not None:
            self.wild_card_rank = wild_card_rank
        if row is not None:
            self.row = row
        if games_played is not None:
            self.games_played = games_played
        if streak is not None:
            self.streak = self._define_object(streak, Streak)
        if last_updated is not None:
            self.last_updated = last_updated


@JsonMap({"standings_type": "standingsType", "team_records": "teamRecords"})
class Records(BaseModel):
    """Records

    :param standings_type: standings_type, defaults to None
    :type standings_type: StandingsType, optional
    :param league: league, defaults to None
    :type league: League, optional
    :param division: division, defaults to None
    :type division: RecordsDivision, optional
    :param conference: conference, defaults to None
    :type conference: RecordsConference, optional
    :param team_records: team_records, defaults to None
    :type team_records: List[TeamRecords], optional
    """

    def __init__(
        self,
        standings_type: StandingsType = None,
        league: League = None,
        division: RecordsDivision = None,
        conference: RecordsConference = None,
        team_records: List[TeamRecords] = None,
    ):
        if standings_type is not None:
            self.standings_type = self._enum_matching(
                standings_type, StandingsType.list(), "standings_type"
            )
        if league is not None:
            self.league = self._define_object(league, League)
        if division is not None:
            self.division = self._define_object(division, RecordsDivision)
        if conference is not None:
            self.conference = self._define_object(conference, RecordsConference)
        if team_records is not None:
            self.team_records = self._define_list(team_records, TeamRecords)


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

    :param copyright: copyright, defaults to None
    :type copyright: str, optional
    :param records: records, defaults to None
    :type records: List[Records], optional
    """

    def __init__(self, copyright: str = None, records: List[Records] = None):
        if copyright is not None:
            self.copyright = copyright
        if records is not None:
            self.records = self._define_list(records, Records)
