packages feed

mailtrap 0.1.1.0 → 0.1.2.0

raw patch · 3 files changed

+10/−1 lines, 3 files

Files

changelog.md view
@@ -1,3 +1,6 @@+## 0.1.2.0+* Add `FromJSON` and `ToJSON` instances for the `Token` type.+ ## 0.1.1.0 * Export types: `EmailAddress`, `Inbox`, `InboxMessage`. 
mailtrap.cabal view
@@ -1,5 +1,5 @@ name: mailtrap-version: 0.1.1.0+version: 0.1.2.0 category: Email synopsis: Mailtrap API library. description:
src/Network/Mail/Mailtrap.hs view
@@ -83,6 +83,12 @@ -- | Authorization token. newtype Token = Token Text deriving (Eq, Show) +instance FromJSON Token where+  parseJSON = JSON.withText "Mailtrap Token" (pure . Token)++instance ToJSON Token where+  toJSON (Token token) = JSON.toJSON token+ -- | Exceptions thrown by functions from this module. data Exception =     -- | API request returned list of errors.