module Network.AWS.WorkDocs.UpdateDocumentVersion
(
updateDocumentVersion
, UpdateDocumentVersion
, udvAuthenticationToken
, udvVersionStatus
, udvDocumentId
, udvVersionId
, updateDocumentVersionResponse
, UpdateDocumentVersionResponse
) 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 UpdateDocumentVersion = UpdateDocumentVersion'
{ _udvAuthenticationToken :: !(Maybe (Sensitive Text))
, _udvVersionStatus :: !(Maybe DocumentVersionStatus)
, _udvDocumentId :: !Text
, _udvVersionId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
updateDocumentVersion
:: Text
-> Text
-> UpdateDocumentVersion
updateDocumentVersion pDocumentId_ pVersionId_ =
UpdateDocumentVersion'
{ _udvAuthenticationToken = Nothing
, _udvVersionStatus = Nothing
, _udvDocumentId = pDocumentId_
, _udvVersionId = pVersionId_
}
udvAuthenticationToken :: Lens' UpdateDocumentVersion (Maybe Text)
udvAuthenticationToken = lens _udvAuthenticationToken (\ s a -> s{_udvAuthenticationToken = a}) . mapping _Sensitive;
udvVersionStatus :: Lens' UpdateDocumentVersion (Maybe DocumentVersionStatus)
udvVersionStatus = lens _udvVersionStatus (\ s a -> s{_udvVersionStatus = a});
udvDocumentId :: Lens' UpdateDocumentVersion Text
udvDocumentId = lens _udvDocumentId (\ s a -> s{_udvDocumentId = a});
udvVersionId :: Lens' UpdateDocumentVersion Text
udvVersionId = lens _udvVersionId (\ s a -> s{_udvVersionId = a});
instance AWSRequest UpdateDocumentVersion where
type Rs UpdateDocumentVersion =
UpdateDocumentVersionResponse
request = patchJSON workDocs
response = receiveNull UpdateDocumentVersionResponse'
instance Hashable UpdateDocumentVersion where
instance NFData UpdateDocumentVersion where
instance ToHeaders UpdateDocumentVersion where
toHeaders UpdateDocumentVersion'{..}
= mconcat
["Authentication" =# _udvAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToJSON UpdateDocumentVersion where
toJSON UpdateDocumentVersion'{..}
= object
(catMaybes
[("VersionStatus" .=) <$> _udvVersionStatus])
instance ToPath UpdateDocumentVersion where
toPath UpdateDocumentVersion'{..}
= mconcat
["/api/v1/documents/", toBS _udvDocumentId,
"/versions/", toBS _udvVersionId]
instance ToQuery UpdateDocumentVersion where
toQuery = const mempty
data UpdateDocumentVersionResponse =
UpdateDocumentVersionResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
updateDocumentVersionResponse
:: UpdateDocumentVersionResponse
updateDocumentVersionResponse = UpdateDocumentVersionResponse'
instance NFData UpdateDocumentVersionResponse where