{-# 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.Create
(
SpreadsheetsCreateResource
, spreadsheetsCreate
, SpreadsheetsCreate
, scXgafv
, scUploadProtocol
, scAccessToken
, scUploadType
, scPayload
, scCallback
) where
import Network.Google.Prelude
import Network.Google.Sheets.Types
type SpreadsheetsCreateResource =
"v4" :>
"spreadsheets" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Spreadsheet :>
Post '[JSON] Spreadsheet
data SpreadsheetsCreate = SpreadsheetsCreate'
{ _scXgafv :: !(Maybe Xgafv)
, _scUploadProtocol :: !(Maybe Text)
, _scAccessToken :: !(Maybe Text)
, _scUploadType :: !(Maybe Text)
, _scPayload :: !Spreadsheet
, _scCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
spreadsheetsCreate
:: Spreadsheet
-> SpreadsheetsCreate
spreadsheetsCreate pScPayload_ =
SpreadsheetsCreate'
{ _scXgafv = Nothing
, _scUploadProtocol = Nothing
, _scAccessToken = Nothing
, _scUploadType = Nothing
, _scPayload = pScPayload_
, _scCallback = Nothing
}
scXgafv :: Lens' SpreadsheetsCreate (Maybe Xgafv)
scXgafv = lens _scXgafv (\ s a -> s{_scXgafv = a})
scUploadProtocol :: Lens' SpreadsheetsCreate (Maybe Text)
scUploadProtocol
= lens _scUploadProtocol
(\ s a -> s{_scUploadProtocol = a})
scAccessToken :: Lens' SpreadsheetsCreate (Maybe Text)
scAccessToken
= lens _scAccessToken
(\ s a -> s{_scAccessToken = a})
scUploadType :: Lens' SpreadsheetsCreate (Maybe Text)
scUploadType
= lens _scUploadType (\ s a -> s{_scUploadType = a})
scPayload :: Lens' SpreadsheetsCreate Spreadsheet
scPayload
= lens _scPayload (\ s a -> s{_scPayload = a})
scCallback :: Lens' SpreadsheetsCreate (Maybe Text)
scCallback
= lens _scCallback (\ s a -> s{_scCallback = a})
instance GoogleRequest SpreadsheetsCreate where
type Rs SpreadsheetsCreate = Spreadsheet
type Scopes SpreadsheetsCreate =
'["https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/spreadsheets"]
requestClient SpreadsheetsCreate'{..}
= go _scXgafv _scUploadProtocol _scAccessToken
_scUploadType
_scCallback
(Just AltJSON)
_scPayload
sheetsService
where go
= buildClient
(Proxy :: Proxy SpreadsheetsCreateResource)
mempty