{-# 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.Route53Resolver.PutResolverQueryLogConfigPolicy
(
PutResolverQueryLogConfigPolicy (..),
newPutResolverQueryLogConfigPolicy,
putResolverQueryLogConfigPolicy_arn,
putResolverQueryLogConfigPolicy_resolverQueryLogConfigPolicy,
PutResolverQueryLogConfigPolicyResponse (..),
newPutResolverQueryLogConfigPolicyResponse,
putResolverQueryLogConfigPolicyResponse_returnValue,
putResolverQueryLogConfigPolicyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53Resolver.Types
data PutResolverQueryLogConfigPolicy = PutResolverQueryLogConfigPolicy'
{
PutResolverQueryLogConfigPolicy -> Text
arn :: Prelude.Text,
PutResolverQueryLogConfigPolicy -> Text
resolverQueryLogConfigPolicy :: Prelude.Text
}
deriving (PutResolverQueryLogConfigPolicy
-> PutResolverQueryLogConfigPolicy -> Bool
(PutResolverQueryLogConfigPolicy
-> PutResolverQueryLogConfigPolicy -> Bool)
-> (PutResolverQueryLogConfigPolicy
-> PutResolverQueryLogConfigPolicy -> Bool)
-> Eq PutResolverQueryLogConfigPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutResolverQueryLogConfigPolicy
-> PutResolverQueryLogConfigPolicy -> Bool
$c/= :: PutResolverQueryLogConfigPolicy
-> PutResolverQueryLogConfigPolicy -> Bool
== :: PutResolverQueryLogConfigPolicy
-> PutResolverQueryLogConfigPolicy -> Bool
$c== :: PutResolverQueryLogConfigPolicy
-> PutResolverQueryLogConfigPolicy -> Bool
Prelude.Eq, ReadPrec [PutResolverQueryLogConfigPolicy]
ReadPrec PutResolverQueryLogConfigPolicy
Int -> ReadS PutResolverQueryLogConfigPolicy
ReadS [PutResolverQueryLogConfigPolicy]
(Int -> ReadS PutResolverQueryLogConfigPolicy)
-> ReadS [PutResolverQueryLogConfigPolicy]
-> ReadPrec PutResolverQueryLogConfigPolicy
-> ReadPrec [PutResolverQueryLogConfigPolicy]
-> Read PutResolverQueryLogConfigPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutResolverQueryLogConfigPolicy]
$creadListPrec :: ReadPrec [PutResolverQueryLogConfigPolicy]
readPrec :: ReadPrec PutResolverQueryLogConfigPolicy
$creadPrec :: ReadPrec PutResolverQueryLogConfigPolicy
readList :: ReadS [PutResolverQueryLogConfigPolicy]
$creadList :: ReadS [PutResolverQueryLogConfigPolicy]
readsPrec :: Int -> ReadS PutResolverQueryLogConfigPolicy
$creadsPrec :: Int -> ReadS PutResolverQueryLogConfigPolicy
Prelude.Read, Int -> PutResolverQueryLogConfigPolicy -> ShowS
[PutResolverQueryLogConfigPolicy] -> ShowS
PutResolverQueryLogConfigPolicy -> String
(Int -> PutResolverQueryLogConfigPolicy -> ShowS)
-> (PutResolverQueryLogConfigPolicy -> String)
-> ([PutResolverQueryLogConfigPolicy] -> ShowS)
-> Show PutResolverQueryLogConfigPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutResolverQueryLogConfigPolicy] -> ShowS
$cshowList :: [PutResolverQueryLogConfigPolicy] -> ShowS
show :: PutResolverQueryLogConfigPolicy -> String
$cshow :: PutResolverQueryLogConfigPolicy -> String
showsPrec :: Int -> PutResolverQueryLogConfigPolicy -> ShowS
$cshowsPrec :: Int -> PutResolverQueryLogConfigPolicy -> ShowS
Prelude.Show, (forall x.
PutResolverQueryLogConfigPolicy
-> Rep PutResolverQueryLogConfigPolicy x)
-> (forall x.
Rep PutResolverQueryLogConfigPolicy x
-> PutResolverQueryLogConfigPolicy)
-> Generic PutResolverQueryLogConfigPolicy
forall x.
Rep PutResolverQueryLogConfigPolicy x
-> PutResolverQueryLogConfigPolicy
forall x.
PutResolverQueryLogConfigPolicy
-> Rep PutResolverQueryLogConfigPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutResolverQueryLogConfigPolicy x
-> PutResolverQueryLogConfigPolicy
$cfrom :: forall x.
PutResolverQueryLogConfigPolicy
-> Rep PutResolverQueryLogConfigPolicy x
Prelude.Generic)
newPutResolverQueryLogConfigPolicy ::
Prelude.Text ->
Prelude.Text ->
PutResolverQueryLogConfigPolicy
newPutResolverQueryLogConfigPolicy :: Text -> Text -> PutResolverQueryLogConfigPolicy
newPutResolverQueryLogConfigPolicy
Text
pArn_
Text
pResolverQueryLogConfigPolicy_ =
PutResolverQueryLogConfigPolicy' :: Text -> Text -> PutResolverQueryLogConfigPolicy
PutResolverQueryLogConfigPolicy'
{ $sel:arn:PutResolverQueryLogConfigPolicy' :: Text
arn = Text
pArn_,
$sel:resolverQueryLogConfigPolicy:PutResolverQueryLogConfigPolicy' :: Text
resolverQueryLogConfigPolicy =
Text
pResolverQueryLogConfigPolicy_
}
putResolverQueryLogConfigPolicy_arn :: Lens.Lens' PutResolverQueryLogConfigPolicy Prelude.Text
putResolverQueryLogConfigPolicy_arn :: (Text -> f Text)
-> PutResolverQueryLogConfigPolicy
-> f PutResolverQueryLogConfigPolicy
putResolverQueryLogConfigPolicy_arn = (PutResolverQueryLogConfigPolicy -> Text)
-> (PutResolverQueryLogConfigPolicy
-> Text -> PutResolverQueryLogConfigPolicy)
-> Lens
PutResolverQueryLogConfigPolicy
PutResolverQueryLogConfigPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResolverQueryLogConfigPolicy' {Text
arn :: Text
$sel:arn:PutResolverQueryLogConfigPolicy' :: PutResolverQueryLogConfigPolicy -> Text
arn} -> Text
arn) (\s :: PutResolverQueryLogConfigPolicy
s@PutResolverQueryLogConfigPolicy' {} Text
a -> PutResolverQueryLogConfigPolicy
s {$sel:arn:PutResolverQueryLogConfigPolicy' :: Text
arn = Text
a} :: PutResolverQueryLogConfigPolicy)
putResolverQueryLogConfigPolicy_resolverQueryLogConfigPolicy :: Lens.Lens' PutResolverQueryLogConfigPolicy Prelude.Text
putResolverQueryLogConfigPolicy_resolverQueryLogConfigPolicy :: (Text -> f Text)
-> PutResolverQueryLogConfigPolicy
-> f PutResolverQueryLogConfigPolicy
putResolverQueryLogConfigPolicy_resolverQueryLogConfigPolicy = (PutResolverQueryLogConfigPolicy -> Text)
-> (PutResolverQueryLogConfigPolicy
-> Text -> PutResolverQueryLogConfigPolicy)
-> Lens
PutResolverQueryLogConfigPolicy
PutResolverQueryLogConfigPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResolverQueryLogConfigPolicy' {Text
resolverQueryLogConfigPolicy :: Text
$sel:resolverQueryLogConfigPolicy:PutResolverQueryLogConfigPolicy' :: PutResolverQueryLogConfigPolicy -> Text
resolverQueryLogConfigPolicy} -> Text
resolverQueryLogConfigPolicy) (\s :: PutResolverQueryLogConfigPolicy
s@PutResolverQueryLogConfigPolicy' {} Text
a -> PutResolverQueryLogConfigPolicy
s {$sel:resolverQueryLogConfigPolicy:PutResolverQueryLogConfigPolicy' :: Text
resolverQueryLogConfigPolicy = Text
a} :: PutResolverQueryLogConfigPolicy)
instance
Core.AWSRequest
PutResolverQueryLogConfigPolicy
where
type
AWSResponse PutResolverQueryLogConfigPolicy =
PutResolverQueryLogConfigPolicyResponse
request :: PutResolverQueryLogConfigPolicy
-> Request PutResolverQueryLogConfigPolicy
request = Service
-> PutResolverQueryLogConfigPolicy
-> Request PutResolverQueryLogConfigPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutResolverQueryLogConfigPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutResolverQueryLogConfigPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutResolverQueryLogConfigPolicy))
-> Logger
-> Service
-> Proxy PutResolverQueryLogConfigPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutResolverQueryLogConfigPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Bool -> Int -> PutResolverQueryLogConfigPolicyResponse
PutResolverQueryLogConfigPolicyResponse'
(Maybe Bool -> Int -> PutResolverQueryLogConfigPolicyResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> PutResolverQueryLogConfigPolicyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReturnValue")
Either String (Int -> PutResolverQueryLogConfigPolicyResponse)
-> Either String Int
-> Either String PutResolverQueryLogConfigPolicyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
PutResolverQueryLogConfigPolicy
instance
Prelude.NFData
PutResolverQueryLogConfigPolicy
instance
Core.ToHeaders
PutResolverQueryLogConfigPolicy
where
toHeaders :: PutResolverQueryLogConfigPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutResolverQueryLogConfigPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Route53Resolver.PutResolverQueryLogConfigPolicy" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON PutResolverQueryLogConfigPolicy where
toJSON :: PutResolverQueryLogConfigPolicy -> Value
toJSON PutResolverQueryLogConfigPolicy' {Text
resolverQueryLogConfigPolicy :: Text
arn :: Text
$sel:resolverQueryLogConfigPolicy:PutResolverQueryLogConfigPolicy' :: PutResolverQueryLogConfigPolicy -> Text
$sel:arn:PutResolverQueryLogConfigPolicy' :: PutResolverQueryLogConfigPolicy -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ResolverQueryLogConfigPolicy"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resolverQueryLogConfigPolicy
)
]
)
instance Core.ToPath PutResolverQueryLogConfigPolicy where
toPath :: PutResolverQueryLogConfigPolicy -> ByteString
toPath = ByteString -> PutResolverQueryLogConfigPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutResolverQueryLogConfigPolicy where
toQuery :: PutResolverQueryLogConfigPolicy -> QueryString
toQuery = QueryString -> PutResolverQueryLogConfigPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutResolverQueryLogConfigPolicyResponse = PutResolverQueryLogConfigPolicyResponse'
{
PutResolverQueryLogConfigPolicyResponse -> Maybe Bool
returnValue :: Prelude.Maybe Prelude.Bool,
PutResolverQueryLogConfigPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutResolverQueryLogConfigPolicyResponse
-> PutResolverQueryLogConfigPolicyResponse -> Bool
(PutResolverQueryLogConfigPolicyResponse
-> PutResolverQueryLogConfigPolicyResponse -> Bool)
-> (PutResolverQueryLogConfigPolicyResponse
-> PutResolverQueryLogConfigPolicyResponse -> Bool)
-> Eq PutResolverQueryLogConfigPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutResolverQueryLogConfigPolicyResponse
-> PutResolverQueryLogConfigPolicyResponse -> Bool
$c/= :: PutResolverQueryLogConfigPolicyResponse
-> PutResolverQueryLogConfigPolicyResponse -> Bool
== :: PutResolverQueryLogConfigPolicyResponse
-> PutResolverQueryLogConfigPolicyResponse -> Bool
$c== :: PutResolverQueryLogConfigPolicyResponse
-> PutResolverQueryLogConfigPolicyResponse -> Bool
Prelude.Eq, ReadPrec [PutResolverQueryLogConfigPolicyResponse]
ReadPrec PutResolverQueryLogConfigPolicyResponse
Int -> ReadS PutResolverQueryLogConfigPolicyResponse
ReadS [PutResolverQueryLogConfigPolicyResponse]
(Int -> ReadS PutResolverQueryLogConfigPolicyResponse)
-> ReadS [PutResolverQueryLogConfigPolicyResponse]
-> ReadPrec PutResolverQueryLogConfigPolicyResponse
-> ReadPrec [PutResolverQueryLogConfigPolicyResponse]
-> Read PutResolverQueryLogConfigPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutResolverQueryLogConfigPolicyResponse]
$creadListPrec :: ReadPrec [PutResolverQueryLogConfigPolicyResponse]
readPrec :: ReadPrec PutResolverQueryLogConfigPolicyResponse
$creadPrec :: ReadPrec PutResolverQueryLogConfigPolicyResponse
readList :: ReadS [PutResolverQueryLogConfigPolicyResponse]
$creadList :: ReadS [PutResolverQueryLogConfigPolicyResponse]
readsPrec :: Int -> ReadS PutResolverQueryLogConfigPolicyResponse
$creadsPrec :: Int -> ReadS PutResolverQueryLogConfigPolicyResponse
Prelude.Read, Int -> PutResolverQueryLogConfigPolicyResponse -> ShowS
[PutResolverQueryLogConfigPolicyResponse] -> ShowS
PutResolverQueryLogConfigPolicyResponse -> String
(Int -> PutResolverQueryLogConfigPolicyResponse -> ShowS)
-> (PutResolverQueryLogConfigPolicyResponse -> String)
-> ([PutResolverQueryLogConfigPolicyResponse] -> ShowS)
-> Show PutResolverQueryLogConfigPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutResolverQueryLogConfigPolicyResponse] -> ShowS
$cshowList :: [PutResolverQueryLogConfigPolicyResponse] -> ShowS
show :: PutResolverQueryLogConfigPolicyResponse -> String
$cshow :: PutResolverQueryLogConfigPolicyResponse -> String
showsPrec :: Int -> PutResolverQueryLogConfigPolicyResponse -> ShowS
$cshowsPrec :: Int -> PutResolverQueryLogConfigPolicyResponse -> ShowS
Prelude.Show, (forall x.
PutResolverQueryLogConfigPolicyResponse
-> Rep PutResolverQueryLogConfigPolicyResponse x)
-> (forall x.
Rep PutResolverQueryLogConfigPolicyResponse x
-> PutResolverQueryLogConfigPolicyResponse)
-> Generic PutResolverQueryLogConfigPolicyResponse
forall x.
Rep PutResolverQueryLogConfigPolicyResponse x
-> PutResolverQueryLogConfigPolicyResponse
forall x.
PutResolverQueryLogConfigPolicyResponse
-> Rep PutResolverQueryLogConfigPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutResolverQueryLogConfigPolicyResponse x
-> PutResolverQueryLogConfigPolicyResponse
$cfrom :: forall x.
PutResolverQueryLogConfigPolicyResponse
-> Rep PutResolverQueryLogConfigPolicyResponse x
Prelude.Generic)
newPutResolverQueryLogConfigPolicyResponse ::
Prelude.Int ->
PutResolverQueryLogConfigPolicyResponse
newPutResolverQueryLogConfigPolicyResponse :: Int -> PutResolverQueryLogConfigPolicyResponse
newPutResolverQueryLogConfigPolicyResponse
Int
pHttpStatus_ =
PutResolverQueryLogConfigPolicyResponse' :: Maybe Bool -> Int -> PutResolverQueryLogConfigPolicyResponse
PutResolverQueryLogConfigPolicyResponse'
{ $sel:returnValue:PutResolverQueryLogConfigPolicyResponse' :: Maybe Bool
returnValue =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutResolverQueryLogConfigPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putResolverQueryLogConfigPolicyResponse_returnValue :: Lens.Lens' PutResolverQueryLogConfigPolicyResponse (Prelude.Maybe Prelude.Bool)
putResolverQueryLogConfigPolicyResponse_returnValue :: (Maybe Bool -> f (Maybe Bool))
-> PutResolverQueryLogConfigPolicyResponse
-> f PutResolverQueryLogConfigPolicyResponse
putResolverQueryLogConfigPolicyResponse_returnValue = (PutResolverQueryLogConfigPolicyResponse -> Maybe Bool)
-> (PutResolverQueryLogConfigPolicyResponse
-> Maybe Bool -> PutResolverQueryLogConfigPolicyResponse)
-> Lens
PutResolverQueryLogConfigPolicyResponse
PutResolverQueryLogConfigPolicyResponse
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResolverQueryLogConfigPolicyResponse' {Maybe Bool
returnValue :: Maybe Bool
$sel:returnValue:PutResolverQueryLogConfigPolicyResponse' :: PutResolverQueryLogConfigPolicyResponse -> Maybe Bool
returnValue} -> Maybe Bool
returnValue) (\s :: PutResolverQueryLogConfigPolicyResponse
s@PutResolverQueryLogConfigPolicyResponse' {} Maybe Bool
a -> PutResolverQueryLogConfigPolicyResponse
s {$sel:returnValue:PutResolverQueryLogConfigPolicyResponse' :: Maybe Bool
returnValue = Maybe Bool
a} :: PutResolverQueryLogConfigPolicyResponse)
putResolverQueryLogConfigPolicyResponse_httpStatus :: Lens.Lens' PutResolverQueryLogConfigPolicyResponse Prelude.Int
putResolverQueryLogConfigPolicyResponse_httpStatus :: (Int -> f Int)
-> PutResolverQueryLogConfigPolicyResponse
-> f PutResolverQueryLogConfigPolicyResponse
putResolverQueryLogConfigPolicyResponse_httpStatus = (PutResolverQueryLogConfigPolicyResponse -> Int)
-> (PutResolverQueryLogConfigPolicyResponse
-> Int -> PutResolverQueryLogConfigPolicyResponse)
-> Lens
PutResolverQueryLogConfigPolicyResponse
PutResolverQueryLogConfigPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResolverQueryLogConfigPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutResolverQueryLogConfigPolicyResponse' :: PutResolverQueryLogConfigPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutResolverQueryLogConfigPolicyResponse
s@PutResolverQueryLogConfigPolicyResponse' {} Int
a -> PutResolverQueryLogConfigPolicyResponse
s {$sel:httpStatus:PutResolverQueryLogConfigPolicyResponse' :: Int
httpStatus = Int
a} :: PutResolverQueryLogConfigPolicyResponse)
instance
Prelude.NFData
PutResolverQueryLogConfigPolicyResponse