{-# 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.Export
(
FilesExportResource
, filesExport
, FilesExport
, feMimeType
, feFileId
) where
import Network.Google.Drive.Types
import Network.Google.Prelude
type FilesExportResource =
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"export" :>
QueryParam "mimeType" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] ()
:<|>
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"export" :>
QueryParam "mimeType" Text :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data FilesExport = FilesExport'
{ _feMimeType :: !Text
, _feFileId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
filesExport
:: Text
-> Text
-> FilesExport
filesExport pFeMimeType_ pFeFileId_ =
FilesExport'
{ _feMimeType = pFeMimeType_
, _feFileId = pFeFileId_
}
feMimeType :: Lens' FilesExport Text
feMimeType
= lens _feMimeType (\ s a -> s{_feMimeType = a})
feFileId :: Lens' FilesExport Text
feFileId = lens _feFileId (\ s a -> s{_feFileId = a})
instance GoogleRequest FilesExport where
type Rs FilesExport = ()
type Scopes FilesExport =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive.readonly"]
requestClient FilesExport'{..}
= go _feFileId (Just _feMimeType) (Just AltJSON)
driveService
where go :<|> _
= buildClient (Proxy :: Proxy FilesExportResource)
mempty
instance GoogleRequest (MediaDownload FilesExport)
where
type Rs (MediaDownload FilesExport) = Stream
type Scopes (MediaDownload FilesExport) =
Scopes FilesExport
requestClient (MediaDownload FilesExport'{..})
= go _feFileId (Just _feMimeType) (Just AltMedia)
driveService
where _ :<|> go
= buildClient (Proxy :: Proxy FilesExportResource)
mempty