{-# 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.Deployments.Create
(
ProjectsDeploymentsCreateResource
, projectsDeploymentsCreate
, ProjectsDeploymentsCreate
, pdcXgafv
, pdcUploadProtocol
, pdcAccessToken
, pdcUploadType
, pdcPayload
, pdcScriptId
, pdcCallback
) where
import Network.Google.Prelude
import Network.Google.Script.Types
type ProjectsDeploymentsCreateResource =
"v1" :>
"projects" :>
Capture "scriptId" Text :>
"deployments" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DeploymentConfig :>
Post '[JSON] Deployment
data ProjectsDeploymentsCreate = ProjectsDeploymentsCreate'
{ _pdcXgafv :: !(Maybe Xgafv)
, _pdcUploadProtocol :: !(Maybe Text)
, _pdcAccessToken :: !(Maybe Text)
, _pdcUploadType :: !(Maybe Text)
, _pdcPayload :: !DeploymentConfig
, _pdcScriptId :: !Text
, _pdcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsDeploymentsCreate
:: DeploymentConfig
-> Text
-> ProjectsDeploymentsCreate
projectsDeploymentsCreate pPdcPayload_ pPdcScriptId_ =
ProjectsDeploymentsCreate'
{ _pdcXgafv = Nothing
, _pdcUploadProtocol = Nothing
, _pdcAccessToken = Nothing
, _pdcUploadType = Nothing
, _pdcPayload = pPdcPayload_
, _pdcScriptId = pPdcScriptId_
, _pdcCallback = Nothing
}
pdcXgafv :: Lens' ProjectsDeploymentsCreate (Maybe Xgafv)
pdcXgafv = lens _pdcXgafv (\ s a -> s{_pdcXgafv = a})
pdcUploadProtocol :: Lens' ProjectsDeploymentsCreate (Maybe Text)
pdcUploadProtocol
= lens _pdcUploadProtocol
(\ s a -> s{_pdcUploadProtocol = a})
pdcAccessToken :: Lens' ProjectsDeploymentsCreate (Maybe Text)
pdcAccessToken
= lens _pdcAccessToken
(\ s a -> s{_pdcAccessToken = a})
pdcUploadType :: Lens' ProjectsDeploymentsCreate (Maybe Text)
pdcUploadType
= lens _pdcUploadType
(\ s a -> s{_pdcUploadType = a})
pdcPayload :: Lens' ProjectsDeploymentsCreate DeploymentConfig
pdcPayload
= lens _pdcPayload (\ s a -> s{_pdcPayload = a})
pdcScriptId :: Lens' ProjectsDeploymentsCreate Text
pdcScriptId
= lens _pdcScriptId (\ s a -> s{_pdcScriptId = a})
pdcCallback :: Lens' ProjectsDeploymentsCreate (Maybe Text)
pdcCallback
= lens _pdcCallback (\ s a -> s{_pdcCallback = a})
instance GoogleRequest ProjectsDeploymentsCreate
where
type Rs ProjectsDeploymentsCreate = Deployment
type Scopes ProjectsDeploymentsCreate =
'["https://www.googleapis.com/auth/script.deployments"]
requestClient ProjectsDeploymentsCreate'{..}
= go _pdcScriptId _pdcXgafv _pdcUploadProtocol
_pdcAccessToken
_pdcUploadType
_pdcCallback
(Just AltJSON)
_pdcPayload
scriptService
where go
= buildClient
(Proxy :: Proxy ProjectsDeploymentsCreateResource)
mempty