module Stratosphere.IoTEvents.AlarmModel.AlarmRuleProperty (
        module Exports, AlarmRuleProperty(..), mkAlarmRuleProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTEvents.AlarmModel.SimpleRuleProperty as Exports
import Stratosphere.ResourceProperties
data AlarmRuleProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-alarmmodel-alarmrule.html>
    AlarmRuleProperty {AlarmRuleProperty -> ()
haddock_workaround_ :: (),
                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-alarmmodel-alarmrule.html#cfn-iotevents-alarmmodel-alarmrule-simplerule>
                       AlarmRuleProperty -> Maybe SimpleRuleProperty
simpleRule :: (Prelude.Maybe SimpleRuleProperty)}
  deriving stock (AlarmRuleProperty -> AlarmRuleProperty -> Bool
(AlarmRuleProperty -> AlarmRuleProperty -> Bool)
-> (AlarmRuleProperty -> AlarmRuleProperty -> Bool)
-> Eq AlarmRuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AlarmRuleProperty -> AlarmRuleProperty -> Bool
== :: AlarmRuleProperty -> AlarmRuleProperty -> Bool
$c/= :: AlarmRuleProperty -> AlarmRuleProperty -> Bool
/= :: AlarmRuleProperty -> AlarmRuleProperty -> Bool
Prelude.Eq, Int -> AlarmRuleProperty -> ShowS
[AlarmRuleProperty] -> ShowS
AlarmRuleProperty -> String
(Int -> AlarmRuleProperty -> ShowS)
-> (AlarmRuleProperty -> String)
-> ([AlarmRuleProperty] -> ShowS)
-> Show AlarmRuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AlarmRuleProperty -> ShowS
showsPrec :: Int -> AlarmRuleProperty -> ShowS
$cshow :: AlarmRuleProperty -> String
show :: AlarmRuleProperty -> String
$cshowList :: [AlarmRuleProperty] -> ShowS
showList :: [AlarmRuleProperty] -> ShowS
Prelude.Show)
mkAlarmRuleProperty :: AlarmRuleProperty
mkAlarmRuleProperty :: AlarmRuleProperty
mkAlarmRuleProperty
  = AlarmRuleProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), simpleRule :: Maybe SimpleRuleProperty
simpleRule = Maybe SimpleRuleProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties AlarmRuleProperty where
  toResourceProperties :: AlarmRuleProperty -> ResourceProperties
toResourceProperties AlarmRuleProperty {Maybe SimpleRuleProperty
()
haddock_workaround_ :: AlarmRuleProperty -> ()
simpleRule :: AlarmRuleProperty -> Maybe SimpleRuleProperty
haddock_workaround_ :: ()
simpleRule :: Maybe SimpleRuleProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoTEvents::AlarmModel.AlarmRule",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> SimpleRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SimpleRule" (SimpleRuleProperty -> (Key, Value))
-> Maybe SimpleRuleProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SimpleRuleProperty
simpleRule])}
instance JSON.ToJSON AlarmRuleProperty where
  toJSON :: AlarmRuleProperty -> Value
toJSON AlarmRuleProperty {Maybe SimpleRuleProperty
()
haddock_workaround_ :: AlarmRuleProperty -> ()
simpleRule :: AlarmRuleProperty -> Maybe SimpleRuleProperty
haddock_workaround_ :: ()
simpleRule :: Maybe SimpleRuleProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> SimpleRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SimpleRule" (SimpleRuleProperty -> (Key, Value))
-> Maybe SimpleRuleProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SimpleRuleProperty
simpleRule]))
instance Property "SimpleRule" AlarmRuleProperty where
  type PropertyType "SimpleRule" AlarmRuleProperty = SimpleRuleProperty
  set :: PropertyType "SimpleRule" AlarmRuleProperty
-> AlarmRuleProperty -> AlarmRuleProperty
set PropertyType "SimpleRule" AlarmRuleProperty
newValue AlarmRuleProperty {Maybe SimpleRuleProperty
()
haddock_workaround_ :: AlarmRuleProperty -> ()
simpleRule :: AlarmRuleProperty -> Maybe SimpleRuleProperty
haddock_workaround_ :: ()
simpleRule :: Maybe SimpleRuleProperty
..}
    = AlarmRuleProperty {simpleRule :: Maybe SimpleRuleProperty
simpleRule = SimpleRuleProperty -> Maybe SimpleRuleProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SimpleRule" AlarmRuleProperty
SimpleRuleProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}