smsaero-0.4: SMSAero API and HTTP client based on servant library.

Copyright(c) 2015, GetShopTV
LicenseBSD3
Maintainernickolay@getshoptv.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

SMSAero.API

Contents

Description

This module describes SMSAero API and defines corresponding types.

Synopsis

API

type SMSAeroAPI = RequireAuth :> (AnswerJson :> (("send" :> SendApi) :<|> (("status" :> StatusApi) :<|> (("balance" :> SmsAeroGet BalanceResponse) :<|> (("senders" :> SmsAeroGet SendersResponse) :<|> ("sign" :> SmsAeroGet SignResponse)))))) Source

SMSAero API.

type StatusApi = RequiredQueryParam "id" MessageId :> SmsAeroGet MessageStatus Source

SMSAero API to check message status.

Combinators

data SmsAeroJson Source

Content type for SMSAero JSON answer (it has JSON body but "text/plain" Content-Type).

data AnswerJson Source

Implicit parameter that tells SMSAero to respond with JSON.

Instances

HasDocs * sub => HasDocs * ((:>) * * AnswerJson sub) Source 
HasClient sub => HasClient ((:>) * * AnswerJson sub) Source 
type Client ((:>) * * AnswerJson sub) = Client sub Source 

data RequireAuth Source

SMSAero authentication credentials.

Instances

HasDocs * sub => HasDocs * ((:>) * * RequireAuth sub) Source 
HasClient sub => HasClient ((:>) * * RequireAuth sub) Source 
type Client ((:>) * * RequireAuth sub) = SMSAeroAuth -> Client sub Source 

data RequiredQueryParam sym a Source

Like QueryParam, but always required.

Instances

(KnownSymbol sym, ToParam * (QueryParam * sym a), HasDocs * sub) => HasDocs * ((:>) * * (RequiredQueryParam sym a) sub) Source 
(HasClient sub, KnownSymbol sym, ToText a) => HasClient ((:>) * * (RequiredQueryParam sym a) sub) Source 
type Client ((:>) * * (RequiredQueryParam sym a) sub) = a -> Client sub Source 

type SmsAeroGet a = Get `[SmsAeroJson]` (SmsAeroResponse a) Source

Regular SMSAero GET API.

Types

data SMSAeroAuth Source

SMSAero authentication data.

Constructors

SMSAeroAuth 

Fields

authUser :: Text

Username.

authPassword :: Text

MD5 hash of a password.

newtype Signature Source

SMSAero sender's signature. This is used for the "from" field.

Constructors

Signature 

Fields

getSignature :: Text
 

newtype Phone Source

Phone number.

Constructors

Phone 

Fields

getPhone :: Int64
 

newtype SMSAeroDate Source

Date. Textually SMSAeroDate is represented as a number of seconds since 01 Jan 1970.

Constructors

SMSAeroDate 

Responses

newtype BalanceResponse Source

SMSAero response to a balance request. This is a number of available messages to send.

Constructors

BalanceResponse Double 

newtype SendersResponse Source

SMSAero response to a senders request. This is just a list of available signatures.

Constructors

SendersResponse [Signature]