{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data LoggingConfig = LoggingConfig'
{
LoggingConfig -> Text
logRoleArn :: Prelude.Text,
LoggingConfig -> Text
logGroupName :: Prelude.Text
}
deriving (LoggingConfig -> LoggingConfig -> Bool
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]
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
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. 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'
{ $sel:logRoleArn:LoggingConfig' :: Text
logRoleArn = Text
pLogRoleArn_,
$sel:logGroupName:LoggingConfig' :: Text
logGroupName = Text
pLogGroupName_
}
loggingConfig_logRoleArn :: Lens.Lens' LoggingConfig Prelude.Text
loggingConfig_logRoleArn :: Lens' LoggingConfig Text
loggingConfig_logRoleArn = 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 :: Lens' LoggingConfig Text
loggingConfig_logGroupName = 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 Data.FromXML LoggingConfig where
parseXML :: [Node] -> Either String LoggingConfig
parseXML [Node]
x =
Text -> Text -> LoggingConfig
LoggingConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"LogRoleArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"LogGroupName")
instance Prelude.Hashable LoggingConfig where
hashWithSalt :: Int -> LoggingConfig -> Int
hashWithSalt Int
_salt LoggingConfig' {Text
logGroupName :: Text
logRoleArn :: Text
$sel:logGroupName:LoggingConfig' :: LoggingConfig -> Text
$sel:logRoleArn:LoggingConfig' :: LoggingConfig -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
logRoleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
logGroupName
instance Prelude.NFData LoggingConfig where
rnf :: LoggingConfig -> ()
rnf LoggingConfig' {Text
logGroupName :: Text
logRoleArn :: Text
$sel:logGroupName:LoggingConfig' :: LoggingConfig -> Text
$sel:logRoleArn:LoggingConfig' :: LoggingConfig -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
logRoleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
logGroupName
instance Data.ToQuery LoggingConfig where
toQuery :: LoggingConfig -> QueryString
toQuery LoggingConfig' {Text
logGroupName :: Text
logRoleArn :: Text
$sel:logGroupName:LoggingConfig' :: LoggingConfig -> Text
$sel:logRoleArn:LoggingConfig' :: LoggingConfig -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"LogRoleArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
logRoleArn,
ByteString
"LogGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
logGroupName
]