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

from __future__ import annotations
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel
from .game_period import GamePeriod
from .game_linescore_team import GameLinescoreTeam


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

    :param scores: scores, defaults to None
    :type scores: float, optional
    :param attempts: attempts, defaults to None
    :type attempts: float, optional
    """

    def __init__(self, scores: float = None, attempts: float = None):
        if scores is not None:
            self.scores = scores
        if attempts is not None:
            self.attempts = attempts


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

    :param scores: scores, defaults to None
    :type scores: float, optional
    :param attempts: attempts, defaults to None
    :type attempts: float, optional
    """

    def __init__(self, scores: float = None, attempts: float = None):
        if scores is not None:
            self.scores = scores
        if attempts is not None:
            self.attempts = attempts


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

    :param away: away, defaults to None
    :type away: ShootoutInfoAway, optional
    :param home: home, defaults to None
    :type home: ShootoutInfoHome, optional
    """

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


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

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

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


@JsonMap(
    {
        "intermission_time_remaining": "intermissionTimeRemaining",
        "intermission_time_elapsed": "intermissionTimeElapsed",
        "in_intermission": "inIntermission",
    }
)
class IntermissionInfo(BaseModel):
    """IntermissionInfo

    :param intermission_time_remaining: intermission_time_remaining, defaults to None
    :type intermission_time_remaining: float, optional
    :param intermission_time_elapsed: intermission_time_elapsed, defaults to None
    :type intermission_time_elapsed: float, optional
    :param in_intermission: in_intermission, defaults to None
    :type in_intermission: bool, optional
    """

    def __init__(
        self,
        intermission_time_remaining: float = None,
        intermission_time_elapsed: float = None,
        in_intermission: bool = None,
    ):
        if intermission_time_remaining is not None:
            self.intermission_time_remaining = intermission_time_remaining
        if intermission_time_elapsed is not None:
            self.intermission_time_elapsed = intermission_time_elapsed
        if in_intermission is not None:
            self.in_intermission = in_intermission


@JsonMap(
    {
        "situation_time_remaining": "situationTimeRemaining",
        "situation_time_elapsed": "situationTimeElapsed",
        "in_situation": "inSituation",
    }
)
class PowerPlayInfo(BaseModel):
    """PowerPlayInfo

    :param situation_time_remaining: situation_time_remaining, defaults to None
    :type situation_time_remaining: float, optional
    :param situation_time_elapsed: situation_time_elapsed, defaults to None
    :type situation_time_elapsed: float, optional
    :param in_situation: in_situation, defaults to None
    :type in_situation: bool, optional
    """

    def __init__(
        self,
        situation_time_remaining: float = None,
        situation_time_elapsed: float = None,
        in_situation: bool = None,
    ):
        if situation_time_remaining is not None:
            self.situation_time_remaining = situation_time_remaining
        if situation_time_elapsed is not None:
            self.situation_time_elapsed = situation_time_elapsed
        if in_situation is not None:
            self.in_situation = in_situation


@JsonMap(
    {
        "current_period": "currentPeriod",
        "current_period_ordinal": "currentPeriodOrdinal",
        "current_period_time_remaining": "currentPeriodTimeRemaining",
        "shootout_info": "shootoutInfo",
        "power_play_strength": "powerPlayStrength",
        "has_shootout": "hasShootout",
        "intermission_info": "intermissionInfo",
        "power_play_info": "powerPlayInfo",
    }
)
class GameLinescore(BaseModel):
    """GameLinescore

    :param current_period: current_period, defaults to None
    :type current_period: float, optional
    :param current_period_ordinal: current_period_ordinal, defaults to None
    :type current_period_ordinal: str, optional
    :param current_period_time_remaining: current_period_time_remaining, defaults to None
    :type current_period_time_remaining: str, optional
    :param periods: periods, defaults to None
    :type periods: List[GamePeriod], optional
    :param shootout_info: shootout_info, defaults to None
    :type shootout_info: ShootoutInfo, optional
    :param teams: teams, defaults to None
    :type teams: GameLinescoreTeams, optional
    :param power_play_strength: power_play_strength, defaults to None
    :type power_play_strength: str, optional
    :param has_shootout: has_shootout, defaults to None
    :type has_shootout: bool, optional
    :param intermission_info: intermission_info, defaults to None
    :type intermission_info: IntermissionInfo, optional
    :param power_play_info: power_play_info, defaults to None
    :type power_play_info: PowerPlayInfo, optional
    """

    def __init__(
        self,
        current_period: float = None,
        current_period_ordinal: str = None,
        current_period_time_remaining: str = None,
        periods: List[GamePeriod] = None,
        shootout_info: ShootoutInfo = None,
        teams: GameLinescoreTeams = None,
        power_play_strength: str = None,
        has_shootout: bool = None,
        intermission_info: IntermissionInfo = None,
        power_play_info: PowerPlayInfo = None,
    ):
        if current_period is not None:
            self.current_period = current_period
        if current_period_ordinal is not None:
            self.current_period_ordinal = current_period_ordinal
        if current_period_time_remaining is not None:
            self.current_period_time_remaining = current_period_time_remaining
        if periods is not None:
            self.periods = self._define_list(periods, GamePeriod)
        if shootout_info is not None:
            self.shootout_info = self._define_object(shootout_info, ShootoutInfo)
        if teams is not None:
            self.teams = self._define_object(teams, GameLinescoreTeams)
        if power_play_strength is not None:
            self.power_play_strength = power_play_strength
        if has_shootout is not None:
            self.has_shootout = has_shootout
        if intermission_info is not None:
            self.intermission_info = self._define_object(
                intermission_info, IntermissionInfo
            )
        if power_play_info is not None:
            self.power_play_info = self._define_object(power_play_info, PowerPlayInfo)
