Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Paginated a = Page {
- _pageData :: !a
- _pageCursor :: !(Maybe Cursor)
- data Cursor
- data Push s = Push {
- pushData :: !(PushData s)
- pushSourceDevice :: !(Maybe DeviceId)
- pushTarget :: !(PushTarget s)
- pushGuid :: !(Maybe Guid)
- pushId :: !(EqT Existing s PushId)
- pushActive :: !(EqT Existing s Bool)
- pushCreated :: !(EqT Existing s PushbulletTime)
- pushModified :: !(EqT Existing s PushbulletTime)
- pushDismissed :: !(EqT Existing s Bool)
- pushDirection :: !(EqT Existing s PushDirection)
- pushSender :: !(EqT Existing s UserId)
- pushSenderEmail :: !(EqT Existing s EmailAddress)
- pushSenderEmailNormalized :: !(EqT Existing s EmailAddress)
- pushSenderName :: !(EqT Existing s Name)
- pushReceiver :: !(EqT Existing s UserId)
- pushReceiverEmail :: !(EqT Existing s EmailAddress)
- pushReceiverEmailNormalized :: !(EqT Existing s EmailAddress)
- pushOrigin :: !(EqT Existing s (Maybe PushOrigin))
- data PushData s
- = NotePush { }
- | LinkPush { }
- | FilePush {
- pushBody :: !Text
- pushFileName :: !Text
- pushFileType :: !MimeType
- pushFileUrl :: !Url
- pushFileTitle :: !(EqT Existing s Text)
- pushImageUrl :: !(EqT Existing s (Maybe Url))
- pushImageWidth :: !(EqT Existing s (Maybe Int))
- pushImageHeight :: !(EqT Existing s (Maybe Int))
- data PushTarget s where
- ToAll :: PushTarget New
- ToDevice :: !DeviceId -> PushTarget New
- ToEmail :: !EmailAddress -> PushTarget New
- ToChannel :: !ChannelTag -> PushTarget New
- ToClient :: !ClientId -> PushTarget New
- SentBroadcast :: PushTarget Existing
- SentToDevice :: !DeviceId -> PushTarget Existing
- simpleNewPush :: PushTarget New -> PushData New -> Push New
- newtype ExistingPushes = ExistingPushes [Push Existing]
- data Ephemeral
- data Device s = Device {
- _deviceId :: !(EqT Existing s DeviceId)
- _deviceActive :: !(EqT Existing s Bool)
- _deviceCreated :: !(EqT Existing s PushbulletTime)
- _deviceModified :: !(EqT Existing s PushbulletTime)
- _deviceIcon :: !DeviceIcon
- _deviceNickname :: !(Maybe Nickname)
- _deviceGeneratedNickname :: !(EqT Existing s Bool)
- _deviceManufacturer :: !(Maybe Manufacturer)
- _deviceModel :: !(Maybe Model)
- _deviceAppVersion :: !(Maybe AppVersion)
- _deviceFingerprint :: !(EqT Existing s (Maybe Fingerprint))
- _deviceKeyFingerprint :: !(EqT Existing s (Maybe KeyFingerprint))
- _deviceHasSms :: !HasSms
- _devicePushToken :: !(Maybe PushToken)
- newtype DeviceId = DeviceId Text
- newtype Nickname = Nickname Text
- newtype DeviceIcon = DeviceIcon Text
- data HasSms
- newtype ExistingDevices = ExistingDevices {}
- newDevice :: HasSms -> DeviceIcon -> Nickname -> Maybe Manufacturer -> Maybe Model -> Maybe AppVersion -> Device New
- data User = User {}
- newtype UserId = UserId Text
- data Permanent p where
- ThreadsOf :: !DeviceId -> Permanent ThreadList
- MessagesIn :: !DeviceId -> !SmsThreadId -> Permanent MessageList
- data PermanentK
- newtype SmsThreads = SmsThreads {
- unSmsThreads :: [SmsThread]
- data SmsThread = SmsThread {}
- newtype SmsThreadId = SmsThreadId Text
- data SmsThreadRecipient = SmsThreadRecipient {}
- newtype SmsMessages = SmsMessages {
- unSmsMessages :: [SmsMessage]
- data SmsMessage = SmsMessage {
- _smsDirection :: !SmsDirection
- _smsTime :: !PushbulletTime
- _smsBody :: !Text
- _smsId :: !SmsId
- _smsSent :: !(Maybe Bool)
- _smsType :: !SmsMessageType
- newtype SmsId = SmsId Text
- data SmsDirection
- data SmsMessageType
- newtype EmailAddress = EmailAddress Text
- newtype ChannelTag = ChannelTag Text
- newtype ClientId = ClientId Text
- newtype MimeType = MimeType Text
- newtype Url = Url Text
- newtype Guid = Guid Text
- newtype TrivialObject = TrivialObject ()
- data Status
- newtype PushbulletTime = PushbulletTime UTCTime
- newtype PhoneNumber = PhoneNumber Text
- newtype Name = Name {}
- type family EqT (s :: k) (s' :: k) (a :: *) :: * where ...
- deviceId :: forall s. Lens' (Device s) (EqT Existing s DeviceId)
- deviceActive :: forall s. Lens' (Device s) (EqT Existing s Bool)
- deviceCreated :: forall s. Lens' (Device s) (EqT Existing s PushbulletTime)
- deviceModified :: forall s. Lens' (Device s) (EqT Existing s PushbulletTime)
- deviceIcon :: forall s. Lens' (Device s) DeviceIcon
- deviceNickname :: forall s. Lens' (Device s) (Maybe Nickname)
- deviceGeneratedNickname :: forall s. Lens' (Device s) (EqT Existing s Bool)
- deviceManufacturer :: forall s. Lens' (Device s) (Maybe Manufacturer)
- deviceModel :: forall s. Lens' (Device s) (Maybe Model)
- deviceAppVersion :: forall s. Lens' (Device s) (Maybe AppVersion)
- deviceFingerprint :: forall s. Lens' (Device s) (EqT Existing s (Maybe Fingerprint))
- deviceKeyFingerprint :: forall s. Lens' (Device s) (EqT Existing s (Maybe KeyFingerprint))
- userCreated :: Lens' User PushbulletTime
- userEmail :: Lens' User EmailAddress
- userEmailNormalized :: Lens' User EmailAddress
- userId :: Lens' User UserId
- userImageUrl :: Lens' User Url
- userMaxUploadSize :: Lens' User Double
- userModified :: Lens' User PushbulletTime
- userName :: Lens' User Name
- smsDirection :: Lens' SmsMessage SmsDirection
- smsTime :: Lens' SmsMessage PushbulletTime
- smsBody :: Lens' SmsMessage Text
- smsId :: Lens' SmsMessage SmsId
- smsSent :: Lens' SmsMessage (Maybe Bool)
- smsType :: Lens' SmsMessage SmsMessageType
- recipientName :: Lens' SmsThreadRecipient Name
- recipientAddress :: Lens' SmsThreadRecipient PhoneNumber
- recipientNumber :: Lens' SmsThreadRecipient PhoneNumber
- threadId :: Lens' SmsThread SmsThreadId
- threadRecipients :: Lens' SmsThread (NonEmpty SmsThreadRecipient)
- threadLatest :: Lens' SmsThread SmsMessage
- ephSmsSourceUser :: Traversal' Ephemeral UserId
- ephSmsTargetDevice :: Traversal' Ephemeral DeviceId
- ephSmsConversation :: Traversal' Ephemeral PhoneNumber
- ephSmsMessage :: Traversal' Ephemeral Text
- ephClipBody :: Traversal' Ephemeral Text
- ephClipSourceUser :: Traversal' Ephemeral UserId
- ephClipSourceDevice :: Traversal' Ephemeral DeviceId
- pageData :: forall a a. Lens (Paginated a) (Paginated a) a a
- pageCursor :: forall a. Lens' (Paginated a) (Maybe Cursor)
Pagination
A single page of data, possibly with a cursor attached to it. The cursor may be used in routes that return paginated data to produce the next page of data.
Page | |
|
Cursors are opaque.
Pushes
A push. We reuse the same datatype for representing new pushes and
existing pushes. The EqT
type family is used to enable fields selectively
according to whether we're making a new push or representing an existing
one.
Push | |
|
The actual contents of a push.
NotePush | |
LinkPush | |
FilePush | |
|
data PushTarget s where Source #
The target of a push.
ToAll :: PushTarget New | |
ToDevice :: !DeviceId -> PushTarget New | |
ToEmail :: !EmailAddress -> PushTarget New | |
ToChannel :: !ChannelTag -> PushTarget New | |
ToClient :: !ClientId -> PushTarget New | |
SentBroadcast :: PushTarget Existing | |
SentToDevice :: !DeviceId -> PushTarget Existing |
Eq (PushTarget s) Source # | |
Show (PushTarget s) Source # | |
simpleNewPush :: PushTarget New -> PushData New -> Push New Source #
Constructs a new Push
with the source device and guid set to Nothing
.
newtype ExistingPushes Source #
A newtype wrapper for a list of existing pushes. We need this to get a
nonstandard FromJSON
instance for the list, because Pushbullet gives us
the list wrapped in a trivial object with one key.
Ephemerals
Devices
A device attached to a Pushbullet account.
Device | |
|
newtype DeviceIcon Source #
Whether the device has SMS capabilities.
newtype ExistingDevices Source #
A newtype wrapper for a list of existing devices. We need this to get a
nonstandard FromJSON
instance for the list, because Pushbullet gives us
the list wrapped in a trivial object with one key.
newDevice :: HasSms -> DeviceIcon -> Nickname -> Maybe Manufacturer -> Maybe Model -> Maybe AppVersion -> Device New Source #
Smart constructor for a new device that fills in the ignored fields.
Users
Permanents
data Permanent p where Source #
ThreadsOf :: !DeviceId -> Permanent ThreadList | |
MessagesIn :: !DeviceId -> !SmsThreadId -> Permanent MessageList |
SMS
newtype SmsThreads Source #
newtype SmsThreadId Source #
newtype SmsMessages Source #
data SmsMessage Source #
SmsMessage | |
|
data SmsDirection Source #
data SmsMessageType Source #
Misc
Data
newtype EmailAddress Source #
newtype ChannelTag Source #
newtype TrivialObject Source #
newtype PushbulletTime Source #
newtype PhoneNumber Source #
Type-level stuff
type family EqT (s :: k) (s' :: k) (a :: *) :: * where ... Source #
If the first two types are the same, return the third; else, return unit.
This type family is used to disable certain fields according to the Status
datakind.
Lenses
Device
deviceCreated :: forall s. Lens' (Device s) (EqT Existing s PushbulletTime) Source #
deviceModified :: forall s. Lens' (Device s) (EqT Existing s PushbulletTime) Source #
deviceIcon :: forall s. Lens' (Device s) DeviceIcon Source #