{-# 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.GetQueryLoggingConfig
(
GetQueryLoggingConfig (..),
newGetQueryLoggingConfig,
getQueryLoggingConfig_id,
GetQueryLoggingConfigResponse (..),
newGetQueryLoggingConfigResponse,
getQueryLoggingConfigResponse_httpStatus,
getQueryLoggingConfigResponse_queryLoggingConfig,
)
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 GetQueryLoggingConfig = GetQueryLoggingConfig'
{
GetQueryLoggingConfig -> Text
id :: Prelude.Text
}
deriving (GetQueryLoggingConfig -> GetQueryLoggingConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetQueryLoggingConfig -> GetQueryLoggingConfig -> Bool
$c/= :: GetQueryLoggingConfig -> GetQueryLoggingConfig -> Bool
== :: GetQueryLoggingConfig -> GetQueryLoggingConfig -> Bool
$c== :: GetQueryLoggingConfig -> GetQueryLoggingConfig -> Bool
Prelude.Eq, ReadPrec [GetQueryLoggingConfig]
ReadPrec GetQueryLoggingConfig
Int -> ReadS GetQueryLoggingConfig
ReadS [GetQueryLoggingConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetQueryLoggingConfig]
$creadListPrec :: ReadPrec [GetQueryLoggingConfig]
readPrec :: ReadPrec GetQueryLoggingConfig
$creadPrec :: ReadPrec GetQueryLoggingConfig
readList :: ReadS [GetQueryLoggingConfig]
$creadList :: ReadS [GetQueryLoggingConfig]
readsPrec :: Int -> ReadS GetQueryLoggingConfig
$creadsPrec :: Int -> ReadS GetQueryLoggingConfig
Prelude.Read, Int -> GetQueryLoggingConfig -> ShowS
[GetQueryLoggingConfig] -> ShowS
GetQueryLoggingConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetQueryLoggingConfig] -> ShowS
$cshowList :: [GetQueryLoggingConfig] -> ShowS
show :: GetQueryLoggingConfig -> String
$cshow :: GetQueryLoggingConfig -> String
showsPrec :: Int -> GetQueryLoggingConfig -> ShowS
$cshowsPrec :: Int -> GetQueryLoggingConfig -> ShowS
Prelude.Show, forall x. Rep GetQueryLoggingConfig x -> GetQueryLoggingConfig
forall x. GetQueryLoggingConfig -> Rep GetQueryLoggingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetQueryLoggingConfig x -> GetQueryLoggingConfig
$cfrom :: forall x. GetQueryLoggingConfig -> Rep GetQueryLoggingConfig x
Prelude.Generic)
newGetQueryLoggingConfig ::
Prelude.Text ->
GetQueryLoggingConfig
newGetQueryLoggingConfig :: Text -> GetQueryLoggingConfig
newGetQueryLoggingConfig Text
pId_ =
GetQueryLoggingConfig' {$sel:id:GetQueryLoggingConfig' :: Text
id = Text
pId_}
getQueryLoggingConfig_id :: Lens.Lens' GetQueryLoggingConfig Prelude.Text
getQueryLoggingConfig_id :: Lens' GetQueryLoggingConfig Text
getQueryLoggingConfig_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueryLoggingConfig' {Text
id :: Text
$sel:id:GetQueryLoggingConfig' :: GetQueryLoggingConfig -> Text
id} -> Text
id) (\s :: GetQueryLoggingConfig
s@GetQueryLoggingConfig' {} Text
a -> GetQueryLoggingConfig
s {$sel:id:GetQueryLoggingConfig' :: Text
id = Text
a} :: GetQueryLoggingConfig)
instance Core.AWSRequest GetQueryLoggingConfig where
type
AWSResponse GetQueryLoggingConfig =
GetQueryLoggingConfigResponse
request :: (Service -> Service)
-> GetQueryLoggingConfig -> Request GetQueryLoggingConfig
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetQueryLoggingConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetQueryLoggingConfig)))
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 -> GetQueryLoggingConfigResponse
GetQueryLoggingConfigResponse'
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")
)
instance Prelude.Hashable GetQueryLoggingConfig where
hashWithSalt :: Int -> GetQueryLoggingConfig -> Int
hashWithSalt Int
_salt GetQueryLoggingConfig' {Text
id :: Text
$sel:id:GetQueryLoggingConfig' :: GetQueryLoggingConfig -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData GetQueryLoggingConfig where
rnf :: GetQueryLoggingConfig -> ()
rnf GetQueryLoggingConfig' {Text
id :: Text
$sel:id:GetQueryLoggingConfig' :: GetQueryLoggingConfig -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders GetQueryLoggingConfig where
toHeaders :: GetQueryLoggingConfig -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetQueryLoggingConfig where
toPath :: GetQueryLoggingConfig -> ByteString
toPath GetQueryLoggingConfig' {Text
id :: Text
$sel:id:GetQueryLoggingConfig' :: GetQueryLoggingConfig -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2013-04-01/queryloggingconfig/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]
instance Data.ToQuery GetQueryLoggingConfig where
toQuery :: GetQueryLoggingConfig -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetQueryLoggingConfigResponse = GetQueryLoggingConfigResponse'
{
GetQueryLoggingConfigResponse -> Int
httpStatus :: Prelude.Int,
GetQueryLoggingConfigResponse -> QueryLoggingConfig
queryLoggingConfig :: QueryLoggingConfig
}
deriving (GetQueryLoggingConfigResponse
-> GetQueryLoggingConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetQueryLoggingConfigResponse
-> GetQueryLoggingConfigResponse -> Bool
$c/= :: GetQueryLoggingConfigResponse
-> GetQueryLoggingConfigResponse -> Bool
== :: GetQueryLoggingConfigResponse
-> GetQueryLoggingConfigResponse -> Bool
$c== :: GetQueryLoggingConfigResponse
-> GetQueryLoggingConfigResponse -> Bool
Prelude.Eq, ReadPrec [GetQueryLoggingConfigResponse]
ReadPrec GetQueryLoggingConfigResponse
Int -> ReadS GetQueryLoggingConfigResponse
ReadS [GetQueryLoggingConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetQueryLoggingConfigResponse]
$creadListPrec :: ReadPrec [GetQueryLoggingConfigResponse]
readPrec :: ReadPrec GetQueryLoggingConfigResponse
$creadPrec :: ReadPrec GetQueryLoggingConfigResponse
readList :: ReadS [GetQueryLoggingConfigResponse]
$creadList :: ReadS [GetQueryLoggingConfigResponse]
readsPrec :: Int -> ReadS GetQueryLoggingConfigResponse
$creadsPrec :: Int -> ReadS GetQueryLoggingConfigResponse
Prelude.Read, Int -> GetQueryLoggingConfigResponse -> ShowS
[GetQueryLoggingConfigResponse] -> ShowS
GetQueryLoggingConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetQueryLoggingConfigResponse] -> ShowS
$cshowList :: [GetQueryLoggingConfigResponse] -> ShowS
show :: GetQueryLoggingConfigResponse -> String
$cshow :: GetQueryLoggingConfigResponse -> String
showsPrec :: Int -> GetQueryLoggingConfigResponse -> ShowS
$cshowsPrec :: Int -> GetQueryLoggingConfigResponse -> ShowS
Prelude.Show, forall x.
Rep GetQueryLoggingConfigResponse x
-> GetQueryLoggingConfigResponse
forall x.
GetQueryLoggingConfigResponse
-> Rep GetQueryLoggingConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetQueryLoggingConfigResponse x
-> GetQueryLoggingConfigResponse
$cfrom :: forall x.
GetQueryLoggingConfigResponse
-> Rep GetQueryLoggingConfigResponse x
Prelude.Generic)
newGetQueryLoggingConfigResponse ::
Prelude.Int ->
QueryLoggingConfig ->
GetQueryLoggingConfigResponse
newGetQueryLoggingConfigResponse :: Int -> QueryLoggingConfig -> GetQueryLoggingConfigResponse
newGetQueryLoggingConfigResponse
Int
pHttpStatus_
QueryLoggingConfig
pQueryLoggingConfig_ =
GetQueryLoggingConfigResponse'
{ $sel:httpStatus:GetQueryLoggingConfigResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:queryLoggingConfig:GetQueryLoggingConfigResponse' :: QueryLoggingConfig
queryLoggingConfig = QueryLoggingConfig
pQueryLoggingConfig_
}
getQueryLoggingConfigResponse_httpStatus :: Lens.Lens' GetQueryLoggingConfigResponse Prelude.Int
getQueryLoggingConfigResponse_httpStatus :: Lens' GetQueryLoggingConfigResponse Int
getQueryLoggingConfigResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueryLoggingConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetQueryLoggingConfigResponse' :: GetQueryLoggingConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetQueryLoggingConfigResponse
s@GetQueryLoggingConfigResponse' {} Int
a -> GetQueryLoggingConfigResponse
s {$sel:httpStatus:GetQueryLoggingConfigResponse' :: Int
httpStatus = Int
a} :: GetQueryLoggingConfigResponse)
getQueryLoggingConfigResponse_queryLoggingConfig :: Lens.Lens' GetQueryLoggingConfigResponse QueryLoggingConfig
getQueryLoggingConfigResponse_queryLoggingConfig :: Lens' GetQueryLoggingConfigResponse QueryLoggingConfig
getQueryLoggingConfigResponse_queryLoggingConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetQueryLoggingConfigResponse' {QueryLoggingConfig
queryLoggingConfig :: QueryLoggingConfig
$sel:queryLoggingConfig:GetQueryLoggingConfigResponse' :: GetQueryLoggingConfigResponse -> QueryLoggingConfig
queryLoggingConfig} -> QueryLoggingConfig
queryLoggingConfig) (\s :: GetQueryLoggingConfigResponse
s@GetQueryLoggingConfigResponse' {} QueryLoggingConfig
a -> GetQueryLoggingConfigResponse
s {$sel:queryLoggingConfig:GetQueryLoggingConfigResponse' :: QueryLoggingConfig
queryLoggingConfig = QueryLoggingConfig
a} :: GetQueryLoggingConfigResponse)
instance Prelude.NFData GetQueryLoggingConfigResponse where
rnf :: GetQueryLoggingConfigResponse -> ()
rnf GetQueryLoggingConfigResponse' {Int
QueryLoggingConfig
queryLoggingConfig :: QueryLoggingConfig
httpStatus :: Int
$sel:queryLoggingConfig:GetQueryLoggingConfigResponse' :: GetQueryLoggingConfigResponse -> QueryLoggingConfig
$sel:httpStatus:GetQueryLoggingConfigResponse' :: GetQueryLoggingConfigResponse -> 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