{-# 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.DeleteLabels
(
deleteLabels
, DeleteLabels
, dlDeleteAll
, dlAuthenticationToken
, dlLabels
, dlResourceId
, deleteLabelsResponse
, DeleteLabelsResponse
, dlrsResponseStatus
) 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 DeleteLabels = DeleteLabels'
{ _dlDeleteAll :: !(Maybe Bool)
, _dlAuthenticationToken :: !(Maybe (Sensitive Text))
, _dlLabels :: !(Maybe [Text])
, _dlResourceId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
deleteLabels
:: Text
-> DeleteLabels
deleteLabels pResourceId_ =
DeleteLabels'
{ _dlDeleteAll = Nothing
, _dlAuthenticationToken = Nothing
, _dlLabels = Nothing
, _dlResourceId = pResourceId_
}
dlDeleteAll :: Lens' DeleteLabels (Maybe Bool)
dlDeleteAll = lens _dlDeleteAll (\ s a -> s{_dlDeleteAll = a})
dlAuthenticationToken :: Lens' DeleteLabels (Maybe Text)
dlAuthenticationToken = lens _dlAuthenticationToken (\ s a -> s{_dlAuthenticationToken = a}) . mapping _Sensitive
dlLabels :: Lens' DeleteLabels [Text]
dlLabels = lens _dlLabels (\ s a -> s{_dlLabels = a}) . _Default . _Coerce
dlResourceId :: Lens' DeleteLabels Text
dlResourceId = lens _dlResourceId (\ s a -> s{_dlResourceId = a})
instance AWSRequest DeleteLabels where
type Rs DeleteLabels = DeleteLabelsResponse
request = delete workDocs
response
= receiveEmpty
(\ s h x ->
DeleteLabelsResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteLabels where
instance NFData DeleteLabels where
instance ToHeaders DeleteLabels where
toHeaders DeleteLabels'{..}
= mconcat
["Authentication" =# _dlAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToPath DeleteLabels where
toPath DeleteLabels'{..}
= mconcat
["/api/v1/resources/", toBS _dlResourceId, "/labels"]
instance ToQuery DeleteLabels where
toQuery DeleteLabels'{..}
= mconcat
["deleteAll" =: _dlDeleteAll,
"labels" =:
toQuery (toQueryList "member" <$> _dlLabels)]
newtype DeleteLabelsResponse = DeleteLabelsResponse'
{ _dlrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteLabelsResponse
:: Int
-> DeleteLabelsResponse
deleteLabelsResponse pResponseStatus_ =
DeleteLabelsResponse' {_dlrsResponseStatus = pResponseStatus_}
dlrsResponseStatus :: Lens' DeleteLabelsResponse Int
dlrsResponseStatus = lens _dlrsResponseStatus (\ s a -> s{_dlrsResponseStatus = a})
instance NFData DeleteLabelsResponse where