module Twilio.Applications
(
Applications(..)
, Twilio.Applications.get
) where
import Control.Applicative
import Control.Monad.Catch
import Data.Aeson
import Data.Maybe
import Control.Monad.Twilio
import Twilio.Application
import Twilio.Internal.Request
import Twilio.Internal.Resource as Resource
import Twilio.Types
data Applications = Applications
{ applicationsPagingInformation :: PagingInformation
, applicationList :: [Application]
} deriving (Show, Eq)
instance List Applications Application where
getListWrapper = wrap (Applications . fromJust)
getList = applicationList
getPlural = Const "applications"
instance FromJSON Applications where
parseJSON = parseJSONToList
instance Get0 Applications where
get0 = request parseJSONFromResponse =<< makeTwilioRequest "/Applications.json"
get :: MonadThrow m => TwilioT m Applications
get = Resource.get