{-# 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.Script.Scripts.Run
(
ScriptsRunResource
, scriptsRun
, ScriptsRun
, srXgafv
, srUploadProtocol
, srAccessToken
, srUploadType
, srPayload
, srScriptId
, srCallback
) where
import Network.Google.Prelude
import Network.Google.Script.Types
type ScriptsRunResource =
"v1" :>
"scripts" :>
CaptureMode "scriptId" "run" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ExecutionRequest :>
Post '[JSON] Operation
data ScriptsRun = ScriptsRun'
{ _srXgafv :: !(Maybe Xgafv)
, _srUploadProtocol :: !(Maybe Text)
, _srAccessToken :: !(Maybe Text)
, _srUploadType :: !(Maybe Text)
, _srPayload :: !ExecutionRequest
, _srScriptId :: !Text
, _srCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
scriptsRun
:: ExecutionRequest
-> Text
-> ScriptsRun
scriptsRun pSrPayload_ pSrScriptId_ =
ScriptsRun'
{ _srXgafv = Nothing
, _srUploadProtocol = Nothing
, _srAccessToken = Nothing
, _srUploadType = Nothing
, _srPayload = pSrPayload_
, _srScriptId = pSrScriptId_
, _srCallback = Nothing
}
srXgafv :: Lens' ScriptsRun (Maybe Xgafv)
srXgafv = lens _srXgafv (\ s a -> s{_srXgafv = a})
srUploadProtocol :: Lens' ScriptsRun (Maybe Text)
srUploadProtocol
= lens _srUploadProtocol
(\ s a -> s{_srUploadProtocol = a})
srAccessToken :: Lens' ScriptsRun (Maybe Text)
srAccessToken
= lens _srAccessToken
(\ s a -> s{_srAccessToken = a})
srUploadType :: Lens' ScriptsRun (Maybe Text)
srUploadType
= lens _srUploadType (\ s a -> s{_srUploadType = a})
srPayload :: Lens' ScriptsRun ExecutionRequest
srPayload
= lens _srPayload (\ s a -> s{_srPayload = a})
srScriptId :: Lens' ScriptsRun Text
srScriptId
= lens _srScriptId (\ s a -> s{_srScriptId = a})
srCallback :: Lens' ScriptsRun (Maybe Text)
srCallback
= lens _srCallback (\ s a -> s{_srCallback = a})
instance GoogleRequest ScriptsRun where
type Rs ScriptsRun = Operation
type Scopes ScriptsRun =
'["https://mail.google.com/",
"https://www.google.com/calendar/feeds",
"https://www.google.com/m8/feeds",
"https://www.googleapis.com/auth/admin.directory.group",
"https://www.googleapis.com/auth/admin.directory.user",
"https://www.googleapis.com/auth/documents",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/forms",
"https://www.googleapis.com/auth/forms.currentonly",
"https://www.googleapis.com/auth/groups",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/userinfo.email"]
requestClient ScriptsRun'{..}
= go _srScriptId _srXgafv _srUploadProtocol
_srAccessToken
_srUploadType
_srCallback
(Just AltJSON)
_srPayload
scriptService
where go
= buildClient (Proxy :: Proxy ScriptsRunResource)
mempty