{-# 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.WorkSpaces.DeregisterWorkspaceDirectory
(
DeregisterWorkspaceDirectory (..),
newDeregisterWorkspaceDirectory,
deregisterWorkspaceDirectory_directoryId,
DeregisterWorkspaceDirectoryResponse (..),
newDeregisterWorkspaceDirectoryResponse,
deregisterWorkspaceDirectoryResponse_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.WorkSpaces.Types
data DeregisterWorkspaceDirectory = DeregisterWorkspaceDirectory'
{
DeregisterWorkspaceDirectory -> Text
directoryId :: Prelude.Text
}
deriving (DeregisterWorkspaceDirectory
-> DeregisterWorkspaceDirectory -> Bool
(DeregisterWorkspaceDirectory
-> DeregisterWorkspaceDirectory -> Bool)
-> (DeregisterWorkspaceDirectory
-> DeregisterWorkspaceDirectory -> Bool)
-> Eq DeregisterWorkspaceDirectory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterWorkspaceDirectory
-> DeregisterWorkspaceDirectory -> Bool
$c/= :: DeregisterWorkspaceDirectory
-> DeregisterWorkspaceDirectory -> Bool
== :: DeregisterWorkspaceDirectory
-> DeregisterWorkspaceDirectory -> Bool
$c== :: DeregisterWorkspaceDirectory
-> DeregisterWorkspaceDirectory -> Bool
Prelude.Eq, ReadPrec [DeregisterWorkspaceDirectory]
ReadPrec DeregisterWorkspaceDirectory
Int -> ReadS DeregisterWorkspaceDirectory
ReadS [DeregisterWorkspaceDirectory]
(Int -> ReadS DeregisterWorkspaceDirectory)
-> ReadS [DeregisterWorkspaceDirectory]
-> ReadPrec DeregisterWorkspaceDirectory
-> ReadPrec [DeregisterWorkspaceDirectory]
-> Read DeregisterWorkspaceDirectory
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterWorkspaceDirectory]
$creadListPrec :: ReadPrec [DeregisterWorkspaceDirectory]
readPrec :: ReadPrec DeregisterWorkspaceDirectory
$creadPrec :: ReadPrec DeregisterWorkspaceDirectory
readList :: ReadS [DeregisterWorkspaceDirectory]
$creadList :: ReadS [DeregisterWorkspaceDirectory]
readsPrec :: Int -> ReadS DeregisterWorkspaceDirectory
$creadsPrec :: Int -> ReadS DeregisterWorkspaceDirectory
Prelude.Read, Int -> DeregisterWorkspaceDirectory -> ShowS
[DeregisterWorkspaceDirectory] -> ShowS
DeregisterWorkspaceDirectory -> String
(Int -> DeregisterWorkspaceDirectory -> ShowS)
-> (DeregisterWorkspaceDirectory -> String)
-> ([DeregisterWorkspaceDirectory] -> ShowS)
-> Show DeregisterWorkspaceDirectory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterWorkspaceDirectory] -> ShowS
$cshowList :: [DeregisterWorkspaceDirectory] -> ShowS
show :: DeregisterWorkspaceDirectory -> String
$cshow :: DeregisterWorkspaceDirectory -> String
showsPrec :: Int -> DeregisterWorkspaceDirectory -> ShowS
$cshowsPrec :: Int -> DeregisterWorkspaceDirectory -> ShowS
Prelude.Show, (forall x.
DeregisterWorkspaceDirectory -> Rep DeregisterWorkspaceDirectory x)
-> (forall x.
Rep DeregisterWorkspaceDirectory x -> DeregisterWorkspaceDirectory)
-> Generic DeregisterWorkspaceDirectory
forall x.
Rep DeregisterWorkspaceDirectory x -> DeregisterWorkspaceDirectory
forall x.
DeregisterWorkspaceDirectory -> Rep DeregisterWorkspaceDirectory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterWorkspaceDirectory x -> DeregisterWorkspaceDirectory
$cfrom :: forall x.
DeregisterWorkspaceDirectory -> Rep DeregisterWorkspaceDirectory x
Prelude.Generic)
newDeregisterWorkspaceDirectory ::
Prelude.Text ->
DeregisterWorkspaceDirectory
newDeregisterWorkspaceDirectory :: Text -> DeregisterWorkspaceDirectory
newDeregisterWorkspaceDirectory Text
pDirectoryId_ =
DeregisterWorkspaceDirectory' :: Text -> DeregisterWorkspaceDirectory
DeregisterWorkspaceDirectory'
{ $sel:directoryId:DeregisterWorkspaceDirectory' :: Text
directoryId =
Text
pDirectoryId_
}
deregisterWorkspaceDirectory_directoryId :: Lens.Lens' DeregisterWorkspaceDirectory Prelude.Text
deregisterWorkspaceDirectory_directoryId :: (Text -> f Text)
-> DeregisterWorkspaceDirectory -> f DeregisterWorkspaceDirectory
deregisterWorkspaceDirectory_directoryId = (DeregisterWorkspaceDirectory -> Text)
-> (DeregisterWorkspaceDirectory
-> Text -> DeregisterWorkspaceDirectory)
-> Lens
DeregisterWorkspaceDirectory DeregisterWorkspaceDirectory Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterWorkspaceDirectory' {Text
directoryId :: Text
$sel:directoryId:DeregisterWorkspaceDirectory' :: DeregisterWorkspaceDirectory -> Text
directoryId} -> Text
directoryId) (\s :: DeregisterWorkspaceDirectory
s@DeregisterWorkspaceDirectory' {} Text
a -> DeregisterWorkspaceDirectory
s {$sel:directoryId:DeregisterWorkspaceDirectory' :: Text
directoryId = Text
a} :: DeregisterWorkspaceDirectory)
instance Core.AWSRequest DeregisterWorkspaceDirectory where
type
AWSResponse DeregisterWorkspaceDirectory =
DeregisterWorkspaceDirectoryResponse
request :: DeregisterWorkspaceDirectory
-> Request DeregisterWorkspaceDirectory
request = Service
-> DeregisterWorkspaceDirectory
-> Request DeregisterWorkspaceDirectory
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeregisterWorkspaceDirectory
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterWorkspaceDirectory)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeregisterWorkspaceDirectory))
-> Logger
-> Service
-> Proxy DeregisterWorkspaceDirectory
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeregisterWorkspaceDirectory)))
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 -> DeregisterWorkspaceDirectoryResponse
DeregisterWorkspaceDirectoryResponse'
(Int -> DeregisterWorkspaceDirectoryResponse)
-> Either String Int
-> Either String DeregisterWorkspaceDirectoryResponse
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
DeregisterWorkspaceDirectory
instance Prelude.NFData DeregisterWorkspaceDirectory
instance Core.ToHeaders DeregisterWorkspaceDirectory where
toHeaders :: DeregisterWorkspaceDirectory -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeregisterWorkspaceDirectory -> 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
"WorkspacesService.DeregisterWorkspaceDirectory" ::
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 DeregisterWorkspaceDirectory where
toJSON :: DeregisterWorkspaceDirectory -> Value
toJSON DeregisterWorkspaceDirectory' {Text
directoryId :: Text
$sel:directoryId:DeregisterWorkspaceDirectory' :: DeregisterWorkspaceDirectory -> 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 DeregisterWorkspaceDirectory where
toPath :: DeregisterWorkspaceDirectory -> ByteString
toPath = ByteString -> DeregisterWorkspaceDirectory -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeregisterWorkspaceDirectory where
toQuery :: DeregisterWorkspaceDirectory -> QueryString
toQuery = QueryString -> DeregisterWorkspaceDirectory -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeregisterWorkspaceDirectoryResponse = DeregisterWorkspaceDirectoryResponse'
{
DeregisterWorkspaceDirectoryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeregisterWorkspaceDirectoryResponse
-> DeregisterWorkspaceDirectoryResponse -> Bool
(DeregisterWorkspaceDirectoryResponse
-> DeregisterWorkspaceDirectoryResponse -> Bool)
-> (DeregisterWorkspaceDirectoryResponse
-> DeregisterWorkspaceDirectoryResponse -> Bool)
-> Eq DeregisterWorkspaceDirectoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeregisterWorkspaceDirectoryResponse
-> DeregisterWorkspaceDirectoryResponse -> Bool
$c/= :: DeregisterWorkspaceDirectoryResponse
-> DeregisterWorkspaceDirectoryResponse -> Bool
== :: DeregisterWorkspaceDirectoryResponse
-> DeregisterWorkspaceDirectoryResponse -> Bool
$c== :: DeregisterWorkspaceDirectoryResponse
-> DeregisterWorkspaceDirectoryResponse -> Bool
Prelude.Eq, ReadPrec [DeregisterWorkspaceDirectoryResponse]
ReadPrec DeregisterWorkspaceDirectoryResponse
Int -> ReadS DeregisterWorkspaceDirectoryResponse
ReadS [DeregisterWorkspaceDirectoryResponse]
(Int -> ReadS DeregisterWorkspaceDirectoryResponse)
-> ReadS [DeregisterWorkspaceDirectoryResponse]
-> ReadPrec DeregisterWorkspaceDirectoryResponse
-> ReadPrec [DeregisterWorkspaceDirectoryResponse]
-> Read DeregisterWorkspaceDirectoryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeregisterWorkspaceDirectoryResponse]
$creadListPrec :: ReadPrec [DeregisterWorkspaceDirectoryResponse]
readPrec :: ReadPrec DeregisterWorkspaceDirectoryResponse
$creadPrec :: ReadPrec DeregisterWorkspaceDirectoryResponse
readList :: ReadS [DeregisterWorkspaceDirectoryResponse]
$creadList :: ReadS [DeregisterWorkspaceDirectoryResponse]
readsPrec :: Int -> ReadS DeregisterWorkspaceDirectoryResponse
$creadsPrec :: Int -> ReadS DeregisterWorkspaceDirectoryResponse
Prelude.Read, Int -> DeregisterWorkspaceDirectoryResponse -> ShowS
[DeregisterWorkspaceDirectoryResponse] -> ShowS
DeregisterWorkspaceDirectoryResponse -> String
(Int -> DeregisterWorkspaceDirectoryResponse -> ShowS)
-> (DeregisterWorkspaceDirectoryResponse -> String)
-> ([DeregisterWorkspaceDirectoryResponse] -> ShowS)
-> Show DeregisterWorkspaceDirectoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeregisterWorkspaceDirectoryResponse] -> ShowS
$cshowList :: [DeregisterWorkspaceDirectoryResponse] -> ShowS
show :: DeregisterWorkspaceDirectoryResponse -> String
$cshow :: DeregisterWorkspaceDirectoryResponse -> String
showsPrec :: Int -> DeregisterWorkspaceDirectoryResponse -> ShowS
$cshowsPrec :: Int -> DeregisterWorkspaceDirectoryResponse -> ShowS
Prelude.Show, (forall x.
DeregisterWorkspaceDirectoryResponse
-> Rep DeregisterWorkspaceDirectoryResponse x)
-> (forall x.
Rep DeregisterWorkspaceDirectoryResponse x
-> DeregisterWorkspaceDirectoryResponse)
-> Generic DeregisterWorkspaceDirectoryResponse
forall x.
Rep DeregisterWorkspaceDirectoryResponse x
-> DeregisterWorkspaceDirectoryResponse
forall x.
DeregisterWorkspaceDirectoryResponse
-> Rep DeregisterWorkspaceDirectoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeregisterWorkspaceDirectoryResponse x
-> DeregisterWorkspaceDirectoryResponse
$cfrom :: forall x.
DeregisterWorkspaceDirectoryResponse
-> Rep DeregisterWorkspaceDirectoryResponse x
Prelude.Generic)
newDeregisterWorkspaceDirectoryResponse ::
Prelude.Int ->
DeregisterWorkspaceDirectoryResponse
newDeregisterWorkspaceDirectoryResponse :: Int -> DeregisterWorkspaceDirectoryResponse
newDeregisterWorkspaceDirectoryResponse Int
pHttpStatus_ =
DeregisterWorkspaceDirectoryResponse' :: Int -> DeregisterWorkspaceDirectoryResponse
DeregisterWorkspaceDirectoryResponse'
{ $sel:httpStatus:DeregisterWorkspaceDirectoryResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deregisterWorkspaceDirectoryResponse_httpStatus :: Lens.Lens' DeregisterWorkspaceDirectoryResponse Prelude.Int
deregisterWorkspaceDirectoryResponse_httpStatus :: (Int -> f Int)
-> DeregisterWorkspaceDirectoryResponse
-> f DeregisterWorkspaceDirectoryResponse
deregisterWorkspaceDirectoryResponse_httpStatus = (DeregisterWorkspaceDirectoryResponse -> Int)
-> (DeregisterWorkspaceDirectoryResponse
-> Int -> DeregisterWorkspaceDirectoryResponse)
-> Lens
DeregisterWorkspaceDirectoryResponse
DeregisterWorkspaceDirectoryResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeregisterWorkspaceDirectoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeregisterWorkspaceDirectoryResponse' :: DeregisterWorkspaceDirectoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeregisterWorkspaceDirectoryResponse
s@DeregisterWorkspaceDirectoryResponse' {} Int
a -> DeregisterWorkspaceDirectoryResponse
s {$sel:httpStatus:DeregisterWorkspaceDirectoryResponse' :: Int
httpStatus = Int
a} :: DeregisterWorkspaceDirectoryResponse)
instance
Prelude.NFData
DeregisterWorkspaceDirectoryResponse