| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Twfy.Client
Description
- type ApiKey = Text
- data Client = Client {}
- client :: ApiKey -> Maybe String -> Maybe Manager -> IO Client
- getConstituency :: Client -> Maybe Text -> Maybe Text -> IO (Either ServantError Constituency)
- getConstituencies :: Client -> IO (Either ServantError [Constituency])
- getMP :: Client -> Maybe Int -> Maybe Text -> Maybe Text -> Maybe Bool -> IO (Either ServantError MP)
- getMPs :: Client -> Maybe Text -> Maybe Text -> Maybe Text -> IO (Either ServantError [MP])
Documentation
Client - very subject to change, use the client function to create
Constructors
| Client | |
Fields
| |
Arguments
| :: ApiKey | API Key |
| -> Maybe String | API URI - defaults to "https://www.theyworkforyou.com/api" |
| -> Maybe Manager | HTTP Client manager - uses default TLS settings if not provided |
| -> IO Client |
Create a client.
Arguments
| :: Client | |
| -> Maybe Text | Name |
| -> Maybe Text | Post code |
| -> IO (Either ServantError Constituency) |
The getConstituency function retreives a constituency based on name or post code
getConstituencies :: Client -> IO (Either ServantError [Constituency]) Source #
The getConstituencies function retreives all constituencies