{-# 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.Projects.Versions.Create
(
ProjectsVersionsCreateResource
, projectsVersionsCreate
, ProjectsVersionsCreate
, pvcXgafv
, pvcUploadProtocol
, pvcAccessToken
, pvcUploadType
, pvcPayload
, pvcScriptId
, pvcCallback
) where
import Network.Google.Prelude
import Network.Google.Script.Types
type ProjectsVersionsCreateResource =
"v1" :>
"projects" :>
Capture "scriptId" Text :>
"versions" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Version :> Post '[JSON] Version
data ProjectsVersionsCreate = ProjectsVersionsCreate'
{ _pvcXgafv :: !(Maybe Xgafv)
, _pvcUploadProtocol :: !(Maybe Text)
, _pvcAccessToken :: !(Maybe Text)
, _pvcUploadType :: !(Maybe Text)
, _pvcPayload :: !Version
, _pvcScriptId :: !Text
, _pvcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsVersionsCreate
:: Version
-> Text
-> ProjectsVersionsCreate
projectsVersionsCreate pPvcPayload_ pPvcScriptId_ =
ProjectsVersionsCreate'
{ _pvcXgafv = Nothing
, _pvcUploadProtocol = Nothing
, _pvcAccessToken = Nothing
, _pvcUploadType = Nothing
, _pvcPayload = pPvcPayload_
, _pvcScriptId = pPvcScriptId_
, _pvcCallback = Nothing
}
pvcXgafv :: Lens' ProjectsVersionsCreate (Maybe Xgafv)
pvcXgafv = lens _pvcXgafv (\ s a -> s{_pvcXgafv = a})
pvcUploadProtocol :: Lens' ProjectsVersionsCreate (Maybe Text)
pvcUploadProtocol
= lens _pvcUploadProtocol
(\ s a -> s{_pvcUploadProtocol = a})
pvcAccessToken :: Lens' ProjectsVersionsCreate (Maybe Text)
pvcAccessToken
= lens _pvcAccessToken
(\ s a -> s{_pvcAccessToken = a})
pvcUploadType :: Lens' ProjectsVersionsCreate (Maybe Text)
pvcUploadType
= lens _pvcUploadType
(\ s a -> s{_pvcUploadType = a})
pvcPayload :: Lens' ProjectsVersionsCreate Version
pvcPayload
= lens _pvcPayload (\ s a -> s{_pvcPayload = a})
pvcScriptId :: Lens' ProjectsVersionsCreate Text
pvcScriptId
= lens _pvcScriptId (\ s a -> s{_pvcScriptId = a})
pvcCallback :: Lens' ProjectsVersionsCreate (Maybe Text)
pvcCallback
= lens _pvcCallback (\ s a -> s{_pvcCallback = a})
instance GoogleRequest ProjectsVersionsCreate where
type Rs ProjectsVersionsCreate = Version
type Scopes ProjectsVersionsCreate =
'["https://www.googleapis.com/auth/script.projects"]
requestClient ProjectsVersionsCreate'{..}
= go _pvcScriptId _pvcXgafv _pvcUploadProtocol
_pvcAccessToken
_pvcUploadType
_pvcCallback
(Just AltJSON)
_pvcPayload
scriptService
where go
= buildClient
(Proxy :: Proxy ProjectsVersionsCreateResource)
mempty