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