module Network.AWS.StorageGateway.DeleteChapCredentials
(
deleteChapCredentials
, DeleteChapCredentials
, dTargetARN
, dInitiatorName
, deleteChapCredentialsResponse
, DeleteChapCredentialsResponse
, drsTargetARN
, drsInitiatorName
, drsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.StorageGateway.Types
import Network.AWS.StorageGateway.Types.Product
data DeleteChapCredentials = DeleteChapCredentials'
{ _dTargetARN :: !Text
, _dInitiatorName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteChapCredentials
:: Text
-> Text
-> DeleteChapCredentials
deleteChapCredentials pTargetARN_ pInitiatorName_ =
DeleteChapCredentials'
{ _dTargetARN = pTargetARN_
, _dInitiatorName = pInitiatorName_
}
dTargetARN :: Lens' DeleteChapCredentials Text
dTargetARN = lens _dTargetARN (\ s a -> s{_dTargetARN = a});
dInitiatorName :: Lens' DeleteChapCredentials Text
dInitiatorName = lens _dInitiatorName (\ s a -> s{_dInitiatorName = a});
instance AWSRequest DeleteChapCredentials where
type Rs DeleteChapCredentials =
DeleteChapCredentialsResponse
request = postJSON storageGateway
response
= receiveJSON
(\ s h x ->
DeleteChapCredentialsResponse' <$>
(x .?> "TargetARN") <*> (x .?> "InitiatorName") <*>
(pure (fromEnum s)))
instance ToHeaders DeleteChapCredentials where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StorageGateway_20130630.DeleteChapCredentials" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteChapCredentials where
toJSON DeleteChapCredentials'{..}
= object
(catMaybes
[Just ("TargetARN" .= _dTargetARN),
Just ("InitiatorName" .= _dInitiatorName)])
instance ToPath DeleteChapCredentials where
toPath = const "/"
instance ToQuery DeleteChapCredentials where
toQuery = const mempty
data DeleteChapCredentialsResponse = DeleteChapCredentialsResponse'
{ _drsTargetARN :: !(Maybe Text)
, _drsInitiatorName :: !(Maybe Text)
, _drsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteChapCredentialsResponse
:: Int
-> DeleteChapCredentialsResponse
deleteChapCredentialsResponse pResponseStatus_ =
DeleteChapCredentialsResponse'
{ _drsTargetARN = Nothing
, _drsInitiatorName = Nothing
, _drsResponseStatus = pResponseStatus_
}
drsTargetARN :: Lens' DeleteChapCredentialsResponse (Maybe Text)
drsTargetARN = lens _drsTargetARN (\ s a -> s{_drsTargetARN = a});
drsInitiatorName :: Lens' DeleteChapCredentialsResponse (Maybe Text)
drsInitiatorName = lens _drsInitiatorName (\ s a -> s{_drsInitiatorName = a});
drsResponseStatus :: Lens' DeleteChapCredentialsResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});