{-# 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.Update
(
PermissionsUpdateResource
, permissionsUpdate
, PermissionsUpdate
, puPayload
, puRemoveExpiration
, puUseDomainAdminAccess
, puTransferOwnership
, puFileId
, puSupportsTeamDrives
, puPermissionId
) where
import Network.Google.Drive.Types
import Network.Google.Prelude
type PermissionsUpdateResource =
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"permissions" :>
Capture "permissionId" Text :>
QueryParam "removeExpiration" Bool :>
QueryParam "useDomainAdminAccess" Bool :>
QueryParam "transferOwnership" Bool :>
QueryParam "supportsTeamDrives" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Permission :>
Patch '[JSON] Permission
data PermissionsUpdate = PermissionsUpdate'
{ _puPayload :: !Permission
, _puRemoveExpiration :: !Bool
, _puUseDomainAdminAccess :: !Bool
, _puTransferOwnership :: !Bool
, _puFileId :: !Text
, _puSupportsTeamDrives :: !Bool
, _puPermissionId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
permissionsUpdate
:: Permission
-> Text
-> Text
-> PermissionsUpdate
permissionsUpdate pPuPayload_ pPuFileId_ pPuPermissionId_ =
PermissionsUpdate'
{ _puPayload = pPuPayload_
, _puRemoveExpiration = False
, _puUseDomainAdminAccess = False
, _puTransferOwnership = False
, _puFileId = pPuFileId_
, _puSupportsTeamDrives = False
, _puPermissionId = pPuPermissionId_
}
puPayload :: Lens' PermissionsUpdate Permission
puPayload
= lens _puPayload (\ s a -> s{_puPayload = a})
puRemoveExpiration :: Lens' PermissionsUpdate Bool
puRemoveExpiration
= lens _puRemoveExpiration
(\ s a -> s{_puRemoveExpiration = a})
puUseDomainAdminAccess :: Lens' PermissionsUpdate Bool
puUseDomainAdminAccess
= lens _puUseDomainAdminAccess
(\ s a -> s{_puUseDomainAdminAccess = a})
puTransferOwnership :: Lens' PermissionsUpdate Bool
puTransferOwnership
= lens _puTransferOwnership
(\ s a -> s{_puTransferOwnership = a})
puFileId :: Lens' PermissionsUpdate Text
puFileId = lens _puFileId (\ s a -> s{_puFileId = a})
puSupportsTeamDrives :: Lens' PermissionsUpdate Bool
puSupportsTeamDrives
= lens _puSupportsTeamDrives
(\ s a -> s{_puSupportsTeamDrives = a})
puPermissionId :: Lens' PermissionsUpdate Text
puPermissionId
= lens _puPermissionId
(\ s a -> s{_puPermissionId = a})
instance GoogleRequest PermissionsUpdate where
type Rs PermissionsUpdate = Permission
type Scopes PermissionsUpdate =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file"]
requestClient PermissionsUpdate'{..}
= go _puFileId _puPermissionId
(Just _puRemoveExpiration)
(Just _puUseDomainAdminAccess)
(Just _puTransferOwnership)
(Just _puSupportsTeamDrives)
(Just AltJSON)
_puPayload
driveService
where go
= buildClient
(Proxy :: Proxy PermissionsUpdateResource)
mempty