{-# 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.RemoveResourcePermission
(
removeResourcePermission
, RemoveResourcePermission
, rrpPrincipalType
, rrpAuthenticationToken
, rrpResourceId
, rrpPrincipalId
, removeResourcePermissionResponse
, RemoveResourcePermissionResponse
) 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 RemoveResourcePermission = RemoveResourcePermission'
{ _rrpPrincipalType :: !(Maybe PrincipalType)
, _rrpAuthenticationToken :: !(Maybe (Sensitive Text))
, _rrpResourceId :: !Text
, _rrpPrincipalId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
removeResourcePermission
:: Text
-> Text
-> RemoveResourcePermission
removeResourcePermission pResourceId_ pPrincipalId_ =
RemoveResourcePermission'
{ _rrpPrincipalType = Nothing
, _rrpAuthenticationToken = Nothing
, _rrpResourceId = pResourceId_
, _rrpPrincipalId = pPrincipalId_
}
rrpPrincipalType :: Lens' RemoveResourcePermission (Maybe PrincipalType)
rrpPrincipalType = lens _rrpPrincipalType (\ s a -> s{_rrpPrincipalType = a})
rrpAuthenticationToken :: Lens' RemoveResourcePermission (Maybe Text)
rrpAuthenticationToken = lens _rrpAuthenticationToken (\ s a -> s{_rrpAuthenticationToken = a}) . mapping _Sensitive
rrpResourceId :: Lens' RemoveResourcePermission Text
rrpResourceId = lens _rrpResourceId (\ s a -> s{_rrpResourceId = a})
rrpPrincipalId :: Lens' RemoveResourcePermission Text
rrpPrincipalId = lens _rrpPrincipalId (\ s a -> s{_rrpPrincipalId = a})
instance AWSRequest RemoveResourcePermission where
type Rs RemoveResourcePermission =
RemoveResourcePermissionResponse
request = delete workDocs
response
= receiveNull RemoveResourcePermissionResponse'
instance Hashable RemoveResourcePermission where
instance NFData RemoveResourcePermission where
instance ToHeaders RemoveResourcePermission where
toHeaders RemoveResourcePermission'{..}
= mconcat
["Authentication" =# _rrpAuthenticationToken,
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)]
instance ToPath RemoveResourcePermission where
toPath RemoveResourcePermission'{..}
= mconcat
["/api/v1/resources/", toBS _rrpResourceId,
"/permissions/", toBS _rrpPrincipalId]
instance ToQuery RemoveResourcePermission where
toQuery RemoveResourcePermission'{..}
= mconcat ["type" =: _rrpPrincipalType]
data RemoveResourcePermissionResponse =
RemoveResourcePermissionResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
removeResourcePermissionResponse
:: RemoveResourcePermissionResponse
removeResourcePermissionResponse = RemoveResourcePermissionResponse'
instance NFData RemoveResourcePermissionResponse
where