{-# 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.Files.Copy
(
FilesCopyResource
, filesCopy
, FilesCopy
, fPayload
, fOCRLanguage
, fKeepRevisionForever
, fIgnoreDefaultVisibility
, fFileId
, fSupportsTeamDrives
) where
import Network.Google.Drive.Types
import Network.Google.Prelude
type FilesCopyResource =
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"copy" :>
QueryParam "ocrLanguage" Text :>
QueryParam "keepRevisionForever" Bool :>
QueryParam "ignoreDefaultVisibility" Bool :>
QueryParam "supportsTeamDrives" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] File :> Post '[JSON] File
data FilesCopy = FilesCopy'
{ _fPayload :: !File
, _fOCRLanguage :: !(Maybe Text)
, _fKeepRevisionForever :: !Bool
, _fIgnoreDefaultVisibility :: !Bool
, _fFileId :: !Text
, _fSupportsTeamDrives :: !Bool
} deriving (Eq,Show,Data,Typeable,Generic)
filesCopy
:: File
-> Text
-> FilesCopy
filesCopy pFPayload_ pFFileId_ =
FilesCopy'
{ _fPayload = pFPayload_
, _fOCRLanguage = Nothing
, _fKeepRevisionForever = False
, _fIgnoreDefaultVisibility = False
, _fFileId = pFFileId_
, _fSupportsTeamDrives = False
}
fPayload :: Lens' FilesCopy File
fPayload = lens _fPayload (\ s a -> s{_fPayload = a})
fOCRLanguage :: Lens' FilesCopy (Maybe Text)
fOCRLanguage
= lens _fOCRLanguage (\ s a -> s{_fOCRLanguage = a})
fKeepRevisionForever :: Lens' FilesCopy Bool
fKeepRevisionForever
= lens _fKeepRevisionForever
(\ s a -> s{_fKeepRevisionForever = a})
fIgnoreDefaultVisibility :: Lens' FilesCopy Bool
fIgnoreDefaultVisibility
= lens _fIgnoreDefaultVisibility
(\ s a -> s{_fIgnoreDefaultVisibility = a})
fFileId :: Lens' FilesCopy Text
fFileId = lens _fFileId (\ s a -> s{_fFileId = a})
fSupportsTeamDrives :: Lens' FilesCopy Bool
fSupportsTeamDrives
= lens _fSupportsTeamDrives
(\ s a -> s{_fSupportsTeamDrives = a})
instance GoogleRequest FilesCopy where
type Rs FilesCopy = File
type Scopes FilesCopy =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.appdata",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive.photos.readonly"]
requestClient FilesCopy'{..}
= go _fFileId _fOCRLanguage
(Just _fKeepRevisionForever)
(Just _fIgnoreDefaultVisibility)
(Just _fSupportsTeamDrives)
(Just AltJSON)
_fPayload
driveService
where go
= buildClient (Proxy :: Proxy FilesCopyResource)
mempty