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

Safe HaskellNone
LanguageHaskell2010

Twfy.Client

Description

 

Synopsis

Documentation

type ApiKey = Text Source #

API Key

data Client Source #

Client - very subject to change, use the client function to create

Constructors

Client 

Fields

Instances

client Source #

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.

getConstituency Source #

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

getMP Source #

Arguments

:: Client 
-> Maybe Int

Id

-> Maybe Text

Constituency name

-> Maybe Text

Post code

-> Maybe Bool

Always return

-> IO (Either ServantError MP) 

The getMP function retreives an MP

getMPs Source #

Arguments

:: Client 
-> Maybe Text

Name search

-> Maybe Text

Party name

-> Maybe Text

Date

-> IO (Either ServantError [MP]) 

The getMPs function retreives a list of MPs