{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module Web.Stripe.Event
(
GetEvent
, getEvent
, GetEvents
, getEvents
, Created (..)
, EndingBefore (..)
, EventId (..)
, Event (..)
, EventData (..)
, EventType (..)
, StripeList (..)
, Limit (..)
, StartingAfter (..)
) where
import Web.Stripe.StripeRequest (Method (GET),
StripeHasParam, StripeRequest (..),
StripeReturn,
mkStripeRequest)
import Web.Stripe.Util ((</>))
import Web.Stripe.Types (Created(..), Event (..),
EventId (..), Limit,
EventData(..),
EventType(..), StripeList (..),
Limit(..), StartingAfter(..),
EndingBefore(..))
getEvent
:: EventId
-> StripeRequest GetEvent
getEvent (EventId eventid) = request
where request = mkStripeRequest GET url params
url = "events" </> eventid
params = []
data GetEvent
type instance StripeReturn GetEvent = Event
getEvents
:: StripeRequest GetEvents
getEvents
= request
where request = mkStripeRequest GET url params
url = "events"
params = []
data GetEvents
type instance StripeReturn GetEvents = (StripeList Event)
instance StripeHasParam GetEvents Created
instance StripeHasParam GetEvents (EndingBefore EventId)
instance StripeHasParam GetEvents Limit
instance StripeHasParam GetEvents (StartingAfter EventId)