{-# 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.Get
(
PermissionsGetResource
, permissionsGet
, PermissionsGet
, pgSupportsAllDrives
, pgUseDomainAdminAccess
, pgFileId
, pgSupportsTeamDrives
, pgPermissionId
) where
import Network.Google.Drive.Types
import Network.Google.Prelude
type PermissionsGetResource =
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"permissions" :>
Capture "permissionId" Text :>
QueryParam "supportsAllDrives" Bool :>
QueryParam "useDomainAdminAccess" Bool :>
QueryParam "supportsTeamDrives" Bool :>
QueryParam "alt" AltJSON :> Get '[JSON] Permission
data PermissionsGet =
PermissionsGet'
{ _pgSupportsAllDrives :: !Bool
, _pgUseDomainAdminAccess :: !Bool
, _pgFileId :: !Text
, _pgSupportsTeamDrives :: !Bool
, _pgPermissionId :: !Text
}
deriving (Eq, Show, Data, Typeable, Generic)
permissionsGet
:: Text
-> Text
-> PermissionsGet
permissionsGet pPgFileId_ pPgPermissionId_ =
PermissionsGet'
{ _pgSupportsAllDrives = False
, _pgUseDomainAdminAccess = False
, _pgFileId = pPgFileId_
, _pgSupportsTeamDrives = False
, _pgPermissionId = pPgPermissionId_
}
pgSupportsAllDrives :: Lens' PermissionsGet Bool
pgSupportsAllDrives
= lens _pgSupportsAllDrives
(\ s a -> s{_pgSupportsAllDrives = a})
pgUseDomainAdminAccess :: Lens' PermissionsGet Bool
pgUseDomainAdminAccess
= lens _pgUseDomainAdminAccess
(\ s a -> s{_pgUseDomainAdminAccess = a})
pgFileId :: Lens' PermissionsGet Text
pgFileId = lens _pgFileId (\ s a -> s{_pgFileId = a})
pgSupportsTeamDrives :: Lens' PermissionsGet Bool
pgSupportsTeamDrives
= lens _pgSupportsTeamDrives
(\ s a -> s{_pgSupportsTeamDrives = a})
pgPermissionId :: Lens' PermissionsGet Text
pgPermissionId
= lens _pgPermissionId
(\ s a -> s{_pgPermissionId = a})
instance GoogleRequest PermissionsGet where
type Rs PermissionsGet = Permission
type Scopes PermissionsGet =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive.metadata",
"https://www.googleapis.com/auth/drive.metadata.readonly",
"https://www.googleapis.com/auth/drive.photos.readonly",
"https://www.googleapis.com/auth/drive.readonly"]
requestClient PermissionsGet'{..}
= go _pgFileId _pgPermissionId
(Just _pgSupportsAllDrives)
(Just _pgUseDomainAdminAccess)
(Just _pgSupportsTeamDrives)
(Just AltJSON)
driveService
where go
= buildClient (Proxy :: Proxy PermissionsGetResource)
mempty