{-# 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.DirectoryService.RemoveRegion
(
RemoveRegion (..),
newRemoveRegion,
removeRegion_directoryId,
RemoveRegionResponse (..),
newRemoveRegionResponse,
removeRegionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RemoveRegion = RemoveRegion'
{
RemoveRegion -> Text
directoryId :: Prelude.Text
}
deriving (RemoveRegion -> RemoveRegion -> Bool
(RemoveRegion -> RemoveRegion -> Bool)
-> (RemoveRegion -> RemoveRegion -> Bool) -> Eq RemoveRegion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveRegion -> RemoveRegion -> Bool
$c/= :: RemoveRegion -> RemoveRegion -> Bool
== :: RemoveRegion -> RemoveRegion -> Bool
$c== :: RemoveRegion -> RemoveRegion -> Bool
Prelude.Eq, ReadPrec [RemoveRegion]
ReadPrec RemoveRegion
Int -> ReadS RemoveRegion
ReadS [RemoveRegion]
(Int -> ReadS RemoveRegion)
-> ReadS [RemoveRegion]
-> ReadPrec RemoveRegion
-> ReadPrec [RemoveRegion]
-> Read RemoveRegion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveRegion]
$creadListPrec :: ReadPrec [RemoveRegion]
readPrec :: ReadPrec RemoveRegion
$creadPrec :: ReadPrec RemoveRegion
readList :: ReadS [RemoveRegion]
$creadList :: ReadS [RemoveRegion]
readsPrec :: Int -> ReadS RemoveRegion
$creadsPrec :: Int -> ReadS RemoveRegion
Prelude.Read, Int -> RemoveRegion -> ShowS
[RemoveRegion] -> ShowS
RemoveRegion -> String
(Int -> RemoveRegion -> ShowS)
-> (RemoveRegion -> String)
-> ([RemoveRegion] -> ShowS)
-> Show RemoveRegion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveRegion] -> ShowS
$cshowList :: [RemoveRegion] -> ShowS
show :: RemoveRegion -> String
$cshow :: RemoveRegion -> String
showsPrec :: Int -> RemoveRegion -> ShowS
$cshowsPrec :: Int -> RemoveRegion -> ShowS
Prelude.Show, (forall x. RemoveRegion -> Rep RemoveRegion x)
-> (forall x. Rep RemoveRegion x -> RemoveRegion)
-> Generic RemoveRegion
forall x. Rep RemoveRegion x -> RemoveRegion
forall x. RemoveRegion -> Rep RemoveRegion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoveRegion x -> RemoveRegion
$cfrom :: forall x. RemoveRegion -> Rep RemoveRegion x
Prelude.Generic)
newRemoveRegion ::
Prelude.Text ->
RemoveRegion
newRemoveRegion :: Text -> RemoveRegion
newRemoveRegion Text
pDirectoryId_ =
RemoveRegion' :: Text -> RemoveRegion
RemoveRegion' {$sel:directoryId:RemoveRegion' :: Text
directoryId = Text
pDirectoryId_}
removeRegion_directoryId :: Lens.Lens' RemoveRegion Prelude.Text
removeRegion_directoryId :: (Text -> f Text) -> RemoveRegion -> f RemoveRegion
removeRegion_directoryId = (RemoveRegion -> Text)
-> (RemoveRegion -> Text -> RemoveRegion)
-> Lens RemoveRegion RemoveRegion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveRegion' {Text
directoryId :: Text
$sel:directoryId:RemoveRegion' :: RemoveRegion -> Text
directoryId} -> Text
directoryId) (\s :: RemoveRegion
s@RemoveRegion' {} Text
a -> RemoveRegion
s {$sel:directoryId:RemoveRegion' :: Text
directoryId = Text
a} :: RemoveRegion)
instance Core.AWSRequest RemoveRegion where
type AWSResponse RemoveRegion = RemoveRegionResponse
request :: RemoveRegion -> Request RemoveRegion
request = Service -> RemoveRegion -> Request RemoveRegion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RemoveRegion
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RemoveRegion)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse RemoveRegion))
-> Logger
-> Service
-> Proxy RemoveRegion
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RemoveRegion)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> RemoveRegionResponse
RemoveRegionResponse'
(Int -> RemoveRegionResponse)
-> Either String Int -> Either String RemoveRegionResponse
forall (f :: * -> *) a b. Functor 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 RemoveRegion
instance Prelude.NFData RemoveRegion
instance Core.ToHeaders RemoveRegion where
toHeaders :: RemoveRegion -> ResponseHeaders
toHeaders =
ResponseHeaders -> RemoveRegion -> 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
"DirectoryService_20150416.RemoveRegion" ::
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 RemoveRegion where
toJSON :: RemoveRegion -> Value
toJSON RemoveRegion' {Text
directoryId :: Text
$sel:directoryId:RemoveRegion' :: RemoveRegion -> 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
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId)]
)
instance Core.ToPath RemoveRegion where
toPath :: RemoveRegion -> ByteString
toPath = ByteString -> RemoveRegion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RemoveRegion where
toQuery :: RemoveRegion -> QueryString
toQuery = QueryString -> RemoveRegion -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RemoveRegionResponse = RemoveRegionResponse'
{
RemoveRegionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RemoveRegionResponse -> RemoveRegionResponse -> Bool
(RemoveRegionResponse -> RemoveRegionResponse -> Bool)
-> (RemoveRegionResponse -> RemoveRegionResponse -> Bool)
-> Eq RemoveRegionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveRegionResponse -> RemoveRegionResponse -> Bool
$c/= :: RemoveRegionResponse -> RemoveRegionResponse -> Bool
== :: RemoveRegionResponse -> RemoveRegionResponse -> Bool
$c== :: RemoveRegionResponse -> RemoveRegionResponse -> Bool
Prelude.Eq, ReadPrec [RemoveRegionResponse]
ReadPrec RemoveRegionResponse
Int -> ReadS RemoveRegionResponse
ReadS [RemoveRegionResponse]
(Int -> ReadS RemoveRegionResponse)
-> ReadS [RemoveRegionResponse]
-> ReadPrec RemoveRegionResponse
-> ReadPrec [RemoveRegionResponse]
-> Read RemoveRegionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveRegionResponse]
$creadListPrec :: ReadPrec [RemoveRegionResponse]
readPrec :: ReadPrec RemoveRegionResponse
$creadPrec :: ReadPrec RemoveRegionResponse
readList :: ReadS [RemoveRegionResponse]
$creadList :: ReadS [RemoveRegionResponse]
readsPrec :: Int -> ReadS RemoveRegionResponse
$creadsPrec :: Int -> ReadS RemoveRegionResponse
Prelude.Read, Int -> RemoveRegionResponse -> ShowS
[RemoveRegionResponse] -> ShowS
RemoveRegionResponse -> String
(Int -> RemoveRegionResponse -> ShowS)
-> (RemoveRegionResponse -> String)
-> ([RemoveRegionResponse] -> ShowS)
-> Show RemoveRegionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveRegionResponse] -> ShowS
$cshowList :: [RemoveRegionResponse] -> ShowS
show :: RemoveRegionResponse -> String
$cshow :: RemoveRegionResponse -> String
showsPrec :: Int -> RemoveRegionResponse -> ShowS
$cshowsPrec :: Int -> RemoveRegionResponse -> ShowS
Prelude.Show, (forall x. RemoveRegionResponse -> Rep RemoveRegionResponse x)
-> (forall x. Rep RemoveRegionResponse x -> RemoveRegionResponse)
-> Generic RemoveRegionResponse
forall x. Rep RemoveRegionResponse x -> RemoveRegionResponse
forall x. RemoveRegionResponse -> Rep RemoveRegionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoveRegionResponse x -> RemoveRegionResponse
$cfrom :: forall x. RemoveRegionResponse -> Rep RemoveRegionResponse x
Prelude.Generic)
newRemoveRegionResponse ::
Prelude.Int ->
RemoveRegionResponse
newRemoveRegionResponse :: Int -> RemoveRegionResponse
newRemoveRegionResponse Int
pHttpStatus_ =
RemoveRegionResponse' :: Int -> RemoveRegionResponse
RemoveRegionResponse' {$sel:httpStatus:RemoveRegionResponse' :: Int
httpStatus = Int
pHttpStatus_}
removeRegionResponse_httpStatus :: Lens.Lens' RemoveRegionResponse Prelude.Int
removeRegionResponse_httpStatus :: (Int -> f Int) -> RemoveRegionResponse -> f RemoveRegionResponse
removeRegionResponse_httpStatus = (RemoveRegionResponse -> Int)
-> (RemoveRegionResponse -> Int -> RemoveRegionResponse)
-> Lens RemoveRegionResponse RemoveRegionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveRegionResponse' {Int
httpStatus :: Int
$sel:httpStatus:RemoveRegionResponse' :: RemoveRegionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RemoveRegionResponse
s@RemoveRegionResponse' {} Int
a -> RemoveRegionResponse
s {$sel:httpStatus:RemoveRegionResponse' :: Int
httpStatus = Int
a} :: RemoveRegionResponse)
instance Prelude.NFData RemoveRegionResponse