{-# 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.CloudFormation.Types.LoggingConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LoggingConfig = LoggingConfig'
{
LoggingConfig -> Text
logRoleArn :: Prelude.Text,
LoggingConfig -> Text
logGroupName :: Prelude.Text
}
deriving (LoggingConfig -> LoggingConfig -> Bool
(LoggingConfig -> LoggingConfig -> Bool)
-> (LoggingConfig -> LoggingConfig -> Bool) -> Eq LoggingConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoggingConfig -> LoggingConfig -> Bool
$c/= :: LoggingConfig -> LoggingConfig -> Bool
== :: LoggingConfig -> LoggingConfig -> Bool
$c== :: LoggingConfig -> LoggingConfig -> Bool
Prelude.Eq, ReadPrec [LoggingConfig]
ReadPrec LoggingConfig
Int -> ReadS LoggingConfig
ReadS [LoggingConfig]
(Int -> ReadS LoggingConfig)
-> ReadS [LoggingConfig]
-> ReadPrec LoggingConfig
-> ReadPrec [LoggingConfig]
-> Read LoggingConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoggingConfig]
$creadListPrec :: ReadPrec [LoggingConfig]
readPrec :: ReadPrec LoggingConfig
$creadPrec :: ReadPrec LoggingConfig
readList :: ReadS [LoggingConfig]
$creadList :: ReadS [LoggingConfig]
readsPrec :: Int -> ReadS LoggingConfig
$creadsPrec :: Int -> ReadS LoggingConfig
Prelude.Read, Int -> LoggingConfig -> ShowS
[LoggingConfig] -> ShowS
LoggingConfig -> String
(Int -> LoggingConfig -> ShowS)
-> (LoggingConfig -> String)
-> ([LoggingConfig] -> ShowS)
-> Show LoggingConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoggingConfig] -> ShowS
$cshowList :: [LoggingConfig] -> ShowS
show :: LoggingConfig -> String
$cshow :: LoggingConfig -> String
showsPrec :: Int -> LoggingConfig -> ShowS
$cshowsPrec :: Int -> LoggingConfig -> ShowS
Prelude.Show, (forall x. LoggingConfig -> Rep LoggingConfig x)
-> (forall x. Rep LoggingConfig x -> LoggingConfig)
-> Generic LoggingConfig
forall x. Rep LoggingConfig x -> LoggingConfig
forall x. LoggingConfig -> Rep LoggingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoggingConfig x -> LoggingConfig
$cfrom :: forall x. LoggingConfig -> Rep LoggingConfig x
Prelude.Generic)
newLoggingConfig ::
Prelude.Text ->
Prelude.Text ->
LoggingConfig
newLoggingConfig :: Text -> Text -> LoggingConfig
newLoggingConfig Text
pLogRoleArn_ Text
pLogGroupName_ =
LoggingConfig' :: Text -> Text -> LoggingConfig
LoggingConfig'
{ $sel:logRoleArn:LoggingConfig' :: Text
logRoleArn = Text
pLogRoleArn_,
$sel:logGroupName:LoggingConfig' :: Text
logGroupName = Text
pLogGroupName_
}
loggingConfig_logRoleArn :: Lens.Lens' LoggingConfig Prelude.Text
loggingConfig_logRoleArn :: (Text -> f Text) -> LoggingConfig -> f LoggingConfig
loggingConfig_logRoleArn = (LoggingConfig -> Text)
-> (LoggingConfig -> Text -> LoggingConfig)
-> Lens LoggingConfig LoggingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfig' {Text
logRoleArn :: Text
$sel:logRoleArn:LoggingConfig' :: LoggingConfig -> Text
logRoleArn} -> Text
logRoleArn) (\s :: LoggingConfig
s@LoggingConfig' {} Text
a -> LoggingConfig
s {$sel:logRoleArn:LoggingConfig' :: Text
logRoleArn = Text
a} :: LoggingConfig)
loggingConfig_logGroupName :: Lens.Lens' LoggingConfig Prelude.Text
loggingConfig_logGroupName :: (Text -> f Text) -> LoggingConfig -> f LoggingConfig
loggingConfig_logGroupName = (LoggingConfig -> Text)
-> (LoggingConfig -> Text -> LoggingConfig)
-> Lens LoggingConfig LoggingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfig' {Text
logGroupName :: Text
$sel:logGroupName:LoggingConfig' :: LoggingConfig -> Text
logGroupName} -> Text
logGroupName) (\s :: LoggingConfig
s@LoggingConfig' {} Text
a -> LoggingConfig
s {$sel:logGroupName:LoggingConfig' :: Text
logGroupName = Text
a} :: LoggingConfig)
instance Core.FromXML LoggingConfig where
parseXML :: [Node] -> Either String LoggingConfig
parseXML [Node]
x =
Text -> Text -> LoggingConfig
LoggingConfig'
(Text -> Text -> LoggingConfig)
-> Either String Text -> Either String (Text -> LoggingConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"LogRoleArn")
Either String (Text -> LoggingConfig)
-> Either String Text -> Either String LoggingConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"LogGroupName")
instance Prelude.Hashable LoggingConfig
instance Prelude.NFData LoggingConfig
instance Core.ToQuery LoggingConfig where
toQuery :: LoggingConfig -> QueryString
toQuery LoggingConfig' {Text
logGroupName :: Text
logRoleArn :: Text
$sel:logGroupName:LoggingConfig' :: LoggingConfig -> Text
$sel:logRoleArn:LoggingConfig' :: LoggingConfig -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"LogRoleArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
logRoleArn,
ByteString
"LogGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
logGroupName
]