{-# 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.UpdateResolverEndpoint
(
UpdateResolverEndpoint (..),
newUpdateResolverEndpoint,
updateResolverEndpoint_name,
updateResolverEndpoint_resolverEndpointId,
UpdateResolverEndpointResponse (..),
newUpdateResolverEndpointResponse,
updateResolverEndpointResponse_resolverEndpoint,
updateResolverEndpointResponse_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 UpdateResolverEndpoint = UpdateResolverEndpoint'
{
UpdateResolverEndpoint -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateResolverEndpoint -> Text
resolverEndpointId :: Prelude.Text
}
deriving (UpdateResolverEndpoint -> UpdateResolverEndpoint -> Bool
(UpdateResolverEndpoint -> UpdateResolverEndpoint -> Bool)
-> (UpdateResolverEndpoint -> UpdateResolverEndpoint -> Bool)
-> Eq UpdateResolverEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateResolverEndpoint -> UpdateResolverEndpoint -> Bool
$c/= :: UpdateResolverEndpoint -> UpdateResolverEndpoint -> Bool
== :: UpdateResolverEndpoint -> UpdateResolverEndpoint -> Bool
$c== :: UpdateResolverEndpoint -> UpdateResolverEndpoint -> Bool
Prelude.Eq, ReadPrec [UpdateResolverEndpoint]
ReadPrec UpdateResolverEndpoint
Int -> ReadS UpdateResolverEndpoint
ReadS [UpdateResolverEndpoint]
(Int -> ReadS UpdateResolverEndpoint)
-> ReadS [UpdateResolverEndpoint]
-> ReadPrec UpdateResolverEndpoint
-> ReadPrec [UpdateResolverEndpoint]
-> Read UpdateResolverEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateResolverEndpoint]
$creadListPrec :: ReadPrec [UpdateResolverEndpoint]
readPrec :: ReadPrec UpdateResolverEndpoint
$creadPrec :: ReadPrec UpdateResolverEndpoint
readList :: ReadS [UpdateResolverEndpoint]
$creadList :: ReadS [UpdateResolverEndpoint]
readsPrec :: Int -> ReadS UpdateResolverEndpoint
$creadsPrec :: Int -> ReadS UpdateResolverEndpoint
Prelude.Read, Int -> UpdateResolverEndpoint -> ShowS
[UpdateResolverEndpoint] -> ShowS
UpdateResolverEndpoint -> String
(Int -> UpdateResolverEndpoint -> ShowS)
-> (UpdateResolverEndpoint -> String)
-> ([UpdateResolverEndpoint] -> ShowS)
-> Show UpdateResolverEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateResolverEndpoint] -> ShowS
$cshowList :: [UpdateResolverEndpoint] -> ShowS
show :: UpdateResolverEndpoint -> String
$cshow :: UpdateResolverEndpoint -> String
showsPrec :: Int -> UpdateResolverEndpoint -> ShowS
$cshowsPrec :: Int -> UpdateResolverEndpoint -> ShowS
Prelude.Show, (forall x. UpdateResolverEndpoint -> Rep UpdateResolverEndpoint x)
-> (forall x.
Rep UpdateResolverEndpoint x -> UpdateResolverEndpoint)
-> Generic UpdateResolverEndpoint
forall x. Rep UpdateResolverEndpoint x -> UpdateResolverEndpoint
forall x. UpdateResolverEndpoint -> Rep UpdateResolverEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateResolverEndpoint x -> UpdateResolverEndpoint
$cfrom :: forall x. UpdateResolverEndpoint -> Rep UpdateResolverEndpoint x
Prelude.Generic)
newUpdateResolverEndpoint ::
Prelude.Text ->
UpdateResolverEndpoint
newUpdateResolverEndpoint :: Text -> UpdateResolverEndpoint
newUpdateResolverEndpoint Text
pResolverEndpointId_ =
UpdateResolverEndpoint' :: Maybe Text -> Text -> UpdateResolverEndpoint
UpdateResolverEndpoint'
{ $sel:name:UpdateResolverEndpoint' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resolverEndpointId:UpdateResolverEndpoint' :: Text
resolverEndpointId = Text
pResolverEndpointId_
}
updateResolverEndpoint_name :: Lens.Lens' UpdateResolverEndpoint (Prelude.Maybe Prelude.Text)
updateResolverEndpoint_name :: (Maybe Text -> f (Maybe Text))
-> UpdateResolverEndpoint -> f UpdateResolverEndpoint
updateResolverEndpoint_name = (UpdateResolverEndpoint -> Maybe Text)
-> (UpdateResolverEndpoint -> Maybe Text -> UpdateResolverEndpoint)
-> Lens
UpdateResolverEndpoint
UpdateResolverEndpoint
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResolverEndpoint' {Maybe Text
name :: Maybe Text
$sel:name:UpdateResolverEndpoint' :: UpdateResolverEndpoint -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateResolverEndpoint
s@UpdateResolverEndpoint' {} Maybe Text
a -> UpdateResolverEndpoint
s {$sel:name:UpdateResolverEndpoint' :: Maybe Text
name = Maybe Text
a} :: UpdateResolverEndpoint)
updateResolverEndpoint_resolverEndpointId :: Lens.Lens' UpdateResolverEndpoint Prelude.Text
updateResolverEndpoint_resolverEndpointId :: (Text -> f Text)
-> UpdateResolverEndpoint -> f UpdateResolverEndpoint
updateResolverEndpoint_resolverEndpointId = (UpdateResolverEndpoint -> Text)
-> (UpdateResolverEndpoint -> Text -> UpdateResolverEndpoint)
-> Lens UpdateResolverEndpoint UpdateResolverEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResolverEndpoint' {Text
resolverEndpointId :: Text
$sel:resolverEndpointId:UpdateResolverEndpoint' :: UpdateResolverEndpoint -> Text
resolverEndpointId} -> Text
resolverEndpointId) (\s :: UpdateResolverEndpoint
s@UpdateResolverEndpoint' {} Text
a -> UpdateResolverEndpoint
s {$sel:resolverEndpointId:UpdateResolverEndpoint' :: Text
resolverEndpointId = Text
a} :: UpdateResolverEndpoint)
instance Core.AWSRequest UpdateResolverEndpoint where
type
AWSResponse UpdateResolverEndpoint =
UpdateResolverEndpointResponse
request :: UpdateResolverEndpoint -> Request UpdateResolverEndpoint
request = Service -> UpdateResolverEndpoint -> Request UpdateResolverEndpoint
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateResolverEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateResolverEndpoint)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateResolverEndpoint))
-> Logger
-> Service
-> Proxy UpdateResolverEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateResolverEndpoint)))
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 ResolverEndpoint -> Int -> UpdateResolverEndpointResponse
UpdateResolverEndpointResponse'
(Maybe ResolverEndpoint -> Int -> UpdateResolverEndpointResponse)
-> Either String (Maybe ResolverEndpoint)
-> Either String (Int -> UpdateResolverEndpointResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ResolverEndpoint)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResolverEndpoint")
Either String (Int -> UpdateResolverEndpointResponse)
-> Either String Int
-> Either String UpdateResolverEndpointResponse
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 UpdateResolverEndpoint
instance Prelude.NFData UpdateResolverEndpoint
instance Core.ToHeaders UpdateResolverEndpoint where
toHeaders :: UpdateResolverEndpoint -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateResolverEndpoint -> 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.UpdateResolverEndpoint" ::
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 UpdateResolverEndpoint where
toJSON :: UpdateResolverEndpoint -> Value
toJSON UpdateResolverEndpoint' {Maybe Text
Text
resolverEndpointId :: Text
name :: Maybe Text
$sel:resolverEndpointId:UpdateResolverEndpoint' :: UpdateResolverEndpoint -> Text
$sel:name:UpdateResolverEndpoint' :: UpdateResolverEndpoint -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ResolverEndpointId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resolverEndpointId)
]
)
instance Core.ToPath UpdateResolverEndpoint where
toPath :: UpdateResolverEndpoint -> ByteString
toPath = ByteString -> UpdateResolverEndpoint -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateResolverEndpoint where
toQuery :: UpdateResolverEndpoint -> QueryString
toQuery = QueryString -> UpdateResolverEndpoint -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateResolverEndpointResponse = UpdateResolverEndpointResponse'
{
UpdateResolverEndpointResponse -> Maybe ResolverEndpoint
resolverEndpoint :: Prelude.Maybe ResolverEndpoint,
UpdateResolverEndpointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateResolverEndpointResponse
-> UpdateResolverEndpointResponse -> Bool
(UpdateResolverEndpointResponse
-> UpdateResolverEndpointResponse -> Bool)
-> (UpdateResolverEndpointResponse
-> UpdateResolverEndpointResponse -> Bool)
-> Eq UpdateResolverEndpointResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateResolverEndpointResponse
-> UpdateResolverEndpointResponse -> Bool
$c/= :: UpdateResolverEndpointResponse
-> UpdateResolverEndpointResponse -> Bool
== :: UpdateResolverEndpointResponse
-> UpdateResolverEndpointResponse -> Bool
$c== :: UpdateResolverEndpointResponse
-> UpdateResolverEndpointResponse -> Bool
Prelude.Eq, ReadPrec [UpdateResolverEndpointResponse]
ReadPrec UpdateResolverEndpointResponse
Int -> ReadS UpdateResolverEndpointResponse
ReadS [UpdateResolverEndpointResponse]
(Int -> ReadS UpdateResolverEndpointResponse)
-> ReadS [UpdateResolverEndpointResponse]
-> ReadPrec UpdateResolverEndpointResponse
-> ReadPrec [UpdateResolverEndpointResponse]
-> Read UpdateResolverEndpointResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateResolverEndpointResponse]
$creadListPrec :: ReadPrec [UpdateResolverEndpointResponse]
readPrec :: ReadPrec UpdateResolverEndpointResponse
$creadPrec :: ReadPrec UpdateResolverEndpointResponse
readList :: ReadS [UpdateResolverEndpointResponse]
$creadList :: ReadS [UpdateResolverEndpointResponse]
readsPrec :: Int -> ReadS UpdateResolverEndpointResponse
$creadsPrec :: Int -> ReadS UpdateResolverEndpointResponse
Prelude.Read, Int -> UpdateResolverEndpointResponse -> ShowS
[UpdateResolverEndpointResponse] -> ShowS
UpdateResolverEndpointResponse -> String
(Int -> UpdateResolverEndpointResponse -> ShowS)
-> (UpdateResolverEndpointResponse -> String)
-> ([UpdateResolverEndpointResponse] -> ShowS)
-> Show UpdateResolverEndpointResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateResolverEndpointResponse] -> ShowS
$cshowList :: [UpdateResolverEndpointResponse] -> ShowS
show :: UpdateResolverEndpointResponse -> String
$cshow :: UpdateResolverEndpointResponse -> String
showsPrec :: Int -> UpdateResolverEndpointResponse -> ShowS
$cshowsPrec :: Int -> UpdateResolverEndpointResponse -> ShowS
Prelude.Show, (forall x.
UpdateResolverEndpointResponse
-> Rep UpdateResolverEndpointResponse x)
-> (forall x.
Rep UpdateResolverEndpointResponse x
-> UpdateResolverEndpointResponse)
-> Generic UpdateResolverEndpointResponse
forall x.
Rep UpdateResolverEndpointResponse x
-> UpdateResolverEndpointResponse
forall x.
UpdateResolverEndpointResponse
-> Rep UpdateResolverEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateResolverEndpointResponse x
-> UpdateResolverEndpointResponse
$cfrom :: forall x.
UpdateResolverEndpointResponse
-> Rep UpdateResolverEndpointResponse x
Prelude.Generic)
newUpdateResolverEndpointResponse ::
Prelude.Int ->
UpdateResolverEndpointResponse
newUpdateResolverEndpointResponse :: Int -> UpdateResolverEndpointResponse
newUpdateResolverEndpointResponse Int
pHttpStatus_ =
UpdateResolverEndpointResponse' :: Maybe ResolverEndpoint -> Int -> UpdateResolverEndpointResponse
UpdateResolverEndpointResponse'
{ $sel:resolverEndpoint:UpdateResolverEndpointResponse' :: Maybe ResolverEndpoint
resolverEndpoint =
Maybe ResolverEndpoint
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateResolverEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateResolverEndpointResponse_resolverEndpoint :: Lens.Lens' UpdateResolverEndpointResponse (Prelude.Maybe ResolverEndpoint)
updateResolverEndpointResponse_resolverEndpoint :: (Maybe ResolverEndpoint -> f (Maybe ResolverEndpoint))
-> UpdateResolverEndpointResponse
-> f UpdateResolverEndpointResponse
updateResolverEndpointResponse_resolverEndpoint = (UpdateResolverEndpointResponse -> Maybe ResolverEndpoint)
-> (UpdateResolverEndpointResponse
-> Maybe ResolverEndpoint -> UpdateResolverEndpointResponse)
-> Lens
UpdateResolverEndpointResponse
UpdateResolverEndpointResponse
(Maybe ResolverEndpoint)
(Maybe ResolverEndpoint)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResolverEndpointResponse' {Maybe ResolverEndpoint
resolverEndpoint :: Maybe ResolverEndpoint
$sel:resolverEndpoint:UpdateResolverEndpointResponse' :: UpdateResolverEndpointResponse -> Maybe ResolverEndpoint
resolverEndpoint} -> Maybe ResolverEndpoint
resolverEndpoint) (\s :: UpdateResolverEndpointResponse
s@UpdateResolverEndpointResponse' {} Maybe ResolverEndpoint
a -> UpdateResolverEndpointResponse
s {$sel:resolverEndpoint:UpdateResolverEndpointResponse' :: Maybe ResolverEndpoint
resolverEndpoint = Maybe ResolverEndpoint
a} :: UpdateResolverEndpointResponse)
updateResolverEndpointResponse_httpStatus :: Lens.Lens' UpdateResolverEndpointResponse Prelude.Int
updateResolverEndpointResponse_httpStatus :: (Int -> f Int)
-> UpdateResolverEndpointResponse
-> f UpdateResolverEndpointResponse
updateResolverEndpointResponse_httpStatus = (UpdateResolverEndpointResponse -> Int)
-> (UpdateResolverEndpointResponse
-> Int -> UpdateResolverEndpointResponse)
-> Lens
UpdateResolverEndpointResponse
UpdateResolverEndpointResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResolverEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateResolverEndpointResponse' :: UpdateResolverEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateResolverEndpointResponse
s@UpdateResolverEndpointResponse' {} Int
a -> UpdateResolverEndpointResponse
s {$sel:httpStatus:UpdateResolverEndpointResponse' :: Int
httpStatus = Int
a} :: UpdateResolverEndpointResponse)
instance
Prelude.NFData
UpdateResolverEndpointResponse