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

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


@JsonMap({"shots_on_goal": "shotsOnGoal", "rink_side": "rinkSide"})
class GamePeriodHome(BaseModel):
    """GamePeriodHome

    :param goals: goals, defaults to None
    :type goals: float, optional
    :param shots_on_goal: shots_on_goal, defaults to None
    :type shots_on_goal: float, optional
    :param rink_side: rink_side, defaults to None
    :type rink_side: str, optional
    """

    def __init__(
        self, goals: float = None, shots_on_goal: float = None, rink_side: str = None
    ):
        if goals is not None:
            self.goals = goals
        if shots_on_goal is not None:
            self.shots_on_goal = shots_on_goal
        if rink_side is not None:
            self.rink_side = rink_side


@JsonMap({"shots_on_goal": "shotsOnGoal", "rink_side": "rinkSide"})
class GamePeriodAway(BaseModel):
    """GamePeriodAway

    :param goals: goals, defaults to None
    :type goals: float, optional
    :param shots_on_goal: shots_on_goal, defaults to None
    :type shots_on_goal: float, optional
    :param rink_side: rink_side, defaults to None
    :type rink_side: str, optional
    """

    def __init__(
        self, goals: float = None, shots_on_goal: float = None, rink_side: str = None
    ):
        if goals is not None:
            self.goals = goals
        if shots_on_goal is not None:
            self.shots_on_goal = shots_on_goal
        if rink_side is not None:
            self.rink_side = rink_side


@JsonMap(
    {
        "period_type": "periodType",
        "start_time": "startTime",
        "end_time": "endTime",
        "ordinal_num": "ordinalNum",
    }
)
class GamePeriod(BaseModel):
    """GamePeriod

    :param period_type: period_type, defaults to None
    :type period_type: str, optional
    :param start_time: start_time, defaults to None
    :type start_time: str, optional
    :param end_time: end_time, defaults to None
    :type end_time: str, optional
    :param num: num, defaults to None
    :type num: float, optional
    :param ordinal_num: ordinal_num, defaults to None
    :type ordinal_num: str, optional
    :param home: home, defaults to None
    :type home: GamePeriodHome, optional
    :param away: away, defaults to None
    :type away: GamePeriodAway, optional
    """

    def __init__(
        self,
        period_type: str = None,
        start_time: str = None,
        end_time: str = None,
        num: float = None,
        ordinal_num: str = None,
        home: GamePeriodHome = None,
        away: GamePeriodAway = None,
    ):
        if period_type is not None:
            self.period_type = period_type
        if start_time is not None:
            self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time
        if num is not None:
            self.num = num
        if ordinal_num is not None:
            self.ordinal_num = ordinal_num
        if home is not None:
            self.home = self._define_object(home, GamePeriodHome)
        if away is not None:
            self.away = self._define_object(away, GamePeriodAway)
