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

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


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

    :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


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

    :cvar LINESMAN: "Linesman"
    :vartype LINESMAN: str
    :cvar REFEREE: "Referee"
    :vartype REFEREE: str
    """

    LINESMAN = "Linesman"
    REFEREE = "Referee"

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

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


@JsonMap({"official_type": "officialType"})
class GameOfficial(BaseModel):
    """GameOfficial

    :param official: official, defaults to None
    :type official: Official, optional
    :param official_type: official_type, defaults to None
    :type official_type: OfficialType, optional
    """

    def __init__(self, official: Official = None, official_type: OfficialType = None):
        if official is not None:
            self.official = self._define_object(official, Official)
        if official_type is not None:
            self.official_type = self._enum_matching(
                official_type, OfficialType.list(), "official_type"
            )
