{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IoTEventsData.Types.StateChangeConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.IoTEventsData.Types.TriggerType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StateChangeConfiguration = StateChangeConfiguration'
{
StateChangeConfiguration -> Maybe TriggerType
triggerType :: Prelude.Maybe TriggerType
}
deriving (StateChangeConfiguration -> StateChangeConfiguration -> Bool
(StateChangeConfiguration -> StateChangeConfiguration -> Bool)
-> (StateChangeConfiguration -> StateChangeConfiguration -> Bool)
-> Eq StateChangeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StateChangeConfiguration -> StateChangeConfiguration -> Bool
$c/= :: StateChangeConfiguration -> StateChangeConfiguration -> Bool
== :: StateChangeConfiguration -> StateChangeConfiguration -> Bool
$c== :: StateChangeConfiguration -> StateChangeConfiguration -> Bool
Prelude.Eq, ReadPrec [StateChangeConfiguration]
ReadPrec StateChangeConfiguration
Int -> ReadS StateChangeConfiguration
ReadS [StateChangeConfiguration]
(Int -> ReadS StateChangeConfiguration)
-> ReadS [StateChangeConfiguration]
-> ReadPrec StateChangeConfiguration
-> ReadPrec [StateChangeConfiguration]
-> Read StateChangeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StateChangeConfiguration]
$creadListPrec :: ReadPrec [StateChangeConfiguration]
readPrec :: ReadPrec StateChangeConfiguration
$creadPrec :: ReadPrec StateChangeConfiguration
readList :: ReadS [StateChangeConfiguration]
$creadList :: ReadS [StateChangeConfiguration]
readsPrec :: Int -> ReadS StateChangeConfiguration
$creadsPrec :: Int -> ReadS StateChangeConfiguration
Prelude.Read, Int -> StateChangeConfiguration -> ShowS
[StateChangeConfiguration] -> ShowS
StateChangeConfiguration -> String
(Int -> StateChangeConfiguration -> ShowS)
-> (StateChangeConfiguration -> String)
-> ([StateChangeConfiguration] -> ShowS)
-> Show StateChangeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StateChangeConfiguration] -> ShowS
$cshowList :: [StateChangeConfiguration] -> ShowS
show :: StateChangeConfiguration -> String
$cshow :: StateChangeConfiguration -> String
showsPrec :: Int -> StateChangeConfiguration -> ShowS
$cshowsPrec :: Int -> StateChangeConfiguration -> ShowS
Prelude.Show, (forall x.
StateChangeConfiguration -> Rep StateChangeConfiguration x)
-> (forall x.
Rep StateChangeConfiguration x -> StateChangeConfiguration)
-> Generic StateChangeConfiguration
forall x.
Rep StateChangeConfiguration x -> StateChangeConfiguration
forall x.
StateChangeConfiguration -> Rep StateChangeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StateChangeConfiguration x -> StateChangeConfiguration
$cfrom :: forall x.
StateChangeConfiguration -> Rep StateChangeConfiguration x
Prelude.Generic)
newStateChangeConfiguration ::
StateChangeConfiguration
newStateChangeConfiguration :: StateChangeConfiguration
newStateChangeConfiguration =
StateChangeConfiguration' :: Maybe TriggerType -> StateChangeConfiguration
StateChangeConfiguration'
{ $sel:triggerType:StateChangeConfiguration' :: Maybe TriggerType
triggerType =
Maybe TriggerType
forall a. Maybe a
Prelude.Nothing
}
stateChangeConfiguration_triggerType :: Lens.Lens' StateChangeConfiguration (Prelude.Maybe TriggerType)
stateChangeConfiguration_triggerType :: (Maybe TriggerType -> f (Maybe TriggerType))
-> StateChangeConfiguration -> f StateChangeConfiguration
stateChangeConfiguration_triggerType = (StateChangeConfiguration -> Maybe TriggerType)
-> (StateChangeConfiguration
-> Maybe TriggerType -> StateChangeConfiguration)
-> Lens
StateChangeConfiguration
StateChangeConfiguration
(Maybe TriggerType)
(Maybe TriggerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StateChangeConfiguration' {Maybe TriggerType
triggerType :: Maybe TriggerType
$sel:triggerType:StateChangeConfiguration' :: StateChangeConfiguration -> Maybe TriggerType
triggerType} -> Maybe TriggerType
triggerType) (\s :: StateChangeConfiguration
s@StateChangeConfiguration' {} Maybe TriggerType
a -> StateChangeConfiguration
s {$sel:triggerType:StateChangeConfiguration' :: Maybe TriggerType
triggerType = Maybe TriggerType
a} :: StateChangeConfiguration)
instance Core.FromJSON StateChangeConfiguration where
parseJSON :: Value -> Parser StateChangeConfiguration
parseJSON =
String
-> (Object -> Parser StateChangeConfiguration)
-> Value
-> Parser StateChangeConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StateChangeConfiguration"
( \Object
x ->
Maybe TriggerType -> StateChangeConfiguration
StateChangeConfiguration'
(Maybe TriggerType -> StateChangeConfiguration)
-> Parser (Maybe TriggerType) -> Parser StateChangeConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TriggerType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"triggerType")
)
instance Prelude.Hashable StateChangeConfiguration
instance Prelude.NFData StateChangeConfiguration