module Twilio.Types.Issue
( Issue(..)
) where
import Control.Monad
import Data.Aeson
import Data.Data
import GHC.Generics
data Issue
= ImperfectAudio
| DroppedCall
| IncorrectCallerId
| PostDialDelay
| DigitsNotCaptured
| UnsolicitedCall
| AudioLatency
| OneWayAudio
deriving (Bounded, Data, Enum, Eq, Generic, Ord, Read, Show, Typeable)
instance FromJSON Issue where
parseJSON (String "imperfect-audio") = return ImperfectAudio
parseJSON (String "dropped-call") = return DroppedCall
parseJSON (String "incorrect-caller-id") = return IncorrectCallerId
parseJSON (String "post-dial-delay") = return PostDialDelay
parseJSON (String "digits-not-captured") = return DigitsNotCaptured
parseJSON (String "unsolicited-call") = return UnsolicitedCall
parseJSON (String "audio-latency") = return AudioLatency
parseJSON (String "one-way-audio") = return OneWayAudio
parseJSON _ = mzero
instance ToJSON Issue where
toJSON ImperfectAudio = String "imperfect-audio"
toJSON DroppedCall = String "dropped-call"
toJSON IncorrectCallerId = String "incorrect-caller-id"
toJSON PostDialDelay = String "post-dial-delay"
toJSON DigitsNotCaptured = String "digits-not-captured"
toJSON UnsolicitedCall = String "unsolicited-call"
toJSON AudioLatency = String "audio-latency"
toJSON OneWayAudio = String "one-way-audio"