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