{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.Drive.Permissions.Create
(
PermissionsCreateResource
, permissionsCreate
, PermissionsCreate
, pcSendNotificationEmail
, pcPayload
, pcEmailMessage
, pcUseDomainAdminAccess
, pcTransferOwnership
, pcFileId
, pcSupportsTeamDrives
) 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 "useDomainAdminAccess" Bool :>
QueryParam "transferOwnership" Bool :>
QueryParam "supportsTeamDrives" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Permission :> Post '[JSON] Permission
data PermissionsCreate = PermissionsCreate'
{ _pcSendNotificationEmail :: !(Maybe Bool)
, _pcPayload :: !Permission
, _pcEmailMessage :: !(Maybe Text)
, _pcUseDomainAdminAccess :: !Bool
, _pcTransferOwnership :: !Bool
, _pcFileId :: !Text
, _pcSupportsTeamDrives :: !Bool
} deriving (Eq,Show,Data,Typeable,Generic)
permissionsCreate
:: Permission
-> Text
-> PermissionsCreate
permissionsCreate pPcPayload_ pPcFileId_ =
PermissionsCreate'
{ _pcSendNotificationEmail = Nothing
, _pcPayload = pPcPayload_
, _pcEmailMessage = Nothing
, _pcUseDomainAdminAccess = False
, _pcTransferOwnership = False
, _pcFileId = pPcFileId_
, _pcSupportsTeamDrives = False
}
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})
pcUseDomainAdminAccess :: Lens' PermissionsCreate Bool
pcUseDomainAdminAccess
= lens _pcUseDomainAdminAccess
(\ s a -> s{_pcUseDomainAdminAccess = 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})
pcSupportsTeamDrives :: Lens' PermissionsCreate Bool
pcSupportsTeamDrives
= lens _pcSupportsTeamDrives
(\ s a -> s{_pcSupportsTeamDrives = 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 _pcUseDomainAdminAccess)
(Just _pcTransferOwnership)
(Just _pcSupportsTeamDrives)
(Just AltJSON)
_pcPayload
driveService
where go
= buildClient
(Proxy :: Proxy PermissionsCreateResource)
mempty