module Network.AWS.WorkDocs.UpdateFolder
(
updateFolder
, UpdateFolder
, ufParentFolderId
, ufAuthenticationToken
, ufName
, ufResourceState
, ufFolderId
, updateFolderResponse
, UpdateFolderResponse
) 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 UpdateFolder = UpdateFolder'
{ _ufParentFolderId :: !(Maybe Text)
, _ufAuthenticationToken :: !(Maybe (Sensitive Text))
, _ufName :: !(Maybe Text)
, _ufResourceState :: !(Maybe ResourceStateType)
, _ufFolderId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
updateFolder
:: Text
-> UpdateFolder
updateFolder pFolderId_ =
UpdateFolder'
{ _ufParentFolderId = Nothing
, _ufAuthenticationToken = Nothing
, _ufName = Nothing
, _ufResourceState = Nothing
, _ufFolderId = pFolderId_
}
ufParentFolderId :: Lens' UpdateFolder (Maybe Text)
ufParentFolderId = lens _ufParentFolderId (\ s a -> s{_ufParentFolderId = a});
ufAuthenticationToken :: Lens' UpdateFolder (Maybe Text)
ufAuthenticationToken = lens _ufAuthenticationToken (\ s a -> s{_ufAuthenticationToken = a}) . mapping _Sensitive;
ufName :: Lens' UpdateFolder (Maybe Text)
ufName = lens _ufName (\ s a -> s{_ufName = a});
ufResourceState :: Lens' UpdateFolder (Maybe ResourceStateType)
ufResourceState = lens _ufResourceState (\ s a -> s{_ufResourceState = a});
ufFolderId :: Lens' UpdateFolder Text
ufFolderId = lens _ufFolderId (\ s a -> s{_ufFolderId = a});
instance AWSRequest UpdateFolder where
type Rs UpdateFolder = UpdateFolderResponse
request = patchJSON workDocs
response = receiveNull UpdateFolderResponse'
instance Hashable UpdateFolder where
instance NFData UpdateFolder where
instance ToHeaders UpdateFolder where
toHeaders UpdateFolder'{..}
= mconcat
["Authentication" =# _ufAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToJSON UpdateFolder where
toJSON UpdateFolder'{..}
= object
(catMaybes
[("ParentFolderId" .=) <$> _ufParentFolderId,
("Name" .=) <$> _ufName,
("ResourceState" .=) <$> _ufResourceState])
instance ToPath UpdateFolder where
toPath UpdateFolder'{..}
= mconcat ["/api/v1/folders/", toBS _ufFolderId]
instance ToQuery UpdateFolder where
toQuery = const mempty
data UpdateFolderResponse =
UpdateFolderResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
updateFolderResponse
:: UpdateFolderResponse
updateFolderResponse = UpdateFolderResponse'
instance NFData UpdateFolderResponse where