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

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


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

    :cvar L: "L"
    :vartype L: str
    :cvar R: "R"
    :vartype R: str
    """

    L = "L"
    R = "R"

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

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


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

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

    :param code: code, defaults to None
    :type code: str, optional
    :param name: name, defaults to None
    :type name: str, optional
    :param type_: type_, defaults to None
    :type type_: str, optional
    :param abbreviation: abbreviation, defaults to None
    :type abbreviation: str, optional
    """

    def __init__(
        self,
        code: str = None,
        name: str = None,
        type_: str = None,
        abbreviation: str = None,
    ):
        if code is not None:
            self.code = code
        if name is not None:
            self.name = name
        if type_ is not None:
            self.type_ = type_
        if abbreviation is not None:
            self.abbreviation = abbreviation


@JsonMap(
    {
        "id_": "id",
        "full_name": "fullName",
        "first_name": "firstName",
        "last_name": "lastName",
        "primary_number": "primaryNumber",
        "birth_date": "birthDate",
        "current_age": "currentAge",
        "birth_city": "birthCity",
        "birth_state_province": "birthStateProvince",
        "birth_country": "birthCountry",
        "alternate_captain": "alternateCaptain",
        "shoots_catches": "shootsCatches",
        "roster_status": "rosterStatus",
        "current_team": "currentTeam",
        "primary_position": "primaryPosition",
    }
)
class Player(BaseModel):
    """Player

    :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
    :param first_name: first_name, defaults to None
    :type first_name: str, optional
    :param last_name: last_name, defaults to None
    :type last_name: str, optional
    :param primary_number: primary_number, defaults to None
    :type primary_number: str, optional
    :param birth_date: birth_date, defaults to None
    :type birth_date: str, optional
    :param current_age: current_age, defaults to None
    :type current_age: float, optional
    :param birth_city: birth_city, defaults to None
    :type birth_city: str, optional
    :param birth_state_province: birth_state_province, defaults to None
    :type birth_state_province: str, optional
    :param birth_country: birth_country, defaults to None
    :type birth_country: str, optional
    :param nationality: nationality, defaults to None
    :type nationality: str, optional
    :param height: height, defaults to None
    :type height: str, optional
    :param weight: weight, defaults to None
    :type weight: float, optional
    :param active: active, defaults to None
    :type active: bool, optional
    :param alternate_captain: alternate_captain, defaults to None
    :type alternate_captain: bool, optional
    :param captain: captain, defaults to None
    :type captain: bool, optional
    :param rookie: rookie, defaults to None
    :type rookie: bool, optional
    :param shoots_catches: shoots_catches, defaults to None
    :type shoots_catches: ShootsCatches, optional
    :param roster_status: roster_status, defaults to None
    :type roster_status: str, optional
    :param current_team: current_team, defaults to None
    :type current_team: CurrentTeam, optional
    :param primary_position: primary_position, defaults to None
    :type primary_position: PlayerPrimaryPosition, optional
    """

    def __init__(
        self,
        id_: float = None,
        full_name: str = None,
        link: str = None,
        first_name: str = None,
        last_name: str = None,
        primary_number: str = None,
        birth_date: str = None,
        current_age: float = None,
        birth_city: str = None,
        birth_state_province: str = None,
        birth_country: str = None,
        nationality: str = None,
        height: str = None,
        weight: float = None,
        active: bool = None,
        alternate_captain: bool = None,
        captain: bool = None,
        rookie: bool = None,
        shoots_catches: ShootsCatches = None,
        roster_status: str = None,
        current_team: CurrentTeam = None,
        primary_position: PlayerPrimaryPosition = 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
        if first_name is not None:
            self.first_name = first_name
        if last_name is not None:
            self.last_name = last_name
        if primary_number is not None:
            self.primary_number = primary_number
        if birth_date is not None:
            self.birth_date = birth_date
        if current_age is not None:
            self.current_age = current_age
        if birth_city is not None:
            self.birth_city = birth_city
        if birth_state_province is not None:
            self.birth_state_province = birth_state_province
        if birth_country is not None:
            self.birth_country = birth_country
        if nationality is not None:
            self.nationality = nationality
        if height is not None:
            self.height = height
        if weight is not None:
            self.weight = weight
        if active is not None:
            self.active = active
        if alternate_captain is not None:
            self.alternate_captain = alternate_captain
        if captain is not None:
            self.captain = captain
        if rookie is not None:
            self.rookie = rookie
        if shoots_catches is not None:
            self.shoots_catches = self._enum_matching(
                shoots_catches, ShootsCatches.list(), "shoots_catches"
            )
        if roster_status is not None:
            self.roster_status = roster_status
        if current_team is not None:
            self.current_team = self._define_object(current_team, CurrentTeam)
        if primary_position is not None:
            self.primary_position = self._define_object(
                primary_position, PlayerPrimaryPosition
            )
