{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.CloudWatchEvents.Types.Sum where
import Network.AWS.Prelude
data RuleState
= Disabled
| Enabled
deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)
instance FromText RuleState where
parser = takeLowerText >>= \case
"disabled" -> pure Disabled
"enabled" -> pure Enabled
e -> fromTextError $ "Failure parsing RuleState from value: '" <> e
<> "'. Accepted values: disabled, enabled"
instance ToText RuleState where
toText = \case
Disabled -> "DISABLED"
Enabled -> "ENABLED"
instance Hashable RuleState
instance NFData RuleState
instance ToByteString RuleState
instance ToQuery RuleState
instance ToHeader RuleState
instance ToJSON RuleState where
toJSON = toJSONText
instance FromJSON RuleState where
parseJSON = parseJSONText "RuleState"