{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Route53.CreateQueryLoggingConfig
(
CreateQueryLoggingConfig (..),
newCreateQueryLoggingConfig,
createQueryLoggingConfig_hostedZoneId,
createQueryLoggingConfig_cloudWatchLogsLogGroupArn,
CreateQueryLoggingConfigResponse (..),
newCreateQueryLoggingConfigResponse,
createQueryLoggingConfigResponse_httpStatus,
createQueryLoggingConfigResponse_queryLoggingConfig,
createQueryLoggingConfigResponse_location,
)
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53.Types
data CreateQueryLoggingConfig = CreateQueryLoggingConfig'
{
CreateQueryLoggingConfig -> ResourceId
hostedZoneId :: ResourceId,
CreateQueryLoggingConfig -> Text
cloudWatchLogsLogGroupArn :: Prelude.Text
}
deriving (CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
$c/= :: CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
== :: CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
$c== :: CreateQueryLoggingConfig -> CreateQueryLoggingConfig -> Bool
Prelude.Eq, ReadPrec [CreateQueryLoggingConfig]
ReadPrec CreateQueryLoggingConfig
Int -> ReadS CreateQueryLoggingConfig
ReadS [CreateQueryLoggingConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQueryLoggingConfig]
$creadListPrec :: ReadPrec [CreateQueryLoggingConfig]
readPrec :: ReadPrec CreateQueryLoggingConfig
$creadPrec :: ReadPrec CreateQueryLoggingConfig
readList :: ReadS [CreateQueryLoggingConfig]
$creadList :: ReadS [CreateQueryLoggingConfig]
readsPrec :: Int -> ReadS CreateQueryLoggingConfig
$creadsPrec :: Int -> ReadS CreateQueryLoggingConfig
Prelude.Read, Int -> CreateQueryLoggingConfig -> ShowS
[CreateQueryLoggingConfig] -> ShowS
CreateQueryLoggingConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQueryLoggingConfig] -> ShowS
$cshowList :: [CreateQueryLoggingConfig] -> ShowS
show :: CreateQueryLoggingConfig -> String
$cshow :: CreateQueryLoggingConfig -> String
showsPrec :: Int -> CreateQueryLoggingConfig -> ShowS
$cshowsPrec :: Int -> CreateQueryLoggingConfig -> ShowS
Prelude.Show, forall x.
Rep CreateQueryLoggingConfig x -> CreateQueryLoggingConfig
forall x.
CreateQueryLoggingConfig -> Rep CreateQueryLoggingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateQueryLoggingConfig x -> CreateQueryLoggingConfig
$cfrom :: forall x.
CreateQueryLoggingConfig -> Rep CreateQueryLoggingConfig x
Prelude.Generic)
newCreateQueryLoggingConfig ::
ResourceId ->
Prelude.Text ->
CreateQueryLoggingConfig
newCreateQueryLoggingConfig :: ResourceId -> Text -> CreateQueryLoggingConfig
newCreateQueryLoggingConfig
ResourceId
pHostedZoneId_
Text
pCloudWatchLogsLogGroupArn_ =
CreateQueryLoggingConfig'
{ $sel:hostedZoneId:CreateQueryLoggingConfig' :: ResourceId
hostedZoneId =
ResourceId
pHostedZoneId_,
$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: Text
cloudWatchLogsLogGroupArn =
Text
pCloudWatchLogsLogGroupArn_
}
createQueryLoggingConfig_hostedZoneId :: Lens.Lens' CreateQueryLoggingConfig ResourceId
createQueryLoggingConfig_hostedZoneId :: Lens' CreateQueryLoggingConfig ResourceId
createQueryLoggingConfig_hostedZoneId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfig' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: CreateQueryLoggingConfig
s@CreateQueryLoggingConfig' {} ResourceId
a -> CreateQueryLoggingConfig
s {$sel:hostedZoneId:CreateQueryLoggingConfig' :: ResourceId
hostedZoneId = ResourceId
a} :: CreateQueryLoggingConfig)
createQueryLoggingConfig_cloudWatchLogsLogGroupArn :: Lens.Lens' CreateQueryLoggingConfig Prelude.Text
createQueryLoggingConfig_cloudWatchLogsLogGroupArn :: Lens' CreateQueryLoggingConfig Text
createQueryLoggingConfig_cloudWatchLogsLogGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfig' {Text
cloudWatchLogsLogGroupArn :: Text
$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> Text
cloudWatchLogsLogGroupArn} -> Text
cloudWatchLogsLogGroupArn) (\s :: CreateQueryLoggingConfig
s@CreateQueryLoggingConfig' {} Text
a -> CreateQueryLoggingConfig
s {$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: Text
cloudWatchLogsLogGroupArn = Text
a} :: CreateQueryLoggingConfig)
instance Core.AWSRequest CreateQueryLoggingConfig where
type
AWSResponse CreateQueryLoggingConfig =
CreateQueryLoggingConfigResponse
request :: (Service -> Service)
-> CreateQueryLoggingConfig -> Request CreateQueryLoggingConfig
request Service -> Service
overrides =
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateQueryLoggingConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateQueryLoggingConfig)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Int
-> QueryLoggingConfig -> Text -> CreateQueryLoggingConfigResponse
CreateQueryLoggingConfigResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
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
"QueryLoggingConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String a
Data..# HeaderName
"Location")
)
instance Prelude.Hashable CreateQueryLoggingConfig where
hashWithSalt :: Int -> CreateQueryLoggingConfig -> Int
hashWithSalt Int
_salt CreateQueryLoggingConfig' {Text
ResourceId
cloudWatchLogsLogGroupArn :: Text
hostedZoneId :: ResourceId
$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> Text
$sel:hostedZoneId:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> ResourceId
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceId
hostedZoneId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cloudWatchLogsLogGroupArn
instance Prelude.NFData CreateQueryLoggingConfig where
rnf :: CreateQueryLoggingConfig -> ()
rnf CreateQueryLoggingConfig' {Text
ResourceId
cloudWatchLogsLogGroupArn :: Text
hostedZoneId :: ResourceId
$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> Text
$sel:hostedZoneId:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> ResourceId
..} =
forall a. NFData a => a -> ()
Prelude.rnf ResourceId
hostedZoneId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cloudWatchLogsLogGroupArn
instance Data.ToElement CreateQueryLoggingConfig where
toElement :: CreateQueryLoggingConfig -> Element
toElement =
forall a. ToXML a => Name -> a -> Element
Data.mkElement
Name
"{https://route53.amazonaws.com/doc/2013-04-01/}CreateQueryLoggingConfigRequest"
instance Data.ToHeaders CreateQueryLoggingConfig where
toHeaders :: CreateQueryLoggingConfig -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateQueryLoggingConfig where
toPath :: CreateQueryLoggingConfig -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const ByteString
"/2013-04-01/queryloggingconfig"
instance Data.ToQuery CreateQueryLoggingConfig where
toQuery :: CreateQueryLoggingConfig -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToXML CreateQueryLoggingConfig where
toXML :: CreateQueryLoggingConfig -> XML
toXML CreateQueryLoggingConfig' {Text
ResourceId
cloudWatchLogsLogGroupArn :: Text
hostedZoneId :: ResourceId
$sel:cloudWatchLogsLogGroupArn:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> Text
$sel:hostedZoneId:CreateQueryLoggingConfig' :: CreateQueryLoggingConfig -> ResourceId
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"HostedZoneId" forall a. ToXML a => Name -> a -> XML
Data.@= ResourceId
hostedZoneId,
Name
"CloudWatchLogsLogGroupArn"
forall a. ToXML a => Name -> a -> XML
Data.@= Text
cloudWatchLogsLogGroupArn
]
data CreateQueryLoggingConfigResponse = CreateQueryLoggingConfigResponse'
{
CreateQueryLoggingConfigResponse -> Int
httpStatus :: Prelude.Int,
CreateQueryLoggingConfigResponse -> QueryLoggingConfig
queryLoggingConfig :: QueryLoggingConfig,
CreateQueryLoggingConfigResponse -> Text
location :: Prelude.Text
}
deriving (CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
$c/= :: CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
== :: CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
$c== :: CreateQueryLoggingConfigResponse
-> CreateQueryLoggingConfigResponse -> Bool
Prelude.Eq, ReadPrec [CreateQueryLoggingConfigResponse]
ReadPrec CreateQueryLoggingConfigResponse
Int -> ReadS CreateQueryLoggingConfigResponse
ReadS [CreateQueryLoggingConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQueryLoggingConfigResponse]
$creadListPrec :: ReadPrec [CreateQueryLoggingConfigResponse]
readPrec :: ReadPrec CreateQueryLoggingConfigResponse
$creadPrec :: ReadPrec CreateQueryLoggingConfigResponse
readList :: ReadS [CreateQueryLoggingConfigResponse]
$creadList :: ReadS [CreateQueryLoggingConfigResponse]
readsPrec :: Int -> ReadS CreateQueryLoggingConfigResponse
$creadsPrec :: Int -> ReadS CreateQueryLoggingConfigResponse
Prelude.Read, Int -> CreateQueryLoggingConfigResponse -> ShowS
[CreateQueryLoggingConfigResponse] -> ShowS
CreateQueryLoggingConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQueryLoggingConfigResponse] -> ShowS
$cshowList :: [CreateQueryLoggingConfigResponse] -> ShowS
show :: CreateQueryLoggingConfigResponse -> String
$cshow :: CreateQueryLoggingConfigResponse -> String
showsPrec :: Int -> CreateQueryLoggingConfigResponse -> ShowS
$cshowsPrec :: Int -> CreateQueryLoggingConfigResponse -> ShowS
Prelude.Show, forall x.
Rep CreateQueryLoggingConfigResponse x
-> CreateQueryLoggingConfigResponse
forall x.
CreateQueryLoggingConfigResponse
-> Rep CreateQueryLoggingConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateQueryLoggingConfigResponse x
-> CreateQueryLoggingConfigResponse
$cfrom :: forall x.
CreateQueryLoggingConfigResponse
-> Rep CreateQueryLoggingConfigResponse x
Prelude.Generic)
newCreateQueryLoggingConfigResponse ::
Prelude.Int ->
QueryLoggingConfig ->
Prelude.Text ->
CreateQueryLoggingConfigResponse
newCreateQueryLoggingConfigResponse :: Int
-> QueryLoggingConfig -> Text -> CreateQueryLoggingConfigResponse
newCreateQueryLoggingConfigResponse
Int
pHttpStatus_
QueryLoggingConfig
pQueryLoggingConfig_
Text
pLocation_ =
CreateQueryLoggingConfigResponse'
{ $sel:httpStatus:CreateQueryLoggingConfigResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:queryLoggingConfig:CreateQueryLoggingConfigResponse' :: QueryLoggingConfig
queryLoggingConfig = QueryLoggingConfig
pQueryLoggingConfig_,
$sel:location:CreateQueryLoggingConfigResponse' :: Text
location = Text
pLocation_
}
createQueryLoggingConfigResponse_httpStatus :: Lens.Lens' CreateQueryLoggingConfigResponse Prelude.Int
createQueryLoggingConfigResponse_httpStatus :: Lens' CreateQueryLoggingConfigResponse Int
createQueryLoggingConfigResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateQueryLoggingConfigResponse' :: CreateQueryLoggingConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateQueryLoggingConfigResponse
s@CreateQueryLoggingConfigResponse' {} Int
a -> CreateQueryLoggingConfigResponse
s {$sel:httpStatus:CreateQueryLoggingConfigResponse' :: Int
httpStatus = Int
a} :: CreateQueryLoggingConfigResponse)
createQueryLoggingConfigResponse_queryLoggingConfig :: Lens.Lens' CreateQueryLoggingConfigResponse QueryLoggingConfig
createQueryLoggingConfigResponse_queryLoggingConfig :: Lens' CreateQueryLoggingConfigResponse QueryLoggingConfig
createQueryLoggingConfigResponse_queryLoggingConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfigResponse' {QueryLoggingConfig
queryLoggingConfig :: QueryLoggingConfig
$sel:queryLoggingConfig:CreateQueryLoggingConfigResponse' :: CreateQueryLoggingConfigResponse -> QueryLoggingConfig
queryLoggingConfig} -> QueryLoggingConfig
queryLoggingConfig) (\s :: CreateQueryLoggingConfigResponse
s@CreateQueryLoggingConfigResponse' {} QueryLoggingConfig
a -> CreateQueryLoggingConfigResponse
s {$sel:queryLoggingConfig:CreateQueryLoggingConfigResponse' :: QueryLoggingConfig
queryLoggingConfig = QueryLoggingConfig
a} :: CreateQueryLoggingConfigResponse)
createQueryLoggingConfigResponse_location :: Lens.Lens' CreateQueryLoggingConfigResponse Prelude.Text
createQueryLoggingConfigResponse_location :: Lens' CreateQueryLoggingConfigResponse Text
createQueryLoggingConfigResponse_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueryLoggingConfigResponse' {Text
location :: Text
$sel:location:CreateQueryLoggingConfigResponse' :: CreateQueryLoggingConfigResponse -> Text
location} -> Text
location) (\s :: CreateQueryLoggingConfigResponse
s@CreateQueryLoggingConfigResponse' {} Text
a -> CreateQueryLoggingConfigResponse
s {$sel:location:CreateQueryLoggingConfigResponse' :: Text
location = Text
a} :: CreateQueryLoggingConfigResponse)
instance
Prelude.NFData
CreateQueryLoggingConfigResponse
where
rnf :: CreateQueryLoggingConfigResponse -> ()
rnf CreateQueryLoggingConfigResponse' {Int
Text
QueryLoggingConfig
location :: Text
queryLoggingConfig :: QueryLoggingConfig
httpStatus :: Int
$sel:location:CreateQueryLoggingConfigResponse' :: CreateQueryLoggingConfigResponse -> Text
$sel:queryLoggingConfig:CreateQueryLoggingConfigResponse' :: CreateQueryLoggingConfigResponse -> QueryLoggingConfig
$sel:httpStatus:CreateQueryLoggingConfigResponse' :: CreateQueryLoggingConfigResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf QueryLoggingConfig
queryLoggingConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
location