module Stratosphere.IoTEvents.DetectorModel.TransitionEventProperty (
        module Exports, TransitionEventProperty(..),
        mkTransitionEventProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTEvents.DetectorModel.ActionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data TransitionEventProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-detectormodel-transitionevent.html>
    TransitionEventProperty {TransitionEventProperty -> ()
haddock_workaround_ :: (),
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-detectormodel-transitionevent.html#cfn-iotevents-detectormodel-transitionevent-actions>
                             TransitionEventProperty -> Maybe [ActionProperty]
actions :: (Prelude.Maybe [ActionProperty]),
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-detectormodel-transitionevent.html#cfn-iotevents-detectormodel-transitionevent-condition>
                             TransitionEventProperty -> Value Text
condition :: (Value Prelude.Text),
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-detectormodel-transitionevent.html#cfn-iotevents-detectormodel-transitionevent-eventname>
                             TransitionEventProperty -> Value Text
eventName :: (Value Prelude.Text),
                             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-detectormodel-transitionevent.html#cfn-iotevents-detectormodel-transitionevent-nextstate>
                             TransitionEventProperty -> Value Text
nextState :: (Value Prelude.Text)}
  deriving stock (TransitionEventProperty -> TransitionEventProperty -> Bool
(TransitionEventProperty -> TransitionEventProperty -> Bool)
-> (TransitionEventProperty -> TransitionEventProperty -> Bool)
-> Eq TransitionEventProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TransitionEventProperty -> TransitionEventProperty -> Bool
== :: TransitionEventProperty -> TransitionEventProperty -> Bool
$c/= :: TransitionEventProperty -> TransitionEventProperty -> Bool
/= :: TransitionEventProperty -> TransitionEventProperty -> Bool
Prelude.Eq, Int -> TransitionEventProperty -> ShowS
[TransitionEventProperty] -> ShowS
TransitionEventProperty -> String
(Int -> TransitionEventProperty -> ShowS)
-> (TransitionEventProperty -> String)
-> ([TransitionEventProperty] -> ShowS)
-> Show TransitionEventProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransitionEventProperty -> ShowS
showsPrec :: Int -> TransitionEventProperty -> ShowS
$cshow :: TransitionEventProperty -> String
show :: TransitionEventProperty -> String
$cshowList :: [TransitionEventProperty] -> ShowS
showList :: [TransitionEventProperty] -> ShowS
Prelude.Show)
mkTransitionEventProperty ::
  Value Prelude.Text
  -> Value Prelude.Text
     -> Value Prelude.Text -> TransitionEventProperty
mkTransitionEventProperty :: Value Text -> Value Text -> Value Text -> TransitionEventProperty
mkTransitionEventProperty Value Text
condition Value Text
eventName Value Text
nextState
  = TransitionEventProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), condition :: Value Text
condition = Value Text
condition,
       eventName :: Value Text
eventName = Value Text
eventName, nextState :: Value Text
nextState = Value Text
nextState,
       actions :: Maybe [ActionProperty]
actions = Maybe [ActionProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties TransitionEventProperty where
  toResourceProperties :: TransitionEventProperty -> ResourceProperties
toResourceProperties TransitionEventProperty {Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: TransitionEventProperty -> ()
actions :: TransitionEventProperty -> Maybe [ActionProperty]
condition :: TransitionEventProperty -> Value Text
eventName :: TransitionEventProperty -> Value Text
nextState :: TransitionEventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
eventName :: Value Text
nextState :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoTEvents::DetectorModel.TransitionEvent",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"Condition" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
condition, Key
"EventName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
eventName,
                            Key
"NextState" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
nextState]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [ActionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Actions" ([ActionProperty] -> (Key, Value))
-> Maybe [ActionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ActionProperty]
actions]))}
instance JSON.ToJSON TransitionEventProperty where
  toJSON :: TransitionEventProperty -> Value
toJSON TransitionEventProperty {Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: TransitionEventProperty -> ()
actions :: TransitionEventProperty -> Maybe [ActionProperty]
condition :: TransitionEventProperty -> Value Text
eventName :: TransitionEventProperty -> Value Text
nextState :: TransitionEventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
eventName :: Value Text
nextState :: Value Text
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"Condition" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
condition, Key
"EventName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
eventName,
               Key
"NextState" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
nextState]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [ActionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Actions" ([ActionProperty] -> (Key, Value))
-> Maybe [ActionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ActionProperty]
actions])))
instance Property "Actions" TransitionEventProperty where
  type PropertyType "Actions" TransitionEventProperty = [ActionProperty]
  set :: PropertyType "Actions" TransitionEventProperty
-> TransitionEventProperty -> TransitionEventProperty
set PropertyType "Actions" TransitionEventProperty
newValue TransitionEventProperty {Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: TransitionEventProperty -> ()
actions :: TransitionEventProperty -> Maybe [ActionProperty]
condition :: TransitionEventProperty -> Value Text
eventName :: TransitionEventProperty -> Value Text
nextState :: TransitionEventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
eventName :: Value Text
nextState :: Value Text
..}
    = TransitionEventProperty {actions :: Maybe [ActionProperty]
actions = [ActionProperty] -> Maybe [ActionProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [ActionProperty]
PropertyType "Actions" TransitionEventProperty
newValue, ()
Value Text
haddock_workaround_ :: ()
condition :: Value Text
eventName :: Value Text
nextState :: Value Text
haddock_workaround_ :: ()
condition :: Value Text
eventName :: Value Text
nextState :: Value Text
..}
instance Property "Condition" TransitionEventProperty where
  type PropertyType "Condition" TransitionEventProperty = Value Prelude.Text
  set :: PropertyType "Condition" TransitionEventProperty
-> TransitionEventProperty -> TransitionEventProperty
set PropertyType "Condition" TransitionEventProperty
newValue TransitionEventProperty {Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: TransitionEventProperty -> ()
actions :: TransitionEventProperty -> Maybe [ActionProperty]
condition :: TransitionEventProperty -> Value Text
eventName :: TransitionEventProperty -> Value Text
nextState :: TransitionEventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
eventName :: Value Text
nextState :: Value Text
..}
    = TransitionEventProperty {condition :: Value Text
condition = PropertyType "Condition" TransitionEventProperty
Value Text
newValue, Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
eventName :: Value Text
nextState :: Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
eventName :: Value Text
nextState :: Value Text
..}
instance Property "EventName" TransitionEventProperty where
  type PropertyType "EventName" TransitionEventProperty = Value Prelude.Text
  set :: PropertyType "EventName" TransitionEventProperty
-> TransitionEventProperty -> TransitionEventProperty
set PropertyType "EventName" TransitionEventProperty
newValue TransitionEventProperty {Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: TransitionEventProperty -> ()
actions :: TransitionEventProperty -> Maybe [ActionProperty]
condition :: TransitionEventProperty -> Value Text
eventName :: TransitionEventProperty -> Value Text
nextState :: TransitionEventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
eventName :: Value Text
nextState :: Value Text
..}
    = TransitionEventProperty {eventName :: Value Text
eventName = PropertyType "EventName" TransitionEventProperty
Value Text
newValue, Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
nextState :: Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
nextState :: Value Text
..}
instance Property "NextState" TransitionEventProperty where
  type PropertyType "NextState" TransitionEventProperty = Value Prelude.Text
  set :: PropertyType "NextState" TransitionEventProperty
-> TransitionEventProperty -> TransitionEventProperty
set PropertyType "NextState" TransitionEventProperty
newValue TransitionEventProperty {Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: TransitionEventProperty -> ()
actions :: TransitionEventProperty -> Maybe [ActionProperty]
condition :: TransitionEventProperty -> Value Text
eventName :: TransitionEventProperty -> Value Text
nextState :: TransitionEventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
eventName :: Value Text
nextState :: Value Text
..}
    = TransitionEventProperty {nextState :: Value Text
nextState = PropertyType "NextState" TransitionEventProperty
Value Text
newValue, Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
eventName :: Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Value Text
eventName :: Value Text
..}