{-# 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.Transfer.Types.LoggingConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LoggingConfiguration = LoggingConfiguration'
{
LoggingConfiguration -> Maybe Text
loggingRole :: Prelude.Maybe Prelude.Text,
LoggingConfiguration -> Maybe Text
logGroupName :: Prelude.Maybe Prelude.Text
}
deriving (LoggingConfiguration -> LoggingConfiguration -> Bool
(LoggingConfiguration -> LoggingConfiguration -> Bool)
-> (LoggingConfiguration -> LoggingConfiguration -> Bool)
-> Eq LoggingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoggingConfiguration -> LoggingConfiguration -> Bool
$c/= :: LoggingConfiguration -> LoggingConfiguration -> Bool
== :: LoggingConfiguration -> LoggingConfiguration -> Bool
$c== :: LoggingConfiguration -> LoggingConfiguration -> Bool
Prelude.Eq, ReadPrec [LoggingConfiguration]
ReadPrec LoggingConfiguration
Int -> ReadS LoggingConfiguration
ReadS [LoggingConfiguration]
(Int -> ReadS LoggingConfiguration)
-> ReadS [LoggingConfiguration]
-> ReadPrec LoggingConfiguration
-> ReadPrec [LoggingConfiguration]
-> Read LoggingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoggingConfiguration]
$creadListPrec :: ReadPrec [LoggingConfiguration]
readPrec :: ReadPrec LoggingConfiguration
$creadPrec :: ReadPrec LoggingConfiguration
readList :: ReadS [LoggingConfiguration]
$creadList :: ReadS [LoggingConfiguration]
readsPrec :: Int -> ReadS LoggingConfiguration
$creadsPrec :: Int -> ReadS LoggingConfiguration
Prelude.Read, Int -> LoggingConfiguration -> ShowS
[LoggingConfiguration] -> ShowS
LoggingConfiguration -> String
(Int -> LoggingConfiguration -> ShowS)
-> (LoggingConfiguration -> String)
-> ([LoggingConfiguration] -> ShowS)
-> Show LoggingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoggingConfiguration] -> ShowS
$cshowList :: [LoggingConfiguration] -> ShowS
show :: LoggingConfiguration -> String
$cshow :: LoggingConfiguration -> String
showsPrec :: Int -> LoggingConfiguration -> ShowS
$cshowsPrec :: Int -> LoggingConfiguration -> ShowS
Prelude.Show, (forall x. LoggingConfiguration -> Rep LoggingConfiguration x)
-> (forall x. Rep LoggingConfiguration x -> LoggingConfiguration)
-> Generic LoggingConfiguration
forall x. Rep LoggingConfiguration x -> LoggingConfiguration
forall x. LoggingConfiguration -> Rep LoggingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoggingConfiguration x -> LoggingConfiguration
$cfrom :: forall x. LoggingConfiguration -> Rep LoggingConfiguration x
Prelude.Generic)
newLoggingConfiguration ::
LoggingConfiguration
newLoggingConfiguration :: LoggingConfiguration
newLoggingConfiguration =
LoggingConfiguration' :: Maybe Text -> Maybe Text -> LoggingConfiguration
LoggingConfiguration'
{ $sel:loggingRole:LoggingConfiguration' :: Maybe Text
loggingRole =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logGroupName:LoggingConfiguration' :: Maybe Text
logGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
loggingConfiguration_loggingRole :: Lens.Lens' LoggingConfiguration (Prelude.Maybe Prelude.Text)
loggingConfiguration_loggingRole :: (Maybe Text -> f (Maybe Text))
-> LoggingConfiguration -> f LoggingConfiguration
loggingConfiguration_loggingRole = (LoggingConfiguration -> Maybe Text)
-> (LoggingConfiguration -> Maybe Text -> LoggingConfiguration)
-> Lens
LoggingConfiguration LoggingConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfiguration' {Maybe Text
loggingRole :: Maybe Text
$sel:loggingRole:LoggingConfiguration' :: LoggingConfiguration -> Maybe Text
loggingRole} -> Maybe Text
loggingRole) (\s :: LoggingConfiguration
s@LoggingConfiguration' {} Maybe Text
a -> LoggingConfiguration
s {$sel:loggingRole:LoggingConfiguration' :: Maybe Text
loggingRole = Maybe Text
a} :: LoggingConfiguration)
loggingConfiguration_logGroupName :: Lens.Lens' LoggingConfiguration (Prelude.Maybe Prelude.Text)
loggingConfiguration_logGroupName :: (Maybe Text -> f (Maybe Text))
-> LoggingConfiguration -> f LoggingConfiguration
loggingConfiguration_logGroupName = (LoggingConfiguration -> Maybe Text)
-> (LoggingConfiguration -> Maybe Text -> LoggingConfiguration)
-> Lens
LoggingConfiguration LoggingConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfiguration' {Maybe Text
logGroupName :: Maybe Text
$sel:logGroupName:LoggingConfiguration' :: LoggingConfiguration -> Maybe Text
logGroupName} -> Maybe Text
logGroupName) (\s :: LoggingConfiguration
s@LoggingConfiguration' {} Maybe Text
a -> LoggingConfiguration
s {$sel:logGroupName:LoggingConfiguration' :: Maybe Text
logGroupName = Maybe Text
a} :: LoggingConfiguration)
instance Core.FromJSON LoggingConfiguration where
parseJSON :: Value -> Parser LoggingConfiguration
parseJSON =
String
-> (Object -> Parser LoggingConfiguration)
-> Value
-> Parser LoggingConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LoggingConfiguration"
( \Object
x ->
Maybe Text -> Maybe Text -> LoggingConfiguration
LoggingConfiguration'
(Maybe Text -> Maybe Text -> LoggingConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> LoggingConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LoggingRole")
Parser (Maybe Text -> LoggingConfiguration)
-> Parser (Maybe Text) -> Parser LoggingConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LogGroupName")
)
instance Prelude.Hashable LoggingConfiguration
instance Prelude.NFData LoggingConfiguration