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

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


@JsonMap({"id_": "id", "full_name": "fullName"})
class PlayersPlayer(BaseModel):
    """PlayersPlayer

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

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


@JsonMap({"player_type": "playerType"})
class GamePlayPlayers(BaseModel):
    """GamePlayPlayers

    :param player: player, defaults to None
    :type player: PlayersPlayer, optional
    :param player_type: player_type, defaults to None
    :type player_type: str, optional
    """

    def __init__(self, player: PlayersPlayer = None, player_type: str = None):
        if player is not None:
            self.player = self._define_object(player, PlayersPlayer)
        if player_type is not None:
            self.player_type = player_type


@JsonMap({"event_code": "eventCode", "event_type_id": "eventTypeId"})
class Result(BaseModel):
    """Result

    :param event: event, defaults to None
    :type event: str, optional
    :param event_code: event_code, defaults to None
    :type event_code: str, optional
    :param event_type_id: event_type_id, defaults to None
    :type event_type_id: str, optional
    :param description: description, defaults to None
    :type description: str, optional
    """

    def __init__(
        self,
        event: str = None,
        event_code: str = None,
        event_type_id: str = None,
        description: str = None,
    ):
        if event is not None:
            self.event = event
        if event_code is not None:
            self.event_code = event_code
        if event_type_id is not None:
            self.event_type_id = event_type_id
        if description is not None:
            self.description = description


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

    :param away: away, defaults to None
    :type away: float, optional
    :param home: home, defaults to None
    :type home: float, optional
    """

    def __init__(self, away: float = None, home: float = None):
        if away is not None:
            self.away = away
        if home is not None:
            self.home = home


@JsonMap(
    {
        "event_idx": "eventIdx",
        "event_id": "eventId",
        "period_type": "periodType",
        "ordinal_num": "ordinalNum",
        "period_time": "periodTime",
        "period_time_remaining": "periodTimeRemaining",
        "date_time": "dateTime",
    }
)
class About(BaseModel):
    """About

    :param event_idx: event_idx, defaults to None
    :type event_idx: float, optional
    :param event_id: event_id, defaults to None
    :type event_id: float, optional
    :param period: period, defaults to None
    :type period: float, optional
    :param period_type: period_type, defaults to None
    :type period_type: str, optional
    :param ordinal_num: ordinal_num, defaults to None
    :type ordinal_num: str, optional
    :param period_time: period_time, defaults to None
    :type period_time: str, optional
    :param period_time_remaining: period_time_remaining, defaults to None
    :type period_time_remaining: str, optional
    :param date_time: date_time, defaults to None
    :type date_time: str, optional
    :param goals: goals, defaults to None
    :type goals: Goals, optional
    """

    def __init__(
        self,
        event_idx: float = None,
        event_id: float = None,
        period: float = None,
        period_type: str = None,
        ordinal_num: str = None,
        period_time: str = None,
        period_time_remaining: str = None,
        date_time: str = None,
        goals: Goals = None,
    ):
        if event_idx is not None:
            self.event_idx = event_idx
        if event_id is not None:
            self.event_id = event_id
        if period is not None:
            self.period = period
        if period_type is not None:
            self.period_type = period_type
        if ordinal_num is not None:
            self.ordinal_num = ordinal_num
        if period_time is not None:
            self.period_time = period_time
        if period_time_remaining is not None:
            self.period_time_remaining = period_time_remaining
        if date_time is not None:
            self.date_time = date_time
        if goals is not None:
            self.goals = self._define_object(goals, Goals)


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

    :param x: x, defaults to None
    :type x: float, optional
    :param y: y, defaults to None
    :type y: float, optional
    """

    def __init__(self, x: float = None, y: float = None):
        if x is not None:
            self.x = x
        if y is not None:
            self.y = y


@JsonMap({"id_": "id", "tri_code": "triCode"})
class GamePlayTeam(BaseModel):
    """GamePlayTeam

    :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 tri_code: tri_code, defaults to None
    :type tri_code: str, optional
    """

    def __init__(
        self,
        id_: float = None,
        name: str = None,
        link: str = None,
        tri_code: 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
        if tri_code is not None:
            self.tri_code = tri_code


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

    :param players: players, defaults to None
    :type players: List[GamePlayPlayers], optional
    :param result: result, defaults to None
    :type result: Result, optional
    :param about: about, defaults to None
    :type about: About, optional
    :param coordinates: coordinates, defaults to None
    :type coordinates: Coordinates, optional
    :param team: team, defaults to None
    :type team: GamePlayTeam, optional
    """

    def __init__(
        self,
        players: List[GamePlayPlayers] = None,
        result: Result = None,
        about: About = None,
        coordinates: Coordinates = None,
        team: GamePlayTeam = None,
    ):
        if players is not None:
            self.players = self._define_list(players, GamePlayPlayers)
        if result is not None:
            self.result = self._define_object(result, Result)
        if about is not None:
            self.about = self._define_object(about, About)
        if coordinates is not None:
            self.coordinates = self._define_object(coordinates, Coordinates)
        if team is not None:
            self.team = self._define_object(team, GamePlayTeam)
