twfy-api-client-0.1.0.0: They Work For You API Client Library

Safe HaskellNone
LanguageHaskell2010

Twfy.Api

Description

Servant client API for They Work For You

Different calls are being implemented as needed for now so if you require any of the API calls that are not yet implemented please either submit a pull request via github or let me know you want it and I will add it myself.

TODO: getPerson, getMPInfo, getMPsInfo, getLord, getLords, getMLA, getMLAs, getMSP, getMSPs, getGeometry, getBoundary, getCommittee, getDebates, getWrans, getWMS, getHansard, getComments

Synopsis

Documentation

type TwfyAPI = ("getConstituency" :> (QueryParam "key" ApiKey :> (QueryParam "name" Text :> (QueryParam "postcode" Text :> Get '[JsonIso8859] Constituency)))) :<|> (("getConstituencies" :> (QueryParam "key" ApiKey :> Get '[JsonIso8859] [Constituency])) :<|> (("getMP" :> (QueryParam "key" ApiKey :> (QueryParam "id" Int :> (QueryParam "constituency" Text :> (QueryParam "postcode" Text :> (QueryParam "always_return" Bool :> Get '[JsonIso8859] MP)))))) :<|> ("getMPs" :> (QueryParam "key" ApiKey :> (QueryParam "search" Text :> (QueryParam "party" Text :> (QueryParam "date" Text :> Get '[JsonIso8859] [MP]))))))) Source #

Servant API definition

type ApiKey = Text Source #

API Key

getConstituency Source #

Arguments

:: Maybe ApiKey

API key

-> Maybe Text

Name

-> Maybe Text

Post code

-> ClientM Constituency 

The getConstituency function retreives a constituency based on name or post code

getConstituencies Source #

Arguments

:: Maybe ApiKey

API key

-> ClientM [Constituency] 

The getConstituencies function retreives all constituencies

getMP Source #

Arguments

:: Maybe ApiKey

API key

-> Maybe Int

Id

-> Maybe Text

Constituency name

-> Maybe Text

Post code

-> Maybe Bool

Always return

-> ClientM MP 

The getMP function retreives an MP

getMPs Source #

Arguments

:: Maybe ApiKey

API key

-> Maybe Text

Name search

-> Maybe Text

party name

-> Maybe Text

Date

-> ClientM [MP] 

The getMPs function retreives a list of MPs