{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTEventsData.Types.TriggerType
import qualified Amazonka.Prelude as Prelude
data StateChangeConfiguration = StateChangeConfiguration'
{
StateChangeConfiguration -> Maybe TriggerType
triggerType :: Prelude.Maybe TriggerType
}
deriving (StateChangeConfiguration -> StateChangeConfiguration -> Bool
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]
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
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.
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'
{ $sel:triggerType:StateChangeConfiguration' :: Maybe TriggerType
triggerType =
forall a. Maybe a
Prelude.Nothing
}
stateChangeConfiguration_triggerType :: Lens.Lens' StateChangeConfiguration (Prelude.Maybe TriggerType)
stateChangeConfiguration_triggerType :: Lens' StateChangeConfiguration (Maybe TriggerType)
stateChangeConfiguration_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 Data.FromJSON StateChangeConfiguration where
parseJSON :: Value -> Parser StateChangeConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StateChangeConfiguration"
( \Object
x ->
Maybe TriggerType -> StateChangeConfiguration
StateChangeConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"triggerType")
)
instance Prelude.Hashable StateChangeConfiguration where
hashWithSalt :: Int -> StateChangeConfiguration -> Int
hashWithSalt Int
_salt StateChangeConfiguration' {Maybe TriggerType
triggerType :: Maybe TriggerType
$sel:triggerType:StateChangeConfiguration' :: StateChangeConfiguration -> Maybe TriggerType
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TriggerType
triggerType
instance Prelude.NFData StateChangeConfiguration where
rnf :: StateChangeConfiguration -> ()
rnf StateChangeConfiguration' {Maybe TriggerType
triggerType :: Maybe TriggerType
$sel:triggerType:StateChangeConfiguration' :: StateChangeConfiguration -> Maybe TriggerType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TriggerType
triggerType