{-# 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.IoTEvents.Types.AcknowledgeFlow where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AcknowledgeFlow = AcknowledgeFlow'
{
AcknowledgeFlow -> Bool
enabled :: Prelude.Bool
}
deriving (AcknowledgeFlow -> AcknowledgeFlow -> Bool
(AcknowledgeFlow -> AcknowledgeFlow -> Bool)
-> (AcknowledgeFlow -> AcknowledgeFlow -> Bool)
-> Eq AcknowledgeFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcknowledgeFlow -> AcknowledgeFlow -> Bool
$c/= :: AcknowledgeFlow -> AcknowledgeFlow -> Bool
== :: AcknowledgeFlow -> AcknowledgeFlow -> Bool
$c== :: AcknowledgeFlow -> AcknowledgeFlow -> Bool
Prelude.Eq, ReadPrec [AcknowledgeFlow]
ReadPrec AcknowledgeFlow
Int -> ReadS AcknowledgeFlow
ReadS [AcknowledgeFlow]
(Int -> ReadS AcknowledgeFlow)
-> ReadS [AcknowledgeFlow]
-> ReadPrec AcknowledgeFlow
-> ReadPrec [AcknowledgeFlow]
-> Read AcknowledgeFlow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcknowledgeFlow]
$creadListPrec :: ReadPrec [AcknowledgeFlow]
readPrec :: ReadPrec AcknowledgeFlow
$creadPrec :: ReadPrec AcknowledgeFlow
readList :: ReadS [AcknowledgeFlow]
$creadList :: ReadS [AcknowledgeFlow]
readsPrec :: Int -> ReadS AcknowledgeFlow
$creadsPrec :: Int -> ReadS AcknowledgeFlow
Prelude.Read, Int -> AcknowledgeFlow -> ShowS
[AcknowledgeFlow] -> ShowS
AcknowledgeFlow -> String
(Int -> AcknowledgeFlow -> ShowS)
-> (AcknowledgeFlow -> String)
-> ([AcknowledgeFlow] -> ShowS)
-> Show AcknowledgeFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcknowledgeFlow] -> ShowS
$cshowList :: [AcknowledgeFlow] -> ShowS
show :: AcknowledgeFlow -> String
$cshow :: AcknowledgeFlow -> String
showsPrec :: Int -> AcknowledgeFlow -> ShowS
$cshowsPrec :: Int -> AcknowledgeFlow -> ShowS
Prelude.Show, (forall x. AcknowledgeFlow -> Rep AcknowledgeFlow x)
-> (forall x. Rep AcknowledgeFlow x -> AcknowledgeFlow)
-> Generic AcknowledgeFlow
forall x. Rep AcknowledgeFlow x -> AcknowledgeFlow
forall x. AcknowledgeFlow -> Rep AcknowledgeFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AcknowledgeFlow x -> AcknowledgeFlow
$cfrom :: forall x. AcknowledgeFlow -> Rep AcknowledgeFlow x
Prelude.Generic)
newAcknowledgeFlow ::
Prelude.Bool ->
AcknowledgeFlow
newAcknowledgeFlow :: Bool -> AcknowledgeFlow
newAcknowledgeFlow Bool
pEnabled_ =
AcknowledgeFlow' :: Bool -> AcknowledgeFlow
AcknowledgeFlow' {$sel:enabled:AcknowledgeFlow' :: Bool
enabled = Bool
pEnabled_}
acknowledgeFlow_enabled :: Lens.Lens' AcknowledgeFlow Prelude.Bool
acknowledgeFlow_enabled :: (Bool -> f Bool) -> AcknowledgeFlow -> f AcknowledgeFlow
acknowledgeFlow_enabled = (AcknowledgeFlow -> Bool)
-> (AcknowledgeFlow -> Bool -> AcknowledgeFlow)
-> Lens AcknowledgeFlow AcknowledgeFlow Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcknowledgeFlow' {Bool
enabled :: Bool
$sel:enabled:AcknowledgeFlow' :: AcknowledgeFlow -> Bool
enabled} -> Bool
enabled) (\s :: AcknowledgeFlow
s@AcknowledgeFlow' {} Bool
a -> AcknowledgeFlow
s {$sel:enabled:AcknowledgeFlow' :: Bool
enabled = Bool
a} :: AcknowledgeFlow)
instance Core.FromJSON AcknowledgeFlow where
parseJSON :: Value -> Parser AcknowledgeFlow
parseJSON =
String
-> (Object -> Parser AcknowledgeFlow)
-> Value
-> Parser AcknowledgeFlow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AcknowledgeFlow"
( \Object
x ->
Bool -> AcknowledgeFlow
AcknowledgeFlow' (Bool -> AcknowledgeFlow) -> Parser Bool -> Parser AcknowledgeFlow
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"enabled")
)
instance Prelude.Hashable AcknowledgeFlow
instance Prelude.NFData AcknowledgeFlow
instance Core.ToJSON AcknowledgeFlow where
toJSON :: AcknowledgeFlow -> Value
toJSON AcknowledgeFlow' {Bool
enabled :: Bool
$sel:enabled:AcknowledgeFlow' :: AcknowledgeFlow -> Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
enabled)]
)