# Path: sevenbridges/errors.py
# class PaginationError(SbgError):
#     def __init__(self, message):
#         super().__init__(
#             code=-1, status=-1, message=message
#         )
# 
# class SbgError(Exception):
#     """Base class for SBG errors.
# 
#     Provides a base exception for all errors
#     that are thrown by sevenbridges-python library.
#     """
# 
#     def __init__(self, message=None, code=None, status=None, more_info=None):
#         """
#         :param code: Custom error code
#         :param status: Http status code.
#         :param message: Message describing the error.
#         """
#         self.code = code
#         self.status = status
#         self.message = message
#         self.more_info = more_info
# 
#     def __str__(self):
#         return str(self.message)
# 
# Path: sevenbridges/models/compound/volumes/volume_object.py
# class VolumeObject(Resource):
#     """
#     Volume object resource contains information about single
#     file (object) entry in a specific volume.
#     """
#     href = StringField(read_only=True)
#     location = StringField(read_only=True)
#     volume = StringField(read_only=True)
#     type = StringField(read_only=True)
#     metadata = DictField(read_only=True)
# 
#     def __str__(self):
#         return f'<VolumeObject: location={self.location}>'
# 
# Path: sevenbridges/models/compound/volumes/volume_prefix.py
# class VolumePrefix(Resource):
#     """
#     Volume prefix resource contains information about volume prefixes
#     """
#     href = StringField(read_only=True)
#     prefix = StringField(read_only=True)
#     volume = StringField(read_only=True)
# 
#     def __str__(self):
#         return f'<VolumePrefix: prefix={self.prefix}>'
# 
# Path: sevenbridges/models/link.py
# class Link(Resource):
#     """
#     Pagination links.
#     """
#     href = HrefField(read_only=True)
#     rel = StringField(read_only=True)
#     method = StringField(read_only=True)
# 
#     def __str__(self):
#         return (
#             f'<Link: method={self.method}, rel={self.rel}, href={self.href}>'
#         )
# 
# class VolumeLink(Resource):
#     """
#     Pagination links for volumes.
#     """
#     next = HrefField(read_only=True)
# 
#     def __str__(self):
#         return f'<VolumeLink: next={self.next}>'


from sevenbridges.errors import PaginationError, SbgError
from sevenbridges.models.compound.volumes.volume_object import VolumeObject
from sevenbridges.models.compound.volumes.volume_prefix import VolumePrefix
from sevenbridges.models.link import Link, VolumeLink
        return (
            f'<Collection: total={self.total}, available={len(self._items)}>'
        )


class VolumeCollection(Collection):
    def __init__(self, href, items, links, prefixes, api):
        super().__init__(
            VolumeObject, href, 0, items, links, api)
        self.prefixes = prefixes

    @property
    def total(self):
        return -1

    def next_page(self):
        """
        Fetches next result set.
        :return: VolumeCollection object.
        """
        for link in self.links:
            if link.next:
                return self._load(link.next)
        raise PaginationError('No more entries.')

    def previous_page(self):
        raise PaginationError('Cannot paginate backwards')

    def _load(self, url):
        if self.resource is None:

# Path: sevenbridges/errors.py
# class PaginationError(SbgError):
#     def __init__(self, message):
#         super().__init__(
#             code=-1, status=-1, message=message
#         )
# 
# class SbgError(Exception):
#     """Base class for SBG errors.
# 
#     Provides a base exception for all errors
#     that are thrown by sevenbridges-python library.
#     """
# 
#     def __init__(self, message=None, code=None, status=None, more_info=None):
#         """
#         :param code: Custom error code
#         :param status: Http status code.
#         :param message: Message describing the error.
#         """
#         self.code = code
#         self.status = status
#         self.message = message
#         self.more_info = more_info
# 
#     def __str__(self):
#         return str(self.message)
# 
# Path: sevenbridges/models/compound/volumes/volume_object.py
# class VolumeObject(Resource):
#     """
#     Volume object resource contains information about single
#     file (object) entry in a specific volume.
#     """
#     href = StringField(read_only=True)
#     location = StringField(read_only=True)
#     volume = StringField(read_only=True)
#     type = StringField(read_only=True)
#     metadata = DictField(read_only=True)
# 
#     def __str__(self):
#         return f'<VolumeObject: location={self.location}>'
# 
# Path: sevenbridges/models/compound/volumes/volume_prefix.py
# class VolumePrefix(Resource):
#     """
#     Volume prefix resource contains information about volume prefixes
#     """
#     href = StringField(read_only=True)
#     prefix = StringField(read_only=True)
#     volume = StringField(read_only=True)
# 
#     def __str__(self):
#         return f'<VolumePrefix: prefix={self.prefix}>'
# 
# Path: sevenbridges/models/link.py
# class Link(Resource):
#     """
#     Pagination links.
#     """
#     href = HrefField(read_only=True)
#     rel = StringField(read_only=True)
#     method = StringField(read_only=True)
# 
#     def __str__(self):
#         return (
#             f'<Link: method={self.method}, rel={self.rel}, href={self.href}>'
#         )
# 
# class VolumeLink(Resource):
#     """
#     Pagination links for volumes.
#     """
#     next = HrefField(read_only=True)
# 
#     def __str__(self):
#         return f'<VolumeLink: next={self.next}>'


# Path: sevenbridges/meta/collection.py
from sevenbridges.errors import PaginationError, SbgError
from sevenbridges.models.compound.volumes.volume_object import VolumeObject
from sevenbridges.models.compound.volumes.volume_prefix import VolumePrefix
from sevenbridges.models.link import Link, VolumeLink

        return (
            f'<Collection: total={self.total}, available={len(self._items)}>'
        )


class VolumeCollection(Collection):
    def __init__(self, href, items, links, prefixes, api):
        super().__init__(
            VolumeObject, href, 0, items, links, api)
        self.prefixes = prefixes

    @property
    def total(self):
        return -1

    def next_page(self):
        """
        Fetches next result set.
        :return: VolumeCollection object.
        """
        for link in self.links:
            if link.next:
                return self._load(link.next)
        raise PaginationError('No more entries.')

    def previous_page(self):
        raise PaginationError('Cannot paginate backwards')

    def _load(self, url):
        if self.resource is None:

            raise SbgError('Undefined collection resource.')