How to use the boxsdk.pagination.limit_offset_based_object_collection.LimitOffsetBasedObjectCollection function in boxsdk

To help you get started, we’ve selected a few boxsdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github box / box-python-sdk / test / unit / pagination / test_limit_offset_based_object_collection.py View on Github external
def _object_collection_instance(self, session, limit=None, return_full_pages=False, starting_pointer=None):
        """Baseclass override."""
        if starting_pointer is None:
            starting_pointer = 0
        return LimitOffsetBasedObjectCollection(
            session,
            '/some/endpoint',
            limit=limit,
            return_full_pages=return_full_pages,
            offset=starting_pointer,
        )
github box / box-python-sdk / boxsdk / object / folder.py View on Github external
if direction:
            additional_params['direction'] = direction

        if use_marker:
            additional_params['usemarker'] = True
            return MarkerBasedObjectCollection(
                url=url,
                session=self._session,
                limit=limit,
                marker=marker,
                fields=fields,
                additional_params=additional_params,
                return_full_pages=False,
            )

        return LimitOffsetBasedObjectCollection(
            url=url,
            session=self._session,
            limit=limit,
            offset=offset,
            fields=fields,
            additional_params=additional_params,
            return_full_pages=False,
        )
github box / box-python-sdk / boxsdk / client / client.py View on Github external
:type limit:
            `int` or None
        :param offset:
            The offset of the item at which to begin the response.
        :type offset:
            `int` or None
        :param fields:
            List of fields to request.
        :type fields:
            `Iterable` of `unicode`
        :returns:
            An iterator of the entries in the pending collaborations
        :rtype:
            :class:`BoxObjectCollection`
        """
        return LimitOffsetBasedObjectCollection(
            session=self._session,
            url=self.get_url('collaborations'),
            additional_params={'status': 'pending'},
            limit=limit,
            offset=offset,
            fields=fields,
            return_full_pages=False,
        )
github box / box-python-sdk / boxsdk / object / user.py View on Github external
The offset of the item at which to begin the response.
        :type offset:
            `int` or None
        :param fields:
            List of fields to request.
        :type fields:
            `Iterable` of `unicode`
        :returns:
            An iterator of the entries in the groups
        :rtype:
            :class:`BoxObjectCollection`
        """
        additional_params = {}
        if fields is not None:
            additional_params['fields'] = ','.join(fields)
        return LimitOffsetBasedObjectCollection(
            session=self._session,
            url=self.get_url('memberships'),
            additional_params=additional_params,
            limit=limit,
            offset=offset,
            return_full_pages=False,
        )
github box / box-python-sdk / boxsdk / client / client.py View on Github external
additional_params['filter_term'] = filter_term
        if user_type:
            additional_params['user_type'] = user_type

        if use_marker:
            additional_params['usemarker'] = True
            return MarkerBasedObjectCollection(
                url=url,
                session=self._session,
                limit=limit,
                marker=marker,
                fields=fields,
                additional_params=additional_params,
                return_full_pages=False,
            )
        return LimitOffsetBasedObjectCollection(
            url=url,
            session=self._session,
            additional_params=additional_params,
            limit=limit,
            offset=offset,
            fields=fields,
            return_full_pages=False,
        )
github box / box-python-sdk / boxsdk / object / search.py View on Github external
if updated_at_range is not None:
            additional_params['updated_at_range'] = '{},{}'.format(updated_at_range[0] or '', updated_at_range[1] or '')
        if size_range is not None:
            additional_params['size_range'] = '{},{}'.format(size_range[0] or '', size_range[1] or '')
        if owner_users is not None:
            additional_params['owner_user_ids'] = ','.join([user.object_id for user in owner_users])
        if trash_content is not None:
            additional_params['trash_content'] = trash_content
        if sort is not None:
            additional_params['sort'] = sort
        if direction is not None:
            additional_params['direction'] = direction

        additional_params.update(kwargs)

        return LimitOffsetBasedObjectCollection(
            self._session,
            url,
            limit=limit,
            offset=offset,
            fields=fields,
            additional_params=additional_params,
            return_full_pages=False,
        )
github box / box-python-sdk / boxsdk / object / group.py View on Github external
The offset of the item at which to begin the response.
        :type offset:
            `int` or None
        :param fields:
            List of fields to request.
        :type fields:
            `Iterable` of `unicode`
        :returns:
            An iterator of the entries in the collaboration for the group.
        :rtype:
            :class:`BoxObjectCollection`
        """
        additional_params = {}
        if fields is not None:
            additional_params['fields'] = ','.join(fields)
        return LimitOffsetBasedObjectCollection(
            session=self._session,
            url=self.get_url('collaborations'),
            additional_params=additional_params,
            limit=limit,
            offset=offset,
            return_full_pages=False,
        )
github box / box-python-sdk / boxsdk / object / group.py View on Github external
Get the membership records for the group, which indicate which users are included in the group.

        :param offset:
            The index at which to begin.
        :type offset:
            `int` or None
        :param limit:
            The maximum number of items to return in a page.
        :type limit:
            `int` or None
        :returns:
            The collection of membership objects for the group.
        :rtype:
            `Iterable` of :class:`GroupMembership`
        """
        return LimitOffsetBasedObjectCollection(
            self._session,
            url=self.get_url('memberships'),
            limit=limit,
            offset=offset,
            fields=fields,
            return_full_pages=False,
        )
github box / box-python-sdk / boxsdk / object / file.py View on Github external
:type limit:
            `int` or None
        :param offset:
            The index at which to start returning items.
        :type offset:
            `int`
        :param fields:
            List of fields to request.
        :type fields:
            `Iterable` of `unicode`
        :returns:
            An iterator of the previous versions of the file.
        :rtype:
            :class:`BoxObjectCollection`
        """
        return LimitOffsetBasedObjectCollection(
            session=self.session,
            url=self.get_url('versions'),
            limit=limit,
            fields=fields,
            offset=offset,
            return_full_pages=False,
        )