boxsdk.pagination package

Submodules

boxsdk.pagination.box_object_collection module

class boxsdk.pagination.box_object_collection.BoxObjectCollection(session, url, limit=None, fields=None, additional_params=None, return_full_pages=False)[source]

Bases: _abcoll.Iterator, object

An iterator that represents a collection of Box objects (BaseObject).

A BoxObjectCollection instance contains everything it needs in order to retrieve and page through responses from Box API endpoints that return collections of Box objects.

This class only has two public methods:

1). next(), which returns either a Page (sequence of BaseObjects) or individual BaseObjects based on the constructor argument ‘return_full_pages’.

2). next_pointer(), which returns the pointer (either an offset or a marker, based on the endpoint) that will be used to retrieve the next page of Box objects. This pointer can be used when requesting new BoxObjectCollection instances that start off from a particular page, instead of from the very beginning.

next()[source]

Returns either a Page (a Sequence of BaseObjects) or a BaseObject depending on self._return_full_pages.

Invoking this method may make an API call to Box. Any exceptions that can occur while making requests may be raised in this method.

Return type:Page or BaseObject
next_pointer()[source]

The pointer that will be used to request the next page of Box objects.

For limit-offset based paging, this is an offset. For marker-based paging, this is a marker.

The pointer only gets progressed upon successful page requests to Box.

Return type:varies

boxsdk.pagination.dict_page module

class boxsdk.pagination.dict_page.DictPage(session, response_object)[source]

Bases: boxsdk.pagination.page.Page

boxsdk.pagination.limit_offset_based_dict_collection module

class boxsdk.pagination.limit_offset_based_dict_collection.LimitOffsetBasedDictCollection(session, url, limit=None, fields=None, additional_params=None, return_full_pages=False, offset=0)[source]

Bases: boxsdk.pagination.limit_offset_based_object_collection.LimitOffsetBasedObjectCollection

Represents a limit/offset-based collection of simple dicts, which are not translated into objects.

boxsdk.pagination.limit_offset_based_object_collection module

class boxsdk.pagination.limit_offset_based_object_collection.LimitOffsetBasedObjectCollection(session, url, limit=None, fields=None, additional_params=None, return_full_pages=False, offset=0)[source]

Bases: boxsdk.pagination.box_object_collection.BoxObjectCollection

An iterator of Box objects (BaseObjects) that were retrieved from a Box API endpoint that supports limit-offset type of pagination.

See https://developer.box.com/reference#pagination for more details.

next_pointer()[source]

Baseclass override.

boxsdk.pagination.marker_based_dict_collection module

class boxsdk.pagination.marker_based_dict_collection.MarkerBasedDictCollection(session, url, limit=None, fields=None, additional_params=None, return_full_pages=False, marker=None, supports_limit_offset_paging=False)[source]

Bases: boxsdk.pagination.marker_based_object_collection.MarkerBasedObjectCollection

Represents a marker-based collection of simple dicts, which are not translated into objects.

boxsdk.pagination.marker_based_object_collection module

class boxsdk.pagination.marker_based_object_collection.MarkerBasedObjectCollection(session, url, limit=None, fields=None, additional_params=None, return_full_pages=False, marker=None, supports_limit_offset_paging=False)[source]

Bases: boxsdk.pagination.box_object_collection.BoxObjectCollection

An iterator of Box objects (BaseObjects) that were retrieved from a Box API endpoint that supports marker type of pagination.

See https://developer.box.com/reference#pagination for more details.

next_pointer()[source]

Baseclass override.

boxsdk.pagination.page module

class boxsdk.pagination.page.Page(session, response_object)[source]

Bases: _abcoll.Sequence, object

A sequence of BaseObjects that belong to a page returned from a paging api call.

The Page makes available detailed response data for page requests.

response_object

Return a copy of the response object for this Page.

Return type:dict

Module contents