{-# 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.Sheets.Spreadsheets.Get
(
SpreadsheetsGetResource
, spreadsheetsGet
, SpreadsheetsGet
, sgXgafv
, sgUploadProtocol
, sgAccessToken
, sgSpreadsheetId
, sgUploadType
, sgRanges
, sgIncludeGridData
, sgCallback
) where
import Network.Google.Prelude
import Network.Google.Sheets.Types
type SpreadsheetsGetResource =
"v4" :>
"spreadsheets" :>
Capture "spreadsheetId" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParams "ranges" Text :>
QueryParam "includeGridData" Bool :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Spreadsheet
data SpreadsheetsGet = SpreadsheetsGet'
{ _sgXgafv :: !(Maybe Xgafv)
, _sgUploadProtocol :: !(Maybe Text)
, _sgAccessToken :: !(Maybe Text)
, _sgSpreadsheetId :: !Text
, _sgUploadType :: !(Maybe Text)
, _sgRanges :: !(Maybe [Text])
, _sgIncludeGridData :: !(Maybe Bool)
, _sgCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
spreadsheetsGet
:: Text
-> SpreadsheetsGet
spreadsheetsGet pSgSpreadsheetId_ =
SpreadsheetsGet'
{ _sgXgafv = Nothing
, _sgUploadProtocol = Nothing
, _sgAccessToken = Nothing
, _sgSpreadsheetId = pSgSpreadsheetId_
, _sgUploadType = Nothing
, _sgRanges = Nothing
, _sgIncludeGridData = Nothing
, _sgCallback = Nothing
}
sgXgafv :: Lens' SpreadsheetsGet (Maybe Xgafv)
sgXgafv = lens _sgXgafv (\ s a -> s{_sgXgafv = a})
sgUploadProtocol :: Lens' SpreadsheetsGet (Maybe Text)
sgUploadProtocol
= lens _sgUploadProtocol
(\ s a -> s{_sgUploadProtocol = a})
sgAccessToken :: Lens' SpreadsheetsGet (Maybe Text)
sgAccessToken
= lens _sgAccessToken
(\ s a -> s{_sgAccessToken = a})
sgSpreadsheetId :: Lens' SpreadsheetsGet Text
sgSpreadsheetId
= lens _sgSpreadsheetId
(\ s a -> s{_sgSpreadsheetId = a})
sgUploadType :: Lens' SpreadsheetsGet (Maybe Text)
sgUploadType
= lens _sgUploadType (\ s a -> s{_sgUploadType = a})
sgRanges :: Lens' SpreadsheetsGet [Text]
sgRanges
= lens _sgRanges (\ s a -> s{_sgRanges = a}) .
_Default
. _Coerce
sgIncludeGridData :: Lens' SpreadsheetsGet (Maybe Bool)
sgIncludeGridData
= lens _sgIncludeGridData
(\ s a -> s{_sgIncludeGridData = a})
sgCallback :: Lens' SpreadsheetsGet (Maybe Text)
sgCallback
= lens _sgCallback (\ s a -> s{_sgCallback = a})
instance GoogleRequest SpreadsheetsGet where
type Rs SpreadsheetsGet = Spreadsheet
type Scopes SpreadsheetsGet =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive.readonly",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/spreadsheets.readonly"]
requestClient SpreadsheetsGet'{..}
= go _sgSpreadsheetId _sgXgafv _sgUploadProtocol
_sgAccessToken
_sgUploadType
(_sgRanges ^. _Default)
_sgIncludeGridData
_sgCallback
(Just AltJSON)
sheetsService
where go
= buildClient
(Proxy :: Proxy SpreadsheetsGetResource)
mempty