servant-pushbullet-client-0.4.0.0: Bindings to the Pushbullet API using servant-client

Safe HaskellNone
LanguageHaskell2010

Network.Pushbullet.Misc

Description

  • Miscellaneous functions and types for dealing with pushbullet data.

Synopsis

Documentation

data Count Source #

A count of items to retrieve from the API.

Constructors

All 
Limit Int 

getPaginatedLimit Source #

Arguments

:: Monad m 
=> Count

The count of items you wish to retrieve from the API.

-> Paginated [a]

The first page of data to kick off the process.

-> (Cursor -> m (Paginated [a]))

How to retrieve the next page given a cursor.

-> m [a] 

Retrieves paginated data as a list.

Suppose 550 items from a resource with 1100 entries and Pushbullet emits pages of 100 items each. This function takes care of repeatedly calling the API and keeping track of the cursors emitted from subsequent calls until those 550 items have been collected.