{-# 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.MediaStore.DeleteContainer
(
deleteContainer
, DeleteContainer
, dcContainerName
, deleteContainerResponse
, DeleteContainerResponse
, dcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MediaStore.Types
import Network.AWS.MediaStore.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteContainer = DeleteContainer'
{ _dcContainerName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteContainer
:: Text
-> DeleteContainer
deleteContainer pContainerName_ =
DeleteContainer' {_dcContainerName = pContainerName_}
dcContainerName :: Lens' DeleteContainer Text
dcContainerName = lens _dcContainerName (\ s a -> s{_dcContainerName = a})
instance AWSRequest DeleteContainer where
type Rs DeleteContainer = DeleteContainerResponse
request = postJSON mediaStore
response
= receiveEmpty
(\ s h x ->
DeleteContainerResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteContainer where
instance NFData DeleteContainer where
instance ToHeaders DeleteContainer where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("MediaStore_20170901.DeleteContainer" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteContainer where
toJSON DeleteContainer'{..}
= object
(catMaybes
[Just ("ContainerName" .= _dcContainerName)])
instance ToPath DeleteContainer where
toPath = const "/"
instance ToQuery DeleteContainer where
toQuery = const mempty
newtype DeleteContainerResponse = DeleteContainerResponse'
{ _dcrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteContainerResponse
:: Int
-> DeleteContainerResponse
deleteContainerResponse pResponseStatus_ =
DeleteContainerResponse' {_dcrsResponseStatus = pResponseStatus_}
dcrsResponseStatus :: Lens' DeleteContainerResponse Int
dcrsResponseStatus = lens _dcrsResponseStatus (\ s a -> s{_dcrsResponseStatus = a})
instance NFData DeleteContainerResponse where