{-# 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.RejectSharedDirectory
(
RejectSharedDirectory (..),
newRejectSharedDirectory,
rejectSharedDirectory_sharedDirectoryId,
RejectSharedDirectoryResponse (..),
newRejectSharedDirectoryResponse,
rejectSharedDirectoryResponse_sharedDirectoryId,
rejectSharedDirectoryResponse_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 RejectSharedDirectory = RejectSharedDirectory'
{
RejectSharedDirectory -> Text
sharedDirectoryId :: Prelude.Text
}
deriving (RejectSharedDirectory -> RejectSharedDirectory -> Bool
(RejectSharedDirectory -> RejectSharedDirectory -> Bool)
-> (RejectSharedDirectory -> RejectSharedDirectory -> Bool)
-> Eq RejectSharedDirectory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectSharedDirectory -> RejectSharedDirectory -> Bool
$c/= :: RejectSharedDirectory -> RejectSharedDirectory -> Bool
== :: RejectSharedDirectory -> RejectSharedDirectory -> Bool
$c== :: RejectSharedDirectory -> RejectSharedDirectory -> Bool
Prelude.Eq, ReadPrec [RejectSharedDirectory]
ReadPrec RejectSharedDirectory
Int -> ReadS RejectSharedDirectory
ReadS [RejectSharedDirectory]
(Int -> ReadS RejectSharedDirectory)
-> ReadS [RejectSharedDirectory]
-> ReadPrec RejectSharedDirectory
-> ReadPrec [RejectSharedDirectory]
-> Read RejectSharedDirectory
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectSharedDirectory]
$creadListPrec :: ReadPrec [RejectSharedDirectory]
readPrec :: ReadPrec RejectSharedDirectory
$creadPrec :: ReadPrec RejectSharedDirectory
readList :: ReadS [RejectSharedDirectory]
$creadList :: ReadS [RejectSharedDirectory]
readsPrec :: Int -> ReadS RejectSharedDirectory
$creadsPrec :: Int -> ReadS RejectSharedDirectory
Prelude.Read, Int -> RejectSharedDirectory -> ShowS
[RejectSharedDirectory] -> ShowS
RejectSharedDirectory -> String
(Int -> RejectSharedDirectory -> ShowS)
-> (RejectSharedDirectory -> String)
-> ([RejectSharedDirectory] -> ShowS)
-> Show RejectSharedDirectory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectSharedDirectory] -> ShowS
$cshowList :: [RejectSharedDirectory] -> ShowS
show :: RejectSharedDirectory -> String
$cshow :: RejectSharedDirectory -> String
showsPrec :: Int -> RejectSharedDirectory -> ShowS
$cshowsPrec :: Int -> RejectSharedDirectory -> ShowS
Prelude.Show, (forall x. RejectSharedDirectory -> Rep RejectSharedDirectory x)
-> (forall x. Rep RejectSharedDirectory x -> RejectSharedDirectory)
-> Generic RejectSharedDirectory
forall x. Rep RejectSharedDirectory x -> RejectSharedDirectory
forall x. RejectSharedDirectory -> Rep RejectSharedDirectory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RejectSharedDirectory x -> RejectSharedDirectory
$cfrom :: forall x. RejectSharedDirectory -> Rep RejectSharedDirectory x
Prelude.Generic)
newRejectSharedDirectory ::
Prelude.Text ->
RejectSharedDirectory
newRejectSharedDirectory :: Text -> RejectSharedDirectory
newRejectSharedDirectory Text
pSharedDirectoryId_ =
RejectSharedDirectory' :: Text -> RejectSharedDirectory
RejectSharedDirectory'
{ $sel:sharedDirectoryId:RejectSharedDirectory' :: Text
sharedDirectoryId =
Text
pSharedDirectoryId_
}
rejectSharedDirectory_sharedDirectoryId :: Lens.Lens' RejectSharedDirectory Prelude.Text
rejectSharedDirectory_sharedDirectoryId :: (Text -> f Text)
-> RejectSharedDirectory -> f RejectSharedDirectory
rejectSharedDirectory_sharedDirectoryId = (RejectSharedDirectory -> Text)
-> (RejectSharedDirectory -> Text -> RejectSharedDirectory)
-> Lens RejectSharedDirectory RejectSharedDirectory Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectSharedDirectory' {Text
sharedDirectoryId :: Text
$sel:sharedDirectoryId:RejectSharedDirectory' :: RejectSharedDirectory -> Text
sharedDirectoryId} -> Text
sharedDirectoryId) (\s :: RejectSharedDirectory
s@RejectSharedDirectory' {} Text
a -> RejectSharedDirectory
s {$sel:sharedDirectoryId:RejectSharedDirectory' :: Text
sharedDirectoryId = Text
a} :: RejectSharedDirectory)
instance Core.AWSRequest RejectSharedDirectory where
type
AWSResponse RejectSharedDirectory =
RejectSharedDirectoryResponse
request :: RejectSharedDirectory -> Request RejectSharedDirectory
request = Service -> RejectSharedDirectory -> Request RejectSharedDirectory
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RejectSharedDirectory
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RejectSharedDirectory)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RejectSharedDirectory))
-> Logger
-> Service
-> Proxy RejectSharedDirectory
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RejectSharedDirectory)))
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 -> RejectSharedDirectoryResponse
RejectSharedDirectoryResponse'
(Maybe Text -> Int -> RejectSharedDirectoryResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RejectSharedDirectoryResponse)
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
"SharedDirectoryId")
Either String (Int -> RejectSharedDirectoryResponse)
-> Either String Int -> Either String RejectSharedDirectoryResponse
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 RejectSharedDirectory
instance Prelude.NFData RejectSharedDirectory
instance Core.ToHeaders RejectSharedDirectory where
toHeaders :: RejectSharedDirectory -> ResponseHeaders
toHeaders =
ResponseHeaders -> RejectSharedDirectory -> 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.RejectSharedDirectory" ::
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 RejectSharedDirectory where
toJSON :: RejectSharedDirectory -> Value
toJSON RejectSharedDirectory' {Text
sharedDirectoryId :: Text
$sel:sharedDirectoryId:RejectSharedDirectory' :: RejectSharedDirectory -> 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
"SharedDirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sharedDirectoryId)
]
)
instance Core.ToPath RejectSharedDirectory where
toPath :: RejectSharedDirectory -> ByteString
toPath = ByteString -> RejectSharedDirectory -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RejectSharedDirectory where
toQuery :: RejectSharedDirectory -> QueryString
toQuery = QueryString -> RejectSharedDirectory -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RejectSharedDirectoryResponse = RejectSharedDirectoryResponse'
{
RejectSharedDirectoryResponse -> Maybe Text
sharedDirectoryId :: Prelude.Maybe Prelude.Text,
RejectSharedDirectoryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RejectSharedDirectoryResponse
-> RejectSharedDirectoryResponse -> Bool
(RejectSharedDirectoryResponse
-> RejectSharedDirectoryResponse -> Bool)
-> (RejectSharedDirectoryResponse
-> RejectSharedDirectoryResponse -> Bool)
-> Eq RejectSharedDirectoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectSharedDirectoryResponse
-> RejectSharedDirectoryResponse -> Bool
$c/= :: RejectSharedDirectoryResponse
-> RejectSharedDirectoryResponse -> Bool
== :: RejectSharedDirectoryResponse
-> RejectSharedDirectoryResponse -> Bool
$c== :: RejectSharedDirectoryResponse
-> RejectSharedDirectoryResponse -> Bool
Prelude.Eq, ReadPrec [RejectSharedDirectoryResponse]
ReadPrec RejectSharedDirectoryResponse
Int -> ReadS RejectSharedDirectoryResponse
ReadS [RejectSharedDirectoryResponse]
(Int -> ReadS RejectSharedDirectoryResponse)
-> ReadS [RejectSharedDirectoryResponse]
-> ReadPrec RejectSharedDirectoryResponse
-> ReadPrec [RejectSharedDirectoryResponse]
-> Read RejectSharedDirectoryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectSharedDirectoryResponse]
$creadListPrec :: ReadPrec [RejectSharedDirectoryResponse]
readPrec :: ReadPrec RejectSharedDirectoryResponse
$creadPrec :: ReadPrec RejectSharedDirectoryResponse
readList :: ReadS [RejectSharedDirectoryResponse]
$creadList :: ReadS [RejectSharedDirectoryResponse]
readsPrec :: Int -> ReadS RejectSharedDirectoryResponse
$creadsPrec :: Int -> ReadS RejectSharedDirectoryResponse
Prelude.Read, Int -> RejectSharedDirectoryResponse -> ShowS
[RejectSharedDirectoryResponse] -> ShowS
RejectSharedDirectoryResponse -> String
(Int -> RejectSharedDirectoryResponse -> ShowS)
-> (RejectSharedDirectoryResponse -> String)
-> ([RejectSharedDirectoryResponse] -> ShowS)
-> Show RejectSharedDirectoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectSharedDirectoryResponse] -> ShowS
$cshowList :: [RejectSharedDirectoryResponse] -> ShowS
show :: RejectSharedDirectoryResponse -> String
$cshow :: RejectSharedDirectoryResponse -> String
showsPrec :: Int -> RejectSharedDirectoryResponse -> ShowS
$cshowsPrec :: Int -> RejectSharedDirectoryResponse -> ShowS
Prelude.Show, (forall x.
RejectSharedDirectoryResponse
-> Rep RejectSharedDirectoryResponse x)
-> (forall x.
Rep RejectSharedDirectoryResponse x
-> RejectSharedDirectoryResponse)
-> Generic RejectSharedDirectoryResponse
forall x.
Rep RejectSharedDirectoryResponse x
-> RejectSharedDirectoryResponse
forall x.
RejectSharedDirectoryResponse
-> Rep RejectSharedDirectoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RejectSharedDirectoryResponse x
-> RejectSharedDirectoryResponse
$cfrom :: forall x.
RejectSharedDirectoryResponse
-> Rep RejectSharedDirectoryResponse x
Prelude.Generic)
newRejectSharedDirectoryResponse ::
Prelude.Int ->
RejectSharedDirectoryResponse
newRejectSharedDirectoryResponse :: Int -> RejectSharedDirectoryResponse
newRejectSharedDirectoryResponse Int
pHttpStatus_ =
RejectSharedDirectoryResponse' :: Maybe Text -> Int -> RejectSharedDirectoryResponse
RejectSharedDirectoryResponse'
{ $sel:sharedDirectoryId:RejectSharedDirectoryResponse' :: Maybe Text
sharedDirectoryId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RejectSharedDirectoryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
rejectSharedDirectoryResponse_sharedDirectoryId :: Lens.Lens' RejectSharedDirectoryResponse (Prelude.Maybe Prelude.Text)
rejectSharedDirectoryResponse_sharedDirectoryId :: (Maybe Text -> f (Maybe Text))
-> RejectSharedDirectoryResponse -> f RejectSharedDirectoryResponse
rejectSharedDirectoryResponse_sharedDirectoryId = (RejectSharedDirectoryResponse -> Maybe Text)
-> (RejectSharedDirectoryResponse
-> Maybe Text -> RejectSharedDirectoryResponse)
-> Lens
RejectSharedDirectoryResponse
RejectSharedDirectoryResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectSharedDirectoryResponse' {Maybe Text
sharedDirectoryId :: Maybe Text
$sel:sharedDirectoryId:RejectSharedDirectoryResponse' :: RejectSharedDirectoryResponse -> Maybe Text
sharedDirectoryId} -> Maybe Text
sharedDirectoryId) (\s :: RejectSharedDirectoryResponse
s@RejectSharedDirectoryResponse' {} Maybe Text
a -> RejectSharedDirectoryResponse
s {$sel:sharedDirectoryId:RejectSharedDirectoryResponse' :: Maybe Text
sharedDirectoryId = Maybe Text
a} :: RejectSharedDirectoryResponse)
rejectSharedDirectoryResponse_httpStatus :: Lens.Lens' RejectSharedDirectoryResponse Prelude.Int
rejectSharedDirectoryResponse_httpStatus :: (Int -> f Int)
-> RejectSharedDirectoryResponse -> f RejectSharedDirectoryResponse
rejectSharedDirectoryResponse_httpStatus = (RejectSharedDirectoryResponse -> Int)
-> (RejectSharedDirectoryResponse
-> Int -> RejectSharedDirectoryResponse)
-> Lens
RejectSharedDirectoryResponse RejectSharedDirectoryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectSharedDirectoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:RejectSharedDirectoryResponse' :: RejectSharedDirectoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RejectSharedDirectoryResponse
s@RejectSharedDirectoryResponse' {} Int
a -> RejectSharedDirectoryResponse
s {$sel:httpStatus:RejectSharedDirectoryResponse' :: Int
httpStatus = Int
a} :: RejectSharedDirectoryResponse)
instance Prelude.NFData RejectSharedDirectoryResponse