API
This module exports everything that you need to be able to create your
own framework test provider. To create a provider you need to:
- Create an instance of the Testlike class
- Create an instance of the TestResultlike class
- Expose a function that lets people construct Test values
using your new instances
This module exports everything that you need to be able to create your
own test runner.
An element in the exposed API
Our API documentation type, a product of top-level information and a
good old hashmap from
Endpoint to
Action
multipart/form-data Servant API support for servant. see
servant-multipart and servant-multipart-client for server- and client-
definitions.
This is mostly useful for adding file upload support to an API. See
haddocks of
MultipartForm for an introduction.
These functions are for conveniently implementing the simple CLI
Low level XMLRPC API based directly on the python API since that is
the only available reference documentation:
https://koji.fedoraproject.org/koji/api.
Note that many of the procedures in this module are untested and
experimental: particularly most of those that return a Value.
Higher level wrapper procedures live in Distribution.Koji.
Fixes and enhancements welcome.
Module that implements the Mail API of SendGrid v3.
https://sendgrid.com/docs/API_Reference/api_v3.html
{-# LANGUAGE OverloadedStrings #-}
import Data.List.NonEmpty (fromList)
import Network.SendGridV3.Api
import Control.Lens ((^.))
import Network.Wreq (responseStatus, statusCode)
sendGridApiKey :: ApiKey
sendGridApiKey = ApiKey "SG..."
testMail :: Mail () ()
testMail =
let to = personalization $ fromList [MailAddress "john@example.com" "John Doe"]
from = MailAddress "jane@example.com" "Jane Smith"
subject = "Email Subject"
content = fromList [mailContentText "Example Content"]
in mail [to] from subject content
main :: IO ()
main = do
-- Send an email, overriding options as needed
eResponse <- sendMail sendGridApiKey (testMail { _mailSendAt = Just 1516468000 })
case eResponse of
Left httpException -> error $ show httpException
Right response -> print (response ^. responseStatus . statusCode)
Raw Servant API for Advent of Code. Can be useful for building mock
servers, generating documentation and other servanty things, or
low-level raw requests.
If you use this to make requests directly, please use responsibly: do
not make automated requests more than once per day and throttle all
manual requestes. See notes in
Advent.
Binance.org API requests & responses.