module Stratosphere.IoTEvents.DetectorModel.EventProperty (
module Exports, EventProperty(..), mkEventProperty
) 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 EventProperty
=
EventProperty {EventProperty -> ()
haddock_workaround_ :: (),
EventProperty -> Maybe [ActionProperty]
actions :: (Prelude.Maybe [ActionProperty]),
EventProperty -> Maybe (Value Text)
condition :: (Prelude.Maybe (Value Prelude.Text)),
EventProperty -> Value Text
eventName :: (Value Prelude.Text)}
deriving stock (EventProperty -> EventProperty -> Bool
(EventProperty -> EventProperty -> Bool)
-> (EventProperty -> EventProperty -> Bool) -> Eq EventProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EventProperty -> EventProperty -> Bool
== :: EventProperty -> EventProperty -> Bool
$c/= :: EventProperty -> EventProperty -> Bool
/= :: EventProperty -> EventProperty -> Bool
Prelude.Eq, Int -> EventProperty -> ShowS
[EventProperty] -> ShowS
EventProperty -> String
(Int -> EventProperty -> ShowS)
-> (EventProperty -> String)
-> ([EventProperty] -> ShowS)
-> Show EventProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EventProperty -> ShowS
showsPrec :: Int -> EventProperty -> ShowS
$cshow :: EventProperty -> String
show :: EventProperty -> String
$cshowList :: [EventProperty] -> ShowS
showList :: [EventProperty] -> ShowS
Prelude.Show)
mkEventProperty :: Value Prelude.Text -> EventProperty
mkEventProperty :: Value Text -> EventProperty
mkEventProperty Value Text
eventName
= EventProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), eventName :: Value Text
eventName = Value Text
eventName,
actions :: Maybe [ActionProperty]
actions = Maybe [ActionProperty]
forall a. Maybe a
Prelude.Nothing, condition :: Maybe (Value Text)
condition = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties EventProperty where
toResourceProperties :: EventProperty -> ResourceProperties
toResourceProperties EventProperty {Maybe [ActionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: EventProperty -> ()
actions :: EventProperty -> Maybe [ActionProperty]
condition :: EventProperty -> Maybe (Value Text)
eventName :: EventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Maybe (Value Text)
eventName :: Value Text
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::IoTEvents::DetectorModel.Event",
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
"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]
([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,
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..=) Key
"Condition" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
condition]))}
instance JSON.ToJSON EventProperty where
toJSON :: EventProperty -> Value
toJSON EventProperty {Maybe [ActionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: EventProperty -> ()
actions :: EventProperty -> Maybe [ActionProperty]
condition :: EventProperty -> Maybe (Value Text)
eventName :: EventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Maybe (Value Text)
eventName :: 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
"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]
([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,
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..=) Key
"Condition" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
condition])))
instance Property "Actions" EventProperty where
type PropertyType "Actions" EventProperty = [ActionProperty]
set :: PropertyType "Actions" EventProperty
-> EventProperty -> EventProperty
set PropertyType "Actions" EventProperty
newValue EventProperty {Maybe [ActionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: EventProperty -> ()
actions :: EventProperty -> Maybe [ActionProperty]
condition :: EventProperty -> Maybe (Value Text)
eventName :: EventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Maybe (Value Text)
eventName :: Value Text
..}
= EventProperty {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" EventProperty
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
condition :: Maybe (Value Text)
eventName :: Value Text
haddock_workaround_ :: ()
condition :: Maybe (Value Text)
eventName :: Value Text
..}
instance Property "Condition" EventProperty where
type PropertyType "Condition" EventProperty = Value Prelude.Text
set :: PropertyType "Condition" EventProperty
-> EventProperty -> EventProperty
set PropertyType "Condition" EventProperty
newValue EventProperty {Maybe [ActionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: EventProperty -> ()
actions :: EventProperty -> Maybe [ActionProperty]
condition :: EventProperty -> Maybe (Value Text)
eventName :: EventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Maybe (Value Text)
eventName :: Value Text
..}
= EventProperty {condition :: Maybe (Value Text)
condition = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Condition" EventProperty
Value Text
newValue, Maybe [ActionProperty]
()
Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
eventName :: Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
eventName :: Value Text
..}
instance Property "EventName" EventProperty where
type PropertyType "EventName" EventProperty = Value Prelude.Text
set :: PropertyType "EventName" EventProperty
-> EventProperty -> EventProperty
set PropertyType "EventName" EventProperty
newValue EventProperty {Maybe [ActionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: EventProperty -> ()
actions :: EventProperty -> Maybe [ActionProperty]
condition :: EventProperty -> Maybe (Value Text)
eventName :: EventProperty -> Value Text
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Maybe (Value Text)
eventName :: Value Text
..}
= EventProperty {eventName :: Value Text
eventName = PropertyType "EventName" EventProperty
Value Text
newValue, Maybe [ActionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Maybe (Value Text)
haddock_workaround_ :: ()
actions :: Maybe [ActionProperty]
condition :: Maybe (Value Text)
..}