module Network.AWS.WorkDocs.DeleteCustomMetadata
(
deleteCustomMetadata
, DeleteCustomMetadata
, dcmVersionId
, dcmDeleteAll
, dcmAuthenticationToken
, dcmKeys
, dcmResourceId
, deleteCustomMetadataResponse
, DeleteCustomMetadataResponse
, dcmrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.WorkDocs.Types
import Network.AWS.WorkDocs.Types.Product
data DeleteCustomMetadata = DeleteCustomMetadata'
{ _dcmVersionId :: !(Maybe Text)
, _dcmDeleteAll :: !(Maybe Bool)
, _dcmAuthenticationToken :: !(Maybe (Sensitive Text))
, _dcmKeys :: !(Maybe [Text])
, _dcmResourceId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
deleteCustomMetadata
:: Text
-> DeleteCustomMetadata
deleteCustomMetadata pResourceId_ =
DeleteCustomMetadata'
{ _dcmVersionId = Nothing
, _dcmDeleteAll = Nothing
, _dcmAuthenticationToken = Nothing
, _dcmKeys = Nothing
, _dcmResourceId = pResourceId_
}
dcmVersionId :: Lens' DeleteCustomMetadata (Maybe Text)
dcmVersionId = lens _dcmVersionId (\ s a -> s{_dcmVersionId = a});
dcmDeleteAll :: Lens' DeleteCustomMetadata (Maybe Bool)
dcmDeleteAll = lens _dcmDeleteAll (\ s a -> s{_dcmDeleteAll = a});
dcmAuthenticationToken :: Lens' DeleteCustomMetadata (Maybe Text)
dcmAuthenticationToken = lens _dcmAuthenticationToken (\ s a -> s{_dcmAuthenticationToken = a}) . mapping _Sensitive;
dcmKeys :: Lens' DeleteCustomMetadata [Text]
dcmKeys = lens _dcmKeys (\ s a -> s{_dcmKeys = a}) . _Default . _Coerce;
dcmResourceId :: Lens' DeleteCustomMetadata Text
dcmResourceId = lens _dcmResourceId (\ s a -> s{_dcmResourceId = a});
instance AWSRequest DeleteCustomMetadata where
type Rs DeleteCustomMetadata =
DeleteCustomMetadataResponse
request = delete workDocs
response
= receiveEmpty
(\ s h x ->
DeleteCustomMetadataResponse' <$>
(pure (fromEnum s)))
instance Hashable DeleteCustomMetadata where
instance NFData DeleteCustomMetadata where
instance ToHeaders DeleteCustomMetadata where
toHeaders DeleteCustomMetadata'{..}
= mconcat
["Authentication" =# _dcmAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToPath DeleteCustomMetadata where
toPath DeleteCustomMetadata'{..}
= mconcat
["/api/v1/resources/", toBS _dcmResourceId,
"/customMetadata"]
instance ToQuery DeleteCustomMetadata where
toQuery DeleteCustomMetadata'{..}
= mconcat
["versionId" =: _dcmVersionId,
"deleteAll" =: _dcmDeleteAll,
"keys" =:
toQuery (toQueryList "member" <$> _dcmKeys)]
newtype DeleteCustomMetadataResponse = DeleteCustomMetadataResponse'
{ _dcmrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteCustomMetadataResponse
:: Int
-> DeleteCustomMetadataResponse
deleteCustomMetadataResponse pResponseStatus_ =
DeleteCustomMetadataResponse' {_dcmrsResponseStatus = pResponseStatus_}
dcmrsResponseStatus :: Lens' DeleteCustomMetadataResponse Int
dcmrsResponseStatus = lens _dcmrsResponseStatus (\ s a -> s{_dcmrsResponseStatus = a});
instance NFData DeleteCustomMetadataResponse where