{-# 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.Revisions.Get
(
RevisionsGetResource
, revisionsGet
, RevisionsGet
, rggAcknowledgeAbuse
, rggFileId
, rggRevisionId
) where
import Network.Google.Drive.Types
import Network.Google.Prelude
type RevisionsGetResource =
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"revisions" :>
Capture "revisionId" Text :>
QueryParam "acknowledgeAbuse" Bool :>
QueryParam "alt" AltJSON :> Get '[JSON] Revision
:<|>
"drive" :>
"v3" :>
"files" :>
Capture "fileId" Text :>
"revisions" :>
Capture "revisionId" Text :>
QueryParam "acknowledgeAbuse" Bool :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data RevisionsGet = RevisionsGet'
{ _rggAcknowledgeAbuse :: !Bool
, _rggFileId :: !Text
, _rggRevisionId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
revisionsGet
:: Text
-> Text
-> RevisionsGet
revisionsGet pRggFileId_ pRggRevisionId_ =
RevisionsGet'
{ _rggAcknowledgeAbuse = False
, _rggFileId = pRggFileId_
, _rggRevisionId = pRggRevisionId_
}
rggAcknowledgeAbuse :: Lens' RevisionsGet Bool
rggAcknowledgeAbuse
= lens _rggAcknowledgeAbuse
(\ s a -> s{_rggAcknowledgeAbuse = a})
rggFileId :: Lens' RevisionsGet Text
rggFileId
= lens _rggFileId (\ s a -> s{_rggFileId = a})
rggRevisionId :: Lens' RevisionsGet Text
rggRevisionId
= lens _rggRevisionId
(\ s a -> s{_rggRevisionId = a})
instance GoogleRequest RevisionsGet where
type Rs RevisionsGet = Revision
type Scopes RevisionsGet =
'["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.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 RevisionsGet'{..}
= go _rggFileId _rggRevisionId
(Just _rggAcknowledgeAbuse)
(Just AltJSON)
driveService
where go :<|> _
= buildClient (Proxy :: Proxy RevisionsGetResource)
mempty
instance GoogleRequest (MediaDownload RevisionsGet)
where
type Rs (MediaDownload RevisionsGet) = Stream
type Scopes (MediaDownload RevisionsGet) =
Scopes RevisionsGet
requestClient (MediaDownload RevisionsGet'{..})
= go _rggFileId _rggRevisionId
(Just _rggAcknowledgeAbuse)
(Just AltMedia)
driveService
where _ :<|> go
= buildClient (Proxy :: Proxy RevisionsGetResource)
mempty