# Path: moira_client/client.py
# class InvalidJSONError(Exception):
#     def __init__(self, content):
#         """
# 
#         :param content: bytes response content
#         """
#         self.content = content
# 
# Path: moira_client/client.py
# class ResponseStructureError(Exception):
#     def __init__(self, msg, content):
#         """
# 
#         :param msg: str error message
#         :param content: dict response content
#         """
#         self.msg = msg
#         self.content = content


from ..client import InvalidJSONError
from ..client import ResponseStructureError
class NotificationManager:
    def __init__(self, client):
        self._client = client

    def fetch_all(self):
        """
        Returns all notifications
        :return: list of dict

        :raises: ResponseStructureError
        """
        result = self.fetch(start=0, end=-1)
        return result

    def fetch(self, start, end):
        """
        Gets a paginated list of notifications
        :return: list of dict

        :param start
        :param end

        :raises: ResponseStructureError
        """
        params = {
            'start': start,
            'end': end
        }
        result = self._client.get(self._full_path(), params=params)
        if 'list' not in result:

# Path: moira_client/client.py
# class InvalidJSONError(Exception):
#     def __init__(self, content):
#         """
# 
#         :param content: bytes response content
#         """
#         self.content = content
# 
# Path: moira_client/client.py
# class ResponseStructureError(Exception):
#     def __init__(self, msg, content):
#         """
# 
#         :param msg: str error message
#         :param content: dict response content
#         """
#         self.msg = msg
#         self.content = content


# Path: moira_client/models/notification.py
from ..client import InvalidJSONError
from ..client import ResponseStructureError

class NotificationManager:
    def __init__(self, client):
        self._client = client

    def fetch_all(self):
        """
        Returns all notifications
        :return: list of dict

        :raises: ResponseStructureError
        """
        result = self.fetch(start=0, end=-1)
        return result

    def fetch(self, start, end):
        """
        Gets a paginated list of notifications
        :return: list of dict

        :param start
        :param end

        :raises: ResponseStructureError
        """
        params = {
            'start': start,
            'end': end
        }
        result = self._client.get(self._full_path(), params=params)
        if 'list' not in result:

            raise ResponseStructureError("list doesn't exist in response", result)