# Path: src/mattermostdriver/exceptions.py
# class InvalidOrMissingParameters(HTTPError):
#     """
#     Raised when mattermost returns a
#     400 Invalid or missing parameters in URL or request body
#     """
# 
# class NoAccessTokenProvided(HTTPError):
#     """
#     Raised when mattermost returns a
#     401 No access token provided
#     """
# 
# class NotEnoughPermissions(HTTPError):
#     """
#     Raised when mattermost returns a
#     403 Do not have appropriate permissions
#     """
# 
# class ResourceNotFound(HTTPError):
#     """
#     Raised when mattermost returns a
#     404 Resource not found
#     """
# 
# class MethodNotAllowed(HTTPError):
#     """
#     Raised when mattermost returns a
#     405 Method Not Allowed
#     """
# 
# class ContentTooLarge(HTTPError):
#     """
#     Raised when mattermost returns a
#     413 Content too large
#     """
# 
# class FeatureDisabled(HTTPError):
#     """
#     Raised when mattermost returns a
#     501 Feature is disabled
#     """


import logging
import httpx
from .exceptions import (
    InvalidOrMissingParameters,
    NoAccessTokenProvided,
    NotEnoughPermissions,
    ResourceNotFound,
    MethodNotAllowed,
    ContentTooLarge,
    FeatureDisabled,
)
            request_params["auth"] = self._auth()

        return self._get_request_method(method, self.client), url, request_params

    @staticmethod
    def _check_response(response):
        try:
            response.raise_for_status()
        except httpx.HTTPStatusError as e:
            try:
                data = e.response.json()
                message = data.get("message", data)
            except ValueError:
                log.debug("Could not convert response to json")
                message = response.text
            log.error(message)

            if e.response.status_code == 400:
                raise InvalidOrMissingParameters(message) from None
            elif e.response.status_code == 401:
                raise NoAccessTokenProvided(message) from None
            elif e.response.status_code == 403:
                raise NotEnoughPermissions(message) from None
            elif e.response.status_code == 404:
                raise ResourceNotFound(message) from None
            elif e.response.status_code == 405:
                raise MethodNotAllowed(message) from None
            elif e.response.status_code == 413:
                raise ContentTooLarge(message) from None
            elif e.response.status_code == 501:

# Path: src/mattermostdriver/exceptions.py
# class InvalidOrMissingParameters(HTTPError):
#     """
#     Raised when mattermost returns a
#     400 Invalid or missing parameters in URL or request body
#     """
# 
# class NoAccessTokenProvided(HTTPError):
#     """
#     Raised when mattermost returns a
#     401 No access token provided
#     """
# 
# class NotEnoughPermissions(HTTPError):
#     """
#     Raised when mattermost returns a
#     403 Do not have appropriate permissions
#     """
# 
# class ResourceNotFound(HTTPError):
#     """
#     Raised when mattermost returns a
#     404 Resource not found
#     """
# 
# class MethodNotAllowed(HTTPError):
#     """
#     Raised when mattermost returns a
#     405 Method Not Allowed
#     """
# 
# class ContentTooLarge(HTTPError):
#     """
#     Raised when mattermost returns a
#     413 Content too large
#     """
# 
# class FeatureDisabled(HTTPError):
#     """
#     Raised when mattermost returns a
#     501 Feature is disabled
#     """


# Path: src/mattermostdriver/client.py
import logging
import httpx
from .exceptions import (
    InvalidOrMissingParameters,
    NoAccessTokenProvided,
    NotEnoughPermissions,
    ResourceNotFound,
    MethodNotAllowed,
    ContentTooLarge,
    FeatureDisabled,
)

            request_params["auth"] = self._auth()

        return self._get_request_method(method, self.client), url, request_params

    @staticmethod
    def _check_response(response):
        try:
            response.raise_for_status()
        except httpx.HTTPStatusError as e:
            try:
                data = e.response.json()
                message = data.get("message", data)
            except ValueError:
                log.debug("Could not convert response to json")
                message = response.text
            log.error(message)

            if e.response.status_code == 400:
                raise InvalidOrMissingParameters(message) from None
            elif e.response.status_code == 401:
                raise NoAccessTokenProvided(message) from None
            elif e.response.status_code == 403:
                raise NotEnoughPermissions(message) from None
            elif e.response.status_code == 404:
                raise ResourceNotFound(message) from None
            elif e.response.status_code == 405:
                raise MethodNotAllowed(message) from None
            elif e.response.status_code == 413:
                raise ContentTooLarge(message) from None
            elif e.response.status_code == 501:

                raise FeatureDisabled(message) from None