{-# 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.WorkDocs.DeleteDocument
(
deleteDocument
, DeleteDocument
, ddAuthenticationToken
, ddDocumentId
, deleteDocumentResponse
, DeleteDocumentResponse
) 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 DeleteDocument = DeleteDocument'
{ _ddAuthenticationToken :: !(Maybe (Sensitive Text))
, _ddDocumentId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
deleteDocument
:: Text
-> DeleteDocument
deleteDocument pDocumentId_ =
DeleteDocument'
{_ddAuthenticationToken = Nothing, _ddDocumentId = pDocumentId_}
ddAuthenticationToken :: Lens' DeleteDocument (Maybe Text)
ddAuthenticationToken = lens _ddAuthenticationToken (\ s a -> s{_ddAuthenticationToken = a}) . mapping _Sensitive
ddDocumentId :: Lens' DeleteDocument Text
ddDocumentId = lens _ddDocumentId (\ s a -> s{_ddDocumentId = a})
instance AWSRequest DeleteDocument where
type Rs DeleteDocument = DeleteDocumentResponse
request = delete workDocs
response = receiveNull DeleteDocumentResponse'
instance Hashable DeleteDocument where
instance NFData DeleteDocument where
instance ToHeaders DeleteDocument where
toHeaders DeleteDocument'{..}
= mconcat
["Authentication" =# _ddAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToPath DeleteDocument where
toPath DeleteDocument'{..}
= mconcat ["/api/v1/documents/", toBS _ddDocumentId]
instance ToQuery DeleteDocument where
toQuery = const mempty
data DeleteDocumentResponse =
DeleteDocumentResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteDocumentResponse
:: DeleteDocumentResponse
deleteDocumentResponse = DeleteDocumentResponse'
instance NFData DeleteDocumentResponse where