{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.AppStream.DeleteImage
(
deleteImage
, DeleteImage
, diName
, deleteImageResponse
, DeleteImageResponse
, dirsImage
, dirsResponseStatus
) where
import Network.AWS.AppStream.Types
import Network.AWS.AppStream.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteImage = DeleteImage'
{ _diName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteImage
:: Text
-> DeleteImage
deleteImage pName_ = DeleteImage' {_diName = pName_}
diName :: Lens' DeleteImage Text
diName = lens _diName (\ s a -> s{_diName = a})
instance AWSRequest DeleteImage where
type Rs DeleteImage = DeleteImageResponse
request = postJSON appStream
response
= receiveJSON
(\ s h x ->
DeleteImageResponse' <$>
(x .?> "Image") <*> (pure (fromEnum s)))
instance Hashable DeleteImage where
instance NFData DeleteImage where
instance ToHeaders DeleteImage where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("PhotonAdminProxyService.DeleteImage" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteImage where
toJSON DeleteImage'{..}
= object (catMaybes [Just ("Name" .= _diName)])
instance ToPath DeleteImage where
toPath = const "/"
instance ToQuery DeleteImage where
toQuery = const mempty
data DeleteImageResponse = DeleteImageResponse'
{ _dirsImage :: !(Maybe Image)
, _dirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteImageResponse
:: Int
-> DeleteImageResponse
deleteImageResponse pResponseStatus_ =
DeleteImageResponse'
{_dirsImage = Nothing, _dirsResponseStatus = pResponseStatus_}
dirsImage :: Lens' DeleteImageResponse (Maybe Image)
dirsImage = lens _dirsImage (\ s a -> s{_dirsImage = a})
dirsResponseStatus :: Lens' DeleteImageResponse Int
dirsResponseStatus = lens _dirsResponseStatus (\ s a -> s{_dirsResponseStatus = a})
instance NFData DeleteImageResponse where