{-# 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.Route53AutoNaming.UpdateHttpNamespace
(
UpdateHttpNamespace (..),
newUpdateHttpNamespace,
updateHttpNamespace_updaterRequestId,
updateHttpNamespace_id,
updateHttpNamespace_namespace,
UpdateHttpNamespaceResponse (..),
newUpdateHttpNamespaceResponse,
updateHttpNamespaceResponse_operationId,
updateHttpNamespaceResponse_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.Route53AutoNaming.Types
data UpdateHttpNamespace = UpdateHttpNamespace'
{
UpdateHttpNamespace -> Maybe Text
updaterRequestId :: Prelude.Maybe Prelude.Text,
UpdateHttpNamespace -> Text
id :: Prelude.Text,
UpdateHttpNamespace -> HttpNamespaceChange
namespace :: HttpNamespaceChange
}
deriving (UpdateHttpNamespace -> UpdateHttpNamespace -> Bool
(UpdateHttpNamespace -> UpdateHttpNamespace -> Bool)
-> (UpdateHttpNamespace -> UpdateHttpNamespace -> Bool)
-> Eq UpdateHttpNamespace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateHttpNamespace -> UpdateHttpNamespace -> Bool
$c/= :: UpdateHttpNamespace -> UpdateHttpNamespace -> Bool
== :: UpdateHttpNamespace -> UpdateHttpNamespace -> Bool
$c== :: UpdateHttpNamespace -> UpdateHttpNamespace -> Bool
Prelude.Eq, ReadPrec [UpdateHttpNamespace]
ReadPrec UpdateHttpNamespace
Int -> ReadS UpdateHttpNamespace
ReadS [UpdateHttpNamespace]
(Int -> ReadS UpdateHttpNamespace)
-> ReadS [UpdateHttpNamespace]
-> ReadPrec UpdateHttpNamespace
-> ReadPrec [UpdateHttpNamespace]
-> Read UpdateHttpNamespace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateHttpNamespace]
$creadListPrec :: ReadPrec [UpdateHttpNamespace]
readPrec :: ReadPrec UpdateHttpNamespace
$creadPrec :: ReadPrec UpdateHttpNamespace
readList :: ReadS [UpdateHttpNamespace]
$creadList :: ReadS [UpdateHttpNamespace]
readsPrec :: Int -> ReadS UpdateHttpNamespace
$creadsPrec :: Int -> ReadS UpdateHttpNamespace
Prelude.Read, Int -> UpdateHttpNamespace -> ShowS
[UpdateHttpNamespace] -> ShowS
UpdateHttpNamespace -> String
(Int -> UpdateHttpNamespace -> ShowS)
-> (UpdateHttpNamespace -> String)
-> ([UpdateHttpNamespace] -> ShowS)
-> Show UpdateHttpNamespace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateHttpNamespace] -> ShowS
$cshowList :: [UpdateHttpNamespace] -> ShowS
show :: UpdateHttpNamespace -> String
$cshow :: UpdateHttpNamespace -> String
showsPrec :: Int -> UpdateHttpNamespace -> ShowS
$cshowsPrec :: Int -> UpdateHttpNamespace -> ShowS
Prelude.Show, (forall x. UpdateHttpNamespace -> Rep UpdateHttpNamespace x)
-> (forall x. Rep UpdateHttpNamespace x -> UpdateHttpNamespace)
-> Generic UpdateHttpNamespace
forall x. Rep UpdateHttpNamespace x -> UpdateHttpNamespace
forall x. UpdateHttpNamespace -> Rep UpdateHttpNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateHttpNamespace x -> UpdateHttpNamespace
$cfrom :: forall x. UpdateHttpNamespace -> Rep UpdateHttpNamespace x
Prelude.Generic)
newUpdateHttpNamespace ::
Prelude.Text ->
HttpNamespaceChange ->
UpdateHttpNamespace
newUpdateHttpNamespace :: Text -> HttpNamespaceChange -> UpdateHttpNamespace
newUpdateHttpNamespace Text
pId_ HttpNamespaceChange
pNamespace_ =
UpdateHttpNamespace' :: Maybe Text -> Text -> HttpNamespaceChange -> UpdateHttpNamespace
UpdateHttpNamespace'
{ $sel:updaterRequestId:UpdateHttpNamespace' :: Maybe Text
updaterRequestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:UpdateHttpNamespace' :: Text
id = Text
pId_,
$sel:namespace:UpdateHttpNamespace' :: HttpNamespaceChange
namespace = HttpNamespaceChange
pNamespace_
}
updateHttpNamespace_updaterRequestId :: Lens.Lens' UpdateHttpNamespace (Prelude.Maybe Prelude.Text)
updateHttpNamespace_updaterRequestId :: (Maybe Text -> f (Maybe Text))
-> UpdateHttpNamespace -> f UpdateHttpNamespace
updateHttpNamespace_updaterRequestId = (UpdateHttpNamespace -> Maybe Text)
-> (UpdateHttpNamespace -> Maybe Text -> UpdateHttpNamespace)
-> Lens
UpdateHttpNamespace UpdateHttpNamespace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateHttpNamespace' {Maybe Text
updaterRequestId :: Maybe Text
$sel:updaterRequestId:UpdateHttpNamespace' :: UpdateHttpNamespace -> Maybe Text
updaterRequestId} -> Maybe Text
updaterRequestId) (\s :: UpdateHttpNamespace
s@UpdateHttpNamespace' {} Maybe Text
a -> UpdateHttpNamespace
s {$sel:updaterRequestId:UpdateHttpNamespace' :: Maybe Text
updaterRequestId = Maybe Text
a} :: UpdateHttpNamespace)
updateHttpNamespace_id :: Lens.Lens' UpdateHttpNamespace Prelude.Text
updateHttpNamespace_id :: (Text -> f Text) -> UpdateHttpNamespace -> f UpdateHttpNamespace
updateHttpNamespace_id = (UpdateHttpNamespace -> Text)
-> (UpdateHttpNamespace -> Text -> UpdateHttpNamespace)
-> Lens UpdateHttpNamespace UpdateHttpNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateHttpNamespace' {Text
id :: Text
$sel:id:UpdateHttpNamespace' :: UpdateHttpNamespace -> Text
id} -> Text
id) (\s :: UpdateHttpNamespace
s@UpdateHttpNamespace' {} Text
a -> UpdateHttpNamespace
s {$sel:id:UpdateHttpNamespace' :: Text
id = Text
a} :: UpdateHttpNamespace)
updateHttpNamespace_namespace :: Lens.Lens' UpdateHttpNamespace HttpNamespaceChange
updateHttpNamespace_namespace :: (HttpNamespaceChange -> f HttpNamespaceChange)
-> UpdateHttpNamespace -> f UpdateHttpNamespace
updateHttpNamespace_namespace = (UpdateHttpNamespace -> HttpNamespaceChange)
-> (UpdateHttpNamespace
-> HttpNamespaceChange -> UpdateHttpNamespace)
-> Lens
UpdateHttpNamespace
UpdateHttpNamespace
HttpNamespaceChange
HttpNamespaceChange
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateHttpNamespace' {HttpNamespaceChange
namespace :: HttpNamespaceChange
$sel:namespace:UpdateHttpNamespace' :: UpdateHttpNamespace -> HttpNamespaceChange
namespace} -> HttpNamespaceChange
namespace) (\s :: UpdateHttpNamespace
s@UpdateHttpNamespace' {} HttpNamespaceChange
a -> UpdateHttpNamespace
s {$sel:namespace:UpdateHttpNamespace' :: HttpNamespaceChange
namespace = HttpNamespaceChange
a} :: UpdateHttpNamespace)
instance Core.AWSRequest UpdateHttpNamespace where
type
AWSResponse UpdateHttpNamespace =
UpdateHttpNamespaceResponse
request :: UpdateHttpNamespace -> Request UpdateHttpNamespace
request = Service -> UpdateHttpNamespace -> Request UpdateHttpNamespace
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateHttpNamespace
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateHttpNamespace)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateHttpNamespace))
-> Logger
-> Service
-> Proxy UpdateHttpNamespace
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateHttpNamespace)))
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 Text -> Int -> UpdateHttpNamespaceResponse
UpdateHttpNamespaceResponse'
(Maybe Text -> Int -> UpdateHttpNamespaceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateHttpNamespaceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"OperationId")
Either String (Int -> UpdateHttpNamespaceResponse)
-> Either String Int -> Either String UpdateHttpNamespaceResponse
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 UpdateHttpNamespace
instance Prelude.NFData UpdateHttpNamespace
instance Core.ToHeaders UpdateHttpNamespace where
toHeaders :: UpdateHttpNamespace -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateHttpNamespace -> 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
"Route53AutoNaming_v20170314.UpdateHttpNamespace" ::
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 UpdateHttpNamespace where
toJSON :: UpdateHttpNamespace -> Value
toJSON UpdateHttpNamespace' {Maybe Text
Text
HttpNamespaceChange
namespace :: HttpNamespaceChange
id :: Text
updaterRequestId :: Maybe Text
$sel:namespace:UpdateHttpNamespace' :: UpdateHttpNamespace -> HttpNamespaceChange
$sel:id:UpdateHttpNamespace' :: UpdateHttpNamespace -> Text
$sel:updaterRequestId:UpdateHttpNamespace' :: UpdateHttpNamespace -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"UpdaterRequestId" 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
updaterRequestId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Namespace" Text -> HttpNamespaceChange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HttpNamespaceChange
namespace)
]
)
instance Core.ToPath UpdateHttpNamespace where
toPath :: UpdateHttpNamespace -> ByteString
toPath = ByteString -> UpdateHttpNamespace -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateHttpNamespace where
toQuery :: UpdateHttpNamespace -> QueryString
toQuery = QueryString -> UpdateHttpNamespace -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateHttpNamespaceResponse = UpdateHttpNamespaceResponse'
{
UpdateHttpNamespaceResponse -> Maybe Text
operationId :: Prelude.Maybe Prelude.Text,
UpdateHttpNamespaceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateHttpNamespaceResponse -> UpdateHttpNamespaceResponse -> Bool
(UpdateHttpNamespaceResponse
-> UpdateHttpNamespaceResponse -> Bool)
-> (UpdateHttpNamespaceResponse
-> UpdateHttpNamespaceResponse -> Bool)
-> Eq UpdateHttpNamespaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateHttpNamespaceResponse -> UpdateHttpNamespaceResponse -> Bool
$c/= :: UpdateHttpNamespaceResponse -> UpdateHttpNamespaceResponse -> Bool
== :: UpdateHttpNamespaceResponse -> UpdateHttpNamespaceResponse -> Bool
$c== :: UpdateHttpNamespaceResponse -> UpdateHttpNamespaceResponse -> Bool
Prelude.Eq, ReadPrec [UpdateHttpNamespaceResponse]
ReadPrec UpdateHttpNamespaceResponse
Int -> ReadS UpdateHttpNamespaceResponse
ReadS [UpdateHttpNamespaceResponse]
(Int -> ReadS UpdateHttpNamespaceResponse)
-> ReadS [UpdateHttpNamespaceResponse]
-> ReadPrec UpdateHttpNamespaceResponse
-> ReadPrec [UpdateHttpNamespaceResponse]
-> Read UpdateHttpNamespaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateHttpNamespaceResponse]
$creadListPrec :: ReadPrec [UpdateHttpNamespaceResponse]
readPrec :: ReadPrec UpdateHttpNamespaceResponse
$creadPrec :: ReadPrec UpdateHttpNamespaceResponse
readList :: ReadS [UpdateHttpNamespaceResponse]
$creadList :: ReadS [UpdateHttpNamespaceResponse]
readsPrec :: Int -> ReadS UpdateHttpNamespaceResponse
$creadsPrec :: Int -> ReadS UpdateHttpNamespaceResponse
Prelude.Read, Int -> UpdateHttpNamespaceResponse -> ShowS
[UpdateHttpNamespaceResponse] -> ShowS
UpdateHttpNamespaceResponse -> String
(Int -> UpdateHttpNamespaceResponse -> ShowS)
-> (UpdateHttpNamespaceResponse -> String)
-> ([UpdateHttpNamespaceResponse] -> ShowS)
-> Show UpdateHttpNamespaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateHttpNamespaceResponse] -> ShowS
$cshowList :: [UpdateHttpNamespaceResponse] -> ShowS
show :: UpdateHttpNamespaceResponse -> String
$cshow :: UpdateHttpNamespaceResponse -> String
showsPrec :: Int -> UpdateHttpNamespaceResponse -> ShowS
$cshowsPrec :: Int -> UpdateHttpNamespaceResponse -> ShowS
Prelude.Show, (forall x.
UpdateHttpNamespaceResponse -> Rep UpdateHttpNamespaceResponse x)
-> (forall x.
Rep UpdateHttpNamespaceResponse x -> UpdateHttpNamespaceResponse)
-> Generic UpdateHttpNamespaceResponse
forall x.
Rep UpdateHttpNamespaceResponse x -> UpdateHttpNamespaceResponse
forall x.
UpdateHttpNamespaceResponse -> Rep UpdateHttpNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateHttpNamespaceResponse x -> UpdateHttpNamespaceResponse
$cfrom :: forall x.
UpdateHttpNamespaceResponse -> Rep UpdateHttpNamespaceResponse x
Prelude.Generic)
newUpdateHttpNamespaceResponse ::
Prelude.Int ->
UpdateHttpNamespaceResponse
newUpdateHttpNamespaceResponse :: Int -> UpdateHttpNamespaceResponse
newUpdateHttpNamespaceResponse Int
pHttpStatus_ =
UpdateHttpNamespaceResponse' :: Maybe Text -> Int -> UpdateHttpNamespaceResponse
UpdateHttpNamespaceResponse'
{ $sel:operationId:UpdateHttpNamespaceResponse' :: Maybe Text
operationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateHttpNamespaceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateHttpNamespaceResponse_operationId :: Lens.Lens' UpdateHttpNamespaceResponse (Prelude.Maybe Prelude.Text)
updateHttpNamespaceResponse_operationId :: (Maybe Text -> f (Maybe Text))
-> UpdateHttpNamespaceResponse -> f UpdateHttpNamespaceResponse
updateHttpNamespaceResponse_operationId = (UpdateHttpNamespaceResponse -> Maybe Text)
-> (UpdateHttpNamespaceResponse
-> Maybe Text -> UpdateHttpNamespaceResponse)
-> Lens
UpdateHttpNamespaceResponse
UpdateHttpNamespaceResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateHttpNamespaceResponse' {Maybe Text
operationId :: Maybe Text
$sel:operationId:UpdateHttpNamespaceResponse' :: UpdateHttpNamespaceResponse -> Maybe Text
operationId} -> Maybe Text
operationId) (\s :: UpdateHttpNamespaceResponse
s@UpdateHttpNamespaceResponse' {} Maybe Text
a -> UpdateHttpNamespaceResponse
s {$sel:operationId:UpdateHttpNamespaceResponse' :: Maybe Text
operationId = Maybe Text
a} :: UpdateHttpNamespaceResponse)
updateHttpNamespaceResponse_httpStatus :: Lens.Lens' UpdateHttpNamespaceResponse Prelude.Int
updateHttpNamespaceResponse_httpStatus :: (Int -> f Int)
-> UpdateHttpNamespaceResponse -> f UpdateHttpNamespaceResponse
updateHttpNamespaceResponse_httpStatus = (UpdateHttpNamespaceResponse -> Int)
-> (UpdateHttpNamespaceResponse
-> Int -> UpdateHttpNamespaceResponse)
-> Lens
UpdateHttpNamespaceResponse UpdateHttpNamespaceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateHttpNamespaceResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateHttpNamespaceResponse' :: UpdateHttpNamespaceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateHttpNamespaceResponse
s@UpdateHttpNamespaceResponse' {} Int
a -> UpdateHttpNamespaceResponse
s {$sel:httpStatus:UpdateHttpNamespaceResponse' :: Int
httpStatus = Int
a} :: UpdateHttpNamespaceResponse)
instance Prelude.NFData UpdateHttpNamespaceResponse