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