{-# 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.AppSync.Types.LogConfig where
import Amazonka.AppSync.Types.FieldLogLevel
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data LogConfig = LogConfig'
{
LogConfig -> Maybe Bool
excludeVerboseContent :: Prelude.Maybe Prelude.Bool,
LogConfig -> FieldLogLevel
fieldLogLevel :: FieldLogLevel,
LogConfig -> Text
cloudWatchLogsRoleArn :: Prelude.Text
}
deriving (LogConfig -> LogConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogConfig -> LogConfig -> Bool
$c/= :: LogConfig -> LogConfig -> Bool
== :: LogConfig -> LogConfig -> Bool
$c== :: LogConfig -> LogConfig -> Bool
Prelude.Eq, ReadPrec [LogConfig]
ReadPrec LogConfig
Int -> ReadS LogConfig
ReadS [LogConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogConfig]
$creadListPrec :: ReadPrec [LogConfig]
readPrec :: ReadPrec LogConfig
$creadPrec :: ReadPrec LogConfig
readList :: ReadS [LogConfig]
$creadList :: ReadS [LogConfig]
readsPrec :: Int -> ReadS LogConfig
$creadsPrec :: Int -> ReadS LogConfig
Prelude.Read, Int -> LogConfig -> ShowS
[LogConfig] -> ShowS
LogConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogConfig] -> ShowS
$cshowList :: [LogConfig] -> ShowS
show :: LogConfig -> String
$cshow :: LogConfig -> String
showsPrec :: Int -> LogConfig -> ShowS
$cshowsPrec :: Int -> LogConfig -> ShowS
Prelude.Show, forall x. Rep LogConfig x -> LogConfig
forall x. LogConfig -> Rep LogConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogConfig x -> LogConfig
$cfrom :: forall x. LogConfig -> Rep LogConfig x
Prelude.Generic)
newLogConfig ::
FieldLogLevel ->
Prelude.Text ->
LogConfig
newLogConfig :: FieldLogLevel -> Text -> LogConfig
newLogConfig FieldLogLevel
pFieldLogLevel_ Text
pCloudWatchLogsRoleArn_ =
LogConfig'
{ $sel:excludeVerboseContent:LogConfig' :: Maybe Bool
excludeVerboseContent = forall a. Maybe a
Prelude.Nothing,
$sel:fieldLogLevel:LogConfig' :: FieldLogLevel
fieldLogLevel = FieldLogLevel
pFieldLogLevel_,
$sel:cloudWatchLogsRoleArn:LogConfig' :: Text
cloudWatchLogsRoleArn = Text
pCloudWatchLogsRoleArn_
}
logConfig_excludeVerboseContent :: Lens.Lens' LogConfig (Prelude.Maybe Prelude.Bool)
logConfig_excludeVerboseContent :: Lens' LogConfig (Maybe Bool)
logConfig_excludeVerboseContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogConfig' {Maybe Bool
excludeVerboseContent :: Maybe Bool
$sel:excludeVerboseContent:LogConfig' :: LogConfig -> Maybe Bool
excludeVerboseContent} -> Maybe Bool
excludeVerboseContent) (\s :: LogConfig
s@LogConfig' {} Maybe Bool
a -> LogConfig
s {$sel:excludeVerboseContent:LogConfig' :: Maybe Bool
excludeVerboseContent = Maybe Bool
a} :: LogConfig)
logConfig_fieldLogLevel :: Lens.Lens' LogConfig FieldLogLevel
logConfig_fieldLogLevel :: Lens' LogConfig FieldLogLevel
logConfig_fieldLogLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogConfig' {FieldLogLevel
fieldLogLevel :: FieldLogLevel
$sel:fieldLogLevel:LogConfig' :: LogConfig -> FieldLogLevel
fieldLogLevel} -> FieldLogLevel
fieldLogLevel) (\s :: LogConfig
s@LogConfig' {} FieldLogLevel
a -> LogConfig
s {$sel:fieldLogLevel:LogConfig' :: FieldLogLevel
fieldLogLevel = FieldLogLevel
a} :: LogConfig)
logConfig_cloudWatchLogsRoleArn :: Lens.Lens' LogConfig Prelude.Text
logConfig_cloudWatchLogsRoleArn :: Lens' LogConfig Text
logConfig_cloudWatchLogsRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogConfig' {Text
cloudWatchLogsRoleArn :: Text
$sel:cloudWatchLogsRoleArn:LogConfig' :: LogConfig -> Text
cloudWatchLogsRoleArn} -> Text
cloudWatchLogsRoleArn) (\s :: LogConfig
s@LogConfig' {} Text
a -> LogConfig
s {$sel:cloudWatchLogsRoleArn:LogConfig' :: Text
cloudWatchLogsRoleArn = Text
a} :: LogConfig)
instance Data.FromJSON LogConfig where
parseJSON :: Value -> Parser LogConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LogConfig"
( \Object
x ->
Maybe Bool -> FieldLogLevel -> Text -> LogConfig
LogConfig'
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
"excludeVerboseContent")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"fieldLogLevel")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"cloudWatchLogsRoleArn")
)
instance Prelude.Hashable LogConfig where
hashWithSalt :: Int -> LogConfig -> Int
hashWithSalt Int
_salt LogConfig' {Maybe Bool
Text
FieldLogLevel
cloudWatchLogsRoleArn :: Text
fieldLogLevel :: FieldLogLevel
excludeVerboseContent :: Maybe Bool
$sel:cloudWatchLogsRoleArn:LogConfig' :: LogConfig -> Text
$sel:fieldLogLevel:LogConfig' :: LogConfig -> FieldLogLevel
$sel:excludeVerboseContent:LogConfig' :: LogConfig -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
excludeVerboseContent
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FieldLogLevel
fieldLogLevel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cloudWatchLogsRoleArn
instance Prelude.NFData LogConfig where
rnf :: LogConfig -> ()
rnf LogConfig' {Maybe Bool
Text
FieldLogLevel
cloudWatchLogsRoleArn :: Text
fieldLogLevel :: FieldLogLevel
excludeVerboseContent :: Maybe Bool
$sel:cloudWatchLogsRoleArn:LogConfig' :: LogConfig -> Text
$sel:fieldLogLevel:LogConfig' :: LogConfig -> FieldLogLevel
$sel:excludeVerboseContent:LogConfig' :: LogConfig -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
excludeVerboseContent
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FieldLogLevel
fieldLogLevel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cloudWatchLogsRoleArn
instance Data.ToJSON LogConfig where
toJSON :: LogConfig -> Value
toJSON LogConfig' {Maybe Bool
Text
FieldLogLevel
cloudWatchLogsRoleArn :: Text
fieldLogLevel :: FieldLogLevel
excludeVerboseContent :: Maybe Bool
$sel:cloudWatchLogsRoleArn:LogConfig' :: LogConfig -> Text
$sel:fieldLogLevel:LogConfig' :: LogConfig -> FieldLogLevel
$sel:excludeVerboseContent:LogConfig' :: LogConfig -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"excludeVerboseContent" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
excludeVerboseContent,
forall a. a -> Maybe a
Prelude.Just (Key
"fieldLogLevel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= FieldLogLevel
fieldLogLevel),
forall a. a -> Maybe a
Prelude.Just
( Key
"cloudWatchLogsRoleArn"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
cloudWatchLogsRoleArn
)
]
)