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