{-# 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.Cloudbuild.Projects.Builds.Create
(
ProjectsBuildsCreateResource
, projectsBuildsCreate
, ProjectsBuildsCreate
, pXgafv
, pUploadProtocol
, pAccessToken
, pUploadType
, pPayload
, pProjectId
, pCallback
) where
import Network.Google.ContainerBuilder.Types
import Network.Google.Prelude
type ProjectsBuildsCreateResource =
"v1" :>
"projects" :>
Capture "projectId" Text :>
"builds" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Build :> Post '[JSON] Operation
data ProjectsBuildsCreate = ProjectsBuildsCreate'
{ _pXgafv :: !(Maybe Xgafv)
, _pUploadProtocol :: !(Maybe Text)
, _pAccessToken :: !(Maybe Text)
, _pUploadType :: !(Maybe Text)
, _pPayload :: !Build
, _pProjectId :: !Text
, _pCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsBuildsCreate
:: Build
-> Text
-> ProjectsBuildsCreate
projectsBuildsCreate pPPayload_ pPProjectId_ =
ProjectsBuildsCreate'
{ _pXgafv = Nothing
, _pUploadProtocol = Nothing
, _pAccessToken = Nothing
, _pUploadType = Nothing
, _pPayload = pPPayload_
, _pProjectId = pPProjectId_
, _pCallback = Nothing
}
pXgafv :: Lens' ProjectsBuildsCreate (Maybe Xgafv)
pXgafv = lens _pXgafv (\ s a -> s{_pXgafv = a})
pUploadProtocol :: Lens' ProjectsBuildsCreate (Maybe Text)
pUploadProtocol
= lens _pUploadProtocol
(\ s a -> s{_pUploadProtocol = a})
pAccessToken :: Lens' ProjectsBuildsCreate (Maybe Text)
pAccessToken
= lens _pAccessToken (\ s a -> s{_pAccessToken = a})
pUploadType :: Lens' ProjectsBuildsCreate (Maybe Text)
pUploadType
= lens _pUploadType (\ s a -> s{_pUploadType = a})
pPayload :: Lens' ProjectsBuildsCreate Build
pPayload = lens _pPayload (\ s a -> s{_pPayload = a})
pProjectId :: Lens' ProjectsBuildsCreate Text
pProjectId
= lens _pProjectId (\ s a -> s{_pProjectId = a})
pCallback :: Lens' ProjectsBuildsCreate (Maybe Text)
pCallback
= lens _pCallback (\ s a -> s{_pCallback = a})
instance GoogleRequest ProjectsBuildsCreate where
type Rs ProjectsBuildsCreate = Operation
type Scopes ProjectsBuildsCreate =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient ProjectsBuildsCreate'{..}
= go _pProjectId _pXgafv _pUploadProtocol
_pAccessToken
_pUploadType
_pCallback
(Just AltJSON)
_pPayload
containerBuilderService
where go
= buildClient
(Proxy :: Proxy ProjectsBuildsCreateResource)
mempty