{-# 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.AssociateResolverQueryLogConfig
(
AssociateResolverQueryLogConfig (..),
newAssociateResolverQueryLogConfig,
associateResolverQueryLogConfig_resolverQueryLogConfigId,
associateResolverQueryLogConfig_resourceId,
AssociateResolverQueryLogConfigResponse (..),
newAssociateResolverQueryLogConfigResponse,
associateResolverQueryLogConfigResponse_resolverQueryLogConfigAssociation,
associateResolverQueryLogConfigResponse_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 AssociateResolverQueryLogConfig = AssociateResolverQueryLogConfig'
{
AssociateResolverQueryLogConfig -> Text
resolverQueryLogConfigId :: Prelude.Text,
AssociateResolverQueryLogConfig -> Text
resourceId :: Prelude.Text
}
deriving (AssociateResolverQueryLogConfig
-> AssociateResolverQueryLogConfig -> Bool
(AssociateResolverQueryLogConfig
-> AssociateResolverQueryLogConfig -> Bool)
-> (AssociateResolverQueryLogConfig
-> AssociateResolverQueryLogConfig -> Bool)
-> Eq AssociateResolverQueryLogConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateResolverQueryLogConfig
-> AssociateResolverQueryLogConfig -> Bool
$c/= :: AssociateResolverQueryLogConfig
-> AssociateResolverQueryLogConfig -> Bool
== :: AssociateResolverQueryLogConfig
-> AssociateResolverQueryLogConfig -> Bool
$c== :: AssociateResolverQueryLogConfig
-> AssociateResolverQueryLogConfig -> Bool
Prelude.Eq, ReadPrec [AssociateResolverQueryLogConfig]
ReadPrec AssociateResolverQueryLogConfig
Int -> ReadS AssociateResolverQueryLogConfig
ReadS [AssociateResolverQueryLogConfig]
(Int -> ReadS AssociateResolverQueryLogConfig)
-> ReadS [AssociateResolverQueryLogConfig]
-> ReadPrec AssociateResolverQueryLogConfig
-> ReadPrec [AssociateResolverQueryLogConfig]
-> Read AssociateResolverQueryLogConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateResolverQueryLogConfig]
$creadListPrec :: ReadPrec [AssociateResolverQueryLogConfig]
readPrec :: ReadPrec AssociateResolverQueryLogConfig
$creadPrec :: ReadPrec AssociateResolverQueryLogConfig
readList :: ReadS [AssociateResolverQueryLogConfig]
$creadList :: ReadS [AssociateResolverQueryLogConfig]
readsPrec :: Int -> ReadS AssociateResolverQueryLogConfig
$creadsPrec :: Int -> ReadS AssociateResolverQueryLogConfig
Prelude.Read, Int -> AssociateResolverQueryLogConfig -> ShowS
[AssociateResolverQueryLogConfig] -> ShowS
AssociateResolverQueryLogConfig -> String
(Int -> AssociateResolverQueryLogConfig -> ShowS)
-> (AssociateResolverQueryLogConfig -> String)
-> ([AssociateResolverQueryLogConfig] -> ShowS)
-> Show AssociateResolverQueryLogConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateResolverQueryLogConfig] -> ShowS
$cshowList :: [AssociateResolverQueryLogConfig] -> ShowS
show :: AssociateResolverQueryLogConfig -> String
$cshow :: AssociateResolverQueryLogConfig -> String
showsPrec :: Int -> AssociateResolverQueryLogConfig -> ShowS
$cshowsPrec :: Int -> AssociateResolverQueryLogConfig -> ShowS
Prelude.Show, (forall x.
AssociateResolverQueryLogConfig
-> Rep AssociateResolverQueryLogConfig x)
-> (forall x.
Rep AssociateResolverQueryLogConfig x
-> AssociateResolverQueryLogConfig)
-> Generic AssociateResolverQueryLogConfig
forall x.
Rep AssociateResolverQueryLogConfig x
-> AssociateResolverQueryLogConfig
forall x.
AssociateResolverQueryLogConfig
-> Rep AssociateResolverQueryLogConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateResolverQueryLogConfig x
-> AssociateResolverQueryLogConfig
$cfrom :: forall x.
AssociateResolverQueryLogConfig
-> Rep AssociateResolverQueryLogConfig x
Prelude.Generic)
newAssociateResolverQueryLogConfig ::
Prelude.Text ->
Prelude.Text ->
AssociateResolverQueryLogConfig
newAssociateResolverQueryLogConfig :: Text -> Text -> AssociateResolverQueryLogConfig
newAssociateResolverQueryLogConfig
Text
pResolverQueryLogConfigId_
Text
pResourceId_ =
AssociateResolverQueryLogConfig' :: Text -> Text -> AssociateResolverQueryLogConfig
AssociateResolverQueryLogConfig'
{ $sel:resolverQueryLogConfigId:AssociateResolverQueryLogConfig' :: Text
resolverQueryLogConfigId =
Text
pResolverQueryLogConfigId_,
$sel:resourceId:AssociateResolverQueryLogConfig' :: Text
resourceId = Text
pResourceId_
}
associateResolverQueryLogConfig_resolverQueryLogConfigId :: Lens.Lens' AssociateResolverQueryLogConfig Prelude.Text
associateResolverQueryLogConfig_resolverQueryLogConfigId :: (Text -> f Text)
-> AssociateResolverQueryLogConfig
-> f AssociateResolverQueryLogConfig
associateResolverQueryLogConfig_resolverQueryLogConfigId = (AssociateResolverQueryLogConfig -> Text)
-> (AssociateResolverQueryLogConfig
-> Text -> AssociateResolverQueryLogConfig)
-> Lens
AssociateResolverQueryLogConfig
AssociateResolverQueryLogConfig
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResolverQueryLogConfig' {Text
resolverQueryLogConfigId :: Text
$sel:resolverQueryLogConfigId:AssociateResolverQueryLogConfig' :: AssociateResolverQueryLogConfig -> Text
resolverQueryLogConfigId} -> Text
resolverQueryLogConfigId) (\s :: AssociateResolverQueryLogConfig
s@AssociateResolverQueryLogConfig' {} Text
a -> AssociateResolverQueryLogConfig
s {$sel:resolverQueryLogConfigId:AssociateResolverQueryLogConfig' :: Text
resolverQueryLogConfigId = Text
a} :: AssociateResolverQueryLogConfig)
associateResolverQueryLogConfig_resourceId :: Lens.Lens' AssociateResolverQueryLogConfig Prelude.Text
associateResolverQueryLogConfig_resourceId :: (Text -> f Text)
-> AssociateResolverQueryLogConfig
-> f AssociateResolverQueryLogConfig
associateResolverQueryLogConfig_resourceId = (AssociateResolverQueryLogConfig -> Text)
-> (AssociateResolverQueryLogConfig
-> Text -> AssociateResolverQueryLogConfig)
-> Lens
AssociateResolverQueryLogConfig
AssociateResolverQueryLogConfig
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResolverQueryLogConfig' {Text
resourceId :: Text
$sel:resourceId:AssociateResolverQueryLogConfig' :: AssociateResolverQueryLogConfig -> Text
resourceId} -> Text
resourceId) (\s :: AssociateResolverQueryLogConfig
s@AssociateResolverQueryLogConfig' {} Text
a -> AssociateResolverQueryLogConfig
s {$sel:resourceId:AssociateResolverQueryLogConfig' :: Text
resourceId = Text
a} :: AssociateResolverQueryLogConfig)
instance
Core.AWSRequest
AssociateResolverQueryLogConfig
where
type
AWSResponse AssociateResolverQueryLogConfig =
AssociateResolverQueryLogConfigResponse
request :: AssociateResolverQueryLogConfig
-> Request AssociateResolverQueryLogConfig
request = Service
-> AssociateResolverQueryLogConfig
-> Request AssociateResolverQueryLogConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateResolverQueryLogConfig
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateResolverQueryLogConfig)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AssociateResolverQueryLogConfig))
-> Logger
-> Service
-> Proxy AssociateResolverQueryLogConfig
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateResolverQueryLogConfig)))
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 ResolverQueryLogConfigAssociation
-> Int -> AssociateResolverQueryLogConfigResponse
AssociateResolverQueryLogConfigResponse'
(Maybe ResolverQueryLogConfigAssociation
-> Int -> AssociateResolverQueryLogConfigResponse)
-> Either String (Maybe ResolverQueryLogConfigAssociation)
-> Either String (Int -> AssociateResolverQueryLogConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe ResolverQueryLogConfigAssociation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResolverQueryLogConfigAssociation")
Either String (Int -> AssociateResolverQueryLogConfigResponse)
-> Either String Int
-> Either String AssociateResolverQueryLogConfigResponse
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
AssociateResolverQueryLogConfig
instance
Prelude.NFData
AssociateResolverQueryLogConfig
instance
Core.ToHeaders
AssociateResolverQueryLogConfig
where
toHeaders :: AssociateResolverQueryLogConfig -> ResponseHeaders
toHeaders =
ResponseHeaders
-> AssociateResolverQueryLogConfig -> 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.AssociateResolverQueryLogConfig" ::
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 AssociateResolverQueryLogConfig where
toJSON :: AssociateResolverQueryLogConfig -> Value
toJSON AssociateResolverQueryLogConfig' {Text
resourceId :: Text
resolverQueryLogConfigId :: Text
$sel:resourceId:AssociateResolverQueryLogConfig' :: AssociateResolverQueryLogConfig -> Text
$sel:resolverQueryLogConfigId:AssociateResolverQueryLogConfig' :: AssociateResolverQueryLogConfig -> 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
"ResolverQueryLogConfigId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resolverQueryLogConfigId
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId)
]
)
instance Core.ToPath AssociateResolverQueryLogConfig where
toPath :: AssociateResolverQueryLogConfig -> ByteString
toPath = ByteString -> AssociateResolverQueryLogConfig -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AssociateResolverQueryLogConfig where
toQuery :: AssociateResolverQueryLogConfig -> QueryString
toQuery = QueryString -> AssociateResolverQueryLogConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AssociateResolverQueryLogConfigResponse = AssociateResolverQueryLogConfigResponse'
{
AssociateResolverQueryLogConfigResponse
-> Maybe ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation :: Prelude.Maybe ResolverQueryLogConfigAssociation,
AssociateResolverQueryLogConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateResolverQueryLogConfigResponse
-> AssociateResolverQueryLogConfigResponse -> Bool
(AssociateResolverQueryLogConfigResponse
-> AssociateResolverQueryLogConfigResponse -> Bool)
-> (AssociateResolverQueryLogConfigResponse
-> AssociateResolverQueryLogConfigResponse -> Bool)
-> Eq AssociateResolverQueryLogConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateResolverQueryLogConfigResponse
-> AssociateResolverQueryLogConfigResponse -> Bool
$c/= :: AssociateResolverQueryLogConfigResponse
-> AssociateResolverQueryLogConfigResponse -> Bool
== :: AssociateResolverQueryLogConfigResponse
-> AssociateResolverQueryLogConfigResponse -> Bool
$c== :: AssociateResolverQueryLogConfigResponse
-> AssociateResolverQueryLogConfigResponse -> Bool
Prelude.Eq, ReadPrec [AssociateResolverQueryLogConfigResponse]
ReadPrec AssociateResolverQueryLogConfigResponse
Int -> ReadS AssociateResolverQueryLogConfigResponse
ReadS [AssociateResolverQueryLogConfigResponse]
(Int -> ReadS AssociateResolverQueryLogConfigResponse)
-> ReadS [AssociateResolverQueryLogConfigResponse]
-> ReadPrec AssociateResolverQueryLogConfigResponse
-> ReadPrec [AssociateResolverQueryLogConfigResponse]
-> Read AssociateResolverQueryLogConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateResolverQueryLogConfigResponse]
$creadListPrec :: ReadPrec [AssociateResolverQueryLogConfigResponse]
readPrec :: ReadPrec AssociateResolverQueryLogConfigResponse
$creadPrec :: ReadPrec AssociateResolverQueryLogConfigResponse
readList :: ReadS [AssociateResolverQueryLogConfigResponse]
$creadList :: ReadS [AssociateResolverQueryLogConfigResponse]
readsPrec :: Int -> ReadS AssociateResolverQueryLogConfigResponse
$creadsPrec :: Int -> ReadS AssociateResolverQueryLogConfigResponse
Prelude.Read, Int -> AssociateResolverQueryLogConfigResponse -> ShowS
[AssociateResolverQueryLogConfigResponse] -> ShowS
AssociateResolverQueryLogConfigResponse -> String
(Int -> AssociateResolverQueryLogConfigResponse -> ShowS)
-> (AssociateResolverQueryLogConfigResponse -> String)
-> ([AssociateResolverQueryLogConfigResponse] -> ShowS)
-> Show AssociateResolverQueryLogConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateResolverQueryLogConfigResponse] -> ShowS
$cshowList :: [AssociateResolverQueryLogConfigResponse] -> ShowS
show :: AssociateResolverQueryLogConfigResponse -> String
$cshow :: AssociateResolverQueryLogConfigResponse -> String
showsPrec :: Int -> AssociateResolverQueryLogConfigResponse -> ShowS
$cshowsPrec :: Int -> AssociateResolverQueryLogConfigResponse -> ShowS
Prelude.Show, (forall x.
AssociateResolverQueryLogConfigResponse
-> Rep AssociateResolverQueryLogConfigResponse x)
-> (forall x.
Rep AssociateResolverQueryLogConfigResponse x
-> AssociateResolverQueryLogConfigResponse)
-> Generic AssociateResolverQueryLogConfigResponse
forall x.
Rep AssociateResolverQueryLogConfigResponse x
-> AssociateResolverQueryLogConfigResponse
forall x.
AssociateResolverQueryLogConfigResponse
-> Rep AssociateResolverQueryLogConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateResolverQueryLogConfigResponse x
-> AssociateResolverQueryLogConfigResponse
$cfrom :: forall x.
AssociateResolverQueryLogConfigResponse
-> Rep AssociateResolverQueryLogConfigResponse x
Prelude.Generic)
newAssociateResolverQueryLogConfigResponse ::
Prelude.Int ->
AssociateResolverQueryLogConfigResponse
newAssociateResolverQueryLogConfigResponse :: Int -> AssociateResolverQueryLogConfigResponse
newAssociateResolverQueryLogConfigResponse
Int
pHttpStatus_ =
AssociateResolverQueryLogConfigResponse' :: Maybe ResolverQueryLogConfigAssociation
-> Int -> AssociateResolverQueryLogConfigResponse
AssociateResolverQueryLogConfigResponse'
{ $sel:resolverQueryLogConfigAssociation:AssociateResolverQueryLogConfigResponse' :: Maybe ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation =
Maybe ResolverQueryLogConfigAssociation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AssociateResolverQueryLogConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
}
associateResolverQueryLogConfigResponse_resolverQueryLogConfigAssociation :: Lens.Lens' AssociateResolverQueryLogConfigResponse (Prelude.Maybe ResolverQueryLogConfigAssociation)
associateResolverQueryLogConfigResponse_resolverQueryLogConfigAssociation :: (Maybe ResolverQueryLogConfigAssociation
-> f (Maybe ResolverQueryLogConfigAssociation))
-> AssociateResolverQueryLogConfigResponse
-> f AssociateResolverQueryLogConfigResponse
associateResolverQueryLogConfigResponse_resolverQueryLogConfigAssociation = (AssociateResolverQueryLogConfigResponse
-> Maybe ResolverQueryLogConfigAssociation)
-> (AssociateResolverQueryLogConfigResponse
-> Maybe ResolverQueryLogConfigAssociation
-> AssociateResolverQueryLogConfigResponse)
-> Lens
AssociateResolverQueryLogConfigResponse
AssociateResolverQueryLogConfigResponse
(Maybe ResolverQueryLogConfigAssociation)
(Maybe ResolverQueryLogConfigAssociation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResolverQueryLogConfigResponse' {Maybe ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation :: Maybe ResolverQueryLogConfigAssociation
$sel:resolverQueryLogConfigAssociation:AssociateResolverQueryLogConfigResponse' :: AssociateResolverQueryLogConfigResponse
-> Maybe ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation} -> Maybe ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation) (\s :: AssociateResolverQueryLogConfigResponse
s@AssociateResolverQueryLogConfigResponse' {} Maybe ResolverQueryLogConfigAssociation
a -> AssociateResolverQueryLogConfigResponse
s {$sel:resolverQueryLogConfigAssociation:AssociateResolverQueryLogConfigResponse' :: Maybe ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation = Maybe ResolverQueryLogConfigAssociation
a} :: AssociateResolverQueryLogConfigResponse)
associateResolverQueryLogConfigResponse_httpStatus :: Lens.Lens' AssociateResolverQueryLogConfigResponse Prelude.Int
associateResolverQueryLogConfigResponse_httpStatus :: (Int -> f Int)
-> AssociateResolverQueryLogConfigResponse
-> f AssociateResolverQueryLogConfigResponse
associateResolverQueryLogConfigResponse_httpStatus = (AssociateResolverQueryLogConfigResponse -> Int)
-> (AssociateResolverQueryLogConfigResponse
-> Int -> AssociateResolverQueryLogConfigResponse)
-> Lens
AssociateResolverQueryLogConfigResponse
AssociateResolverQueryLogConfigResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResolverQueryLogConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateResolverQueryLogConfigResponse' :: AssociateResolverQueryLogConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateResolverQueryLogConfigResponse
s@AssociateResolverQueryLogConfigResponse' {} Int
a -> AssociateResolverQueryLogConfigResponse
s {$sel:httpStatus:AssociateResolverQueryLogConfigResponse' :: Int
httpStatus = Int
a} :: AssociateResolverQueryLogConfigResponse)
instance
Prelude.NFData
AssociateResolverQueryLogConfigResponse