{-# 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.Route53.Types.QueryLoggingConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
data QueryLoggingConfig = QueryLoggingConfig'
{
QueryLoggingConfig -> Text
id :: Prelude.Text,
QueryLoggingConfig -> ResourceId
hostedZoneId :: ResourceId,
QueryLoggingConfig -> Text
cloudWatchLogsLogGroupArn :: Prelude.Text
}
deriving (QueryLoggingConfig -> QueryLoggingConfig -> Bool
(QueryLoggingConfig -> QueryLoggingConfig -> Bool)
-> (QueryLoggingConfig -> QueryLoggingConfig -> Bool)
-> Eq QueryLoggingConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueryLoggingConfig -> QueryLoggingConfig -> Bool
$c/= :: QueryLoggingConfig -> QueryLoggingConfig -> Bool
== :: QueryLoggingConfig -> QueryLoggingConfig -> Bool
$c== :: QueryLoggingConfig -> QueryLoggingConfig -> Bool
Prelude.Eq, ReadPrec [QueryLoggingConfig]
ReadPrec QueryLoggingConfig
Int -> ReadS QueryLoggingConfig
ReadS [QueryLoggingConfig]
(Int -> ReadS QueryLoggingConfig)
-> ReadS [QueryLoggingConfig]
-> ReadPrec QueryLoggingConfig
-> ReadPrec [QueryLoggingConfig]
-> Read QueryLoggingConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QueryLoggingConfig]
$creadListPrec :: ReadPrec [QueryLoggingConfig]
readPrec :: ReadPrec QueryLoggingConfig
$creadPrec :: ReadPrec QueryLoggingConfig
readList :: ReadS [QueryLoggingConfig]
$creadList :: ReadS [QueryLoggingConfig]
readsPrec :: Int -> ReadS QueryLoggingConfig
$creadsPrec :: Int -> ReadS QueryLoggingConfig
Prelude.Read, Int -> QueryLoggingConfig -> ShowS
[QueryLoggingConfig] -> ShowS
QueryLoggingConfig -> String
(Int -> QueryLoggingConfig -> ShowS)
-> (QueryLoggingConfig -> String)
-> ([QueryLoggingConfig] -> ShowS)
-> Show QueryLoggingConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueryLoggingConfig] -> ShowS
$cshowList :: [QueryLoggingConfig] -> ShowS
show :: QueryLoggingConfig -> String
$cshow :: QueryLoggingConfig -> String
showsPrec :: Int -> QueryLoggingConfig -> ShowS
$cshowsPrec :: Int -> QueryLoggingConfig -> ShowS
Prelude.Show, (forall x. QueryLoggingConfig -> Rep QueryLoggingConfig x)
-> (forall x. Rep QueryLoggingConfig x -> QueryLoggingConfig)
-> Generic QueryLoggingConfig
forall x. Rep QueryLoggingConfig x -> QueryLoggingConfig
forall x. QueryLoggingConfig -> Rep QueryLoggingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QueryLoggingConfig x -> QueryLoggingConfig
$cfrom :: forall x. QueryLoggingConfig -> Rep QueryLoggingConfig x
Prelude.Generic)
newQueryLoggingConfig ::
Prelude.Text ->
ResourceId ->
Prelude.Text ->
QueryLoggingConfig
newQueryLoggingConfig :: Text -> ResourceId -> Text -> QueryLoggingConfig
newQueryLoggingConfig
Text
pId_
ResourceId
pHostedZoneId_
Text
pCloudWatchLogsLogGroupArn_ =
QueryLoggingConfig' :: Text -> ResourceId -> Text -> QueryLoggingConfig
QueryLoggingConfig'
{ $sel:id:QueryLoggingConfig' :: Text
id = Text
pId_,
$sel:hostedZoneId:QueryLoggingConfig' :: ResourceId
hostedZoneId = ResourceId
pHostedZoneId_,
$sel:cloudWatchLogsLogGroupArn:QueryLoggingConfig' :: Text
cloudWatchLogsLogGroupArn =
Text
pCloudWatchLogsLogGroupArn_
}
queryLoggingConfig_id :: Lens.Lens' QueryLoggingConfig Prelude.Text
queryLoggingConfig_id :: (Text -> f Text) -> QueryLoggingConfig -> f QueryLoggingConfig
queryLoggingConfig_id = (QueryLoggingConfig -> Text)
-> (QueryLoggingConfig -> Text -> QueryLoggingConfig)
-> Lens QueryLoggingConfig QueryLoggingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryLoggingConfig' {Text
id :: Text
$sel:id:QueryLoggingConfig' :: QueryLoggingConfig -> Text
id} -> Text
id) (\s :: QueryLoggingConfig
s@QueryLoggingConfig' {} Text
a -> QueryLoggingConfig
s {$sel:id:QueryLoggingConfig' :: Text
id = Text
a} :: QueryLoggingConfig)
queryLoggingConfig_hostedZoneId :: Lens.Lens' QueryLoggingConfig ResourceId
queryLoggingConfig_hostedZoneId :: (ResourceId -> f ResourceId)
-> QueryLoggingConfig -> f QueryLoggingConfig
queryLoggingConfig_hostedZoneId = (QueryLoggingConfig -> ResourceId)
-> (QueryLoggingConfig -> ResourceId -> QueryLoggingConfig)
-> Lens QueryLoggingConfig QueryLoggingConfig ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryLoggingConfig' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:QueryLoggingConfig' :: QueryLoggingConfig -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: QueryLoggingConfig
s@QueryLoggingConfig' {} ResourceId
a -> QueryLoggingConfig
s {$sel:hostedZoneId:QueryLoggingConfig' :: ResourceId
hostedZoneId = ResourceId
a} :: QueryLoggingConfig)
queryLoggingConfig_cloudWatchLogsLogGroupArn :: Lens.Lens' QueryLoggingConfig Prelude.Text
queryLoggingConfig_cloudWatchLogsLogGroupArn :: (Text -> f Text) -> QueryLoggingConfig -> f QueryLoggingConfig
queryLoggingConfig_cloudWatchLogsLogGroupArn = (QueryLoggingConfig -> Text)
-> (QueryLoggingConfig -> Text -> QueryLoggingConfig)
-> Lens QueryLoggingConfig QueryLoggingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryLoggingConfig' {Text
cloudWatchLogsLogGroupArn :: Text
$sel:cloudWatchLogsLogGroupArn:QueryLoggingConfig' :: QueryLoggingConfig -> Text
cloudWatchLogsLogGroupArn} -> Text
cloudWatchLogsLogGroupArn) (\s :: QueryLoggingConfig
s@QueryLoggingConfig' {} Text
a -> QueryLoggingConfig
s {$sel:cloudWatchLogsLogGroupArn:QueryLoggingConfig' :: Text
cloudWatchLogsLogGroupArn = Text
a} :: QueryLoggingConfig)
instance Core.FromXML QueryLoggingConfig where
parseXML :: [Node] -> Either String QueryLoggingConfig
parseXML [Node]
x =
Text -> ResourceId -> Text -> QueryLoggingConfig
QueryLoggingConfig'
(Text -> ResourceId -> Text -> QueryLoggingConfig)
-> Either String Text
-> Either String (ResourceId -> Text -> QueryLoggingConfig)
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
"Id")
Either String (ResourceId -> Text -> QueryLoggingConfig)
-> Either String ResourceId
-> Either String (Text -> QueryLoggingConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ResourceId
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"HostedZoneId")
Either String (Text -> QueryLoggingConfig)
-> Either String Text -> Either String QueryLoggingConfig
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
"CloudWatchLogsLogGroupArn")
instance Prelude.Hashable QueryLoggingConfig
instance Prelude.NFData QueryLoggingConfig