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