module Network.Google.Resource.Drive.Permissions.Create
(
PermissionsCreateResource
, permissionsCreate
, PermissionsCreate
, pcSendNotificationEmail
, pcPayload
, pcEmailMessage
, pcTransferOwnership
, pcFileId
) where
import Network.Google.Drive.Types
import Network.Google.Prelude
type PermissionsCreateResource =
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"permissions" :>
QueryParam "sendNotificationEmail" Bool :>
QueryParam "emailMessage" Text :>
QueryParam "transferOwnership" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Permission :> Post '[JSON] Permission
data PermissionsCreate = PermissionsCreate'
{ _pcSendNotificationEmail :: !(Maybe Bool)
, _pcPayload :: !Permission
, _pcEmailMessage :: !(Maybe Text)
, _pcTransferOwnership :: !Bool
, _pcFileId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
permissionsCreate
:: Permission
-> Text
-> PermissionsCreate
permissionsCreate pPcPayload_ pPcFileId_ =
PermissionsCreate'
{ _pcSendNotificationEmail = Nothing
, _pcPayload = pPcPayload_
, _pcEmailMessage = Nothing
, _pcTransferOwnership = False
, _pcFileId = pPcFileId_
}
pcSendNotificationEmail :: Lens' PermissionsCreate (Maybe Bool)
pcSendNotificationEmail
= lens _pcSendNotificationEmail
(\ s a -> s{_pcSendNotificationEmail = a})
pcPayload :: Lens' PermissionsCreate Permission
pcPayload
= lens _pcPayload (\ s a -> s{_pcPayload = a})
pcEmailMessage :: Lens' PermissionsCreate (Maybe Text)
pcEmailMessage
= lens _pcEmailMessage
(\ s a -> s{_pcEmailMessage = a})
pcTransferOwnership :: Lens' PermissionsCreate Bool
pcTransferOwnership
= lens _pcTransferOwnership
(\ s a -> s{_pcTransferOwnership = a})
pcFileId :: Lens' PermissionsCreate Text
pcFileId = lens _pcFileId (\ s a -> s{_pcFileId = a})
instance GoogleRequest PermissionsCreate where
type Rs PermissionsCreate = Permission
type Scopes PermissionsCreate =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file"]
requestClient PermissionsCreate'{..}
= go _pcFileId _pcSendNotificationEmail
_pcEmailMessage
(Just _pcTransferOwnership)
(Just AltJSON)
_pcPayload
driveService
where go
= buildClient
(Proxy :: Proxy PermissionsCreateResource)
mempty