{-# 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.CloudDirectory.DeleteObject
(
deleteObject
, DeleteObject
, doDirectoryARN
, doObjectReference
, deleteObjectResponse
, DeleteObjectResponse
, dorsResponseStatus
) where
import Network.AWS.CloudDirectory.Types
import Network.AWS.CloudDirectory.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DeleteObject = DeleteObject'
{ _doDirectoryARN :: !Text
, _doObjectReference :: !ObjectReference
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteObject
:: Text
-> ObjectReference
-> DeleteObject
deleteObject pDirectoryARN_ pObjectReference_ =
DeleteObject'
{_doDirectoryARN = pDirectoryARN_, _doObjectReference = pObjectReference_}
doDirectoryARN :: Lens' DeleteObject Text
doDirectoryARN = lens _doDirectoryARN (\ s a -> s{_doDirectoryARN = a})
doObjectReference :: Lens' DeleteObject ObjectReference
doObjectReference = lens _doObjectReference (\ s a -> s{_doObjectReference = a})
instance AWSRequest DeleteObject where
type Rs DeleteObject = DeleteObjectResponse
request = putJSON cloudDirectory
response
= receiveEmpty
(\ s h x ->
DeleteObjectResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteObject where
instance NFData DeleteObject where
instance ToHeaders DeleteObject where
toHeaders DeleteObject'{..}
= mconcat ["x-amz-data-partition" =# _doDirectoryARN]
instance ToJSON DeleteObject where
toJSON DeleteObject'{..}
= object
(catMaybes
[Just ("ObjectReference" .= _doObjectReference)])
instance ToPath DeleteObject where
toPath
= const
"/amazonclouddirectory/2017-01-11/object/delete"
instance ToQuery DeleteObject where
toQuery = const mempty
newtype DeleteObjectResponse = DeleteObjectResponse'
{ _dorsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteObjectResponse
:: Int
-> DeleteObjectResponse
deleteObjectResponse pResponseStatus_ =
DeleteObjectResponse' {_dorsResponseStatus = pResponseStatus_}
dorsResponseStatus :: Lens' DeleteObjectResponse Int
dorsResponseStatus = lens _dorsResponseStatus (\ s a -> s{_dorsResponseStatus = a})
instance NFData DeleteObjectResponse where