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

from typing import List
from .utils.validator import Validator
from .utils.base_service import BaseService
from ..net.transport.serializer import Serializer
from ..models.utils.cast_models import cast_models
from ..models.stat_types import StatTypes


class StatsService(BaseService):

    @cast_models
    def get_stat_types(self) -> List[StatTypes]:
        """get_stat_types

        ...
        :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
        ...
        :return: OK
        :rtype: List[StatTypes]
        """

        serialized_request = (
            Serializer(f"{self.base_url}/statTypes", self.get_default_headers())
            .serialize()
            .set_method("GET")
        )

        response = self.send_request(serialized_request)

        return [StatTypes._unmap(item) for item in response]
