{-# 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.DFAReporting.Files.Get
(
FilesGetResource
, filesGet
, FilesGet
, fgReportId
, fgFileId
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type FilesGetResource =
"dfareporting" :>
"v3.2" :>
"reports" :>
Capture "reportId" (Textual Int64) :>
"files" :>
Capture "fileId" (Textual Int64) :>
QueryParam "alt" AltJSON :> Get '[JSON] File
:<|>
"dfareporting" :>
"v3.2" :>
"reports" :>
Capture "reportId" (Textual Int64) :>
"files" :>
Capture "fileId" (Textual Int64) :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data FilesGet = FilesGet'
{ _fgReportId :: !(Textual Int64)
, _fgFileId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
filesGet
:: Int64
-> Int64
-> FilesGet
filesGet pFgReportId_ pFgFileId_ =
FilesGet'
{ _fgReportId = _Coerce # pFgReportId_
, _fgFileId = _Coerce # pFgFileId_
}
fgReportId :: Lens' FilesGet Int64
fgReportId
= lens _fgReportId (\ s a -> s{_fgReportId = a}) .
_Coerce
fgFileId :: Lens' FilesGet Int64
fgFileId
= lens _fgFileId (\ s a -> s{_fgFileId = a}) .
_Coerce
instance GoogleRequest FilesGet where
type Rs FilesGet = File
type Scopes FilesGet =
'["https://www.googleapis.com/auth/dfareporting"]
requestClient FilesGet'{..}
= go _fgReportId _fgFileId (Just AltJSON)
dFAReportingService
where go :<|> _
= buildClient (Proxy :: Proxy FilesGetResource)
mempty
instance GoogleRequest (MediaDownload FilesGet) where
type Rs (MediaDownload FilesGet) = Stream
type Scopes (MediaDownload FilesGet) =
Scopes FilesGet
requestClient (MediaDownload FilesGet'{..})
= go _fgReportId _fgFileId (Just AltMedia)
dFAReportingService
where _ :<|> go
= buildClient (Proxy :: Proxy FilesGetResource)
mempty