{-# 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.DeploymentManager.Deployments.Update
(
DeploymentsUpdateResource
, deploymentsUpdate
, DeploymentsUpdate
, duCreatePolicy
, duProject
, duPayload
, duDeletePolicy
, duPreview
, duDeployment
) where
import Network.Google.DeploymentManager.Types
import Network.Google.Prelude
type DeploymentsUpdateResource =
"deploymentmanager" :>
"v2" :>
"projects" :>
Capture "project" Text :>
"global" :>
"deployments" :>
Capture "deployment" Text :>
QueryParam "createPolicy"
DeploymentsUpdateCreatePolicy
:>
QueryParam "deletePolicy"
DeploymentsUpdateDeletePolicy
:>
QueryParam "preview" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Deployment :> Put '[JSON] Operation
data DeploymentsUpdate = DeploymentsUpdate'
{ _duCreatePolicy :: !DeploymentsUpdateCreatePolicy
, _duProject :: !Text
, _duPayload :: !Deployment
, _duDeletePolicy :: !DeploymentsUpdateDeletePolicy
, _duPreview :: !Bool
, _duDeployment :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
deploymentsUpdate
:: Text
-> Deployment
-> Text
-> DeploymentsUpdate
deploymentsUpdate pDuProject_ pDuPayload_ pDuDeployment_ =
DeploymentsUpdate'
{ _duCreatePolicy = CreateOrAcquire
, _duProject = pDuProject_
, _duPayload = pDuPayload_
, _duDeletePolicy = DUDPDelete'
, _duPreview = False
, _duDeployment = pDuDeployment_
}
duCreatePolicy :: Lens' DeploymentsUpdate DeploymentsUpdateCreatePolicy
duCreatePolicy
= lens _duCreatePolicy
(\ s a -> s{_duCreatePolicy = a})
duProject :: Lens' DeploymentsUpdate Text
duProject
= lens _duProject (\ s a -> s{_duProject = a})
duPayload :: Lens' DeploymentsUpdate Deployment
duPayload
= lens _duPayload (\ s a -> s{_duPayload = a})
duDeletePolicy :: Lens' DeploymentsUpdate DeploymentsUpdateDeletePolicy
duDeletePolicy
= lens _duDeletePolicy
(\ s a -> s{_duDeletePolicy = a})
duPreview :: Lens' DeploymentsUpdate Bool
duPreview
= lens _duPreview (\ s a -> s{_duPreview = a})
duDeployment :: Lens' DeploymentsUpdate Text
duDeployment
= lens _duDeployment (\ s a -> s{_duDeployment = a})
instance GoogleRequest DeploymentsUpdate where
type Rs DeploymentsUpdate = Operation
type Scopes DeploymentsUpdate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/ndev.cloudman"]
requestClient DeploymentsUpdate'{..}
= go _duProject _duDeployment (Just _duCreatePolicy)
(Just _duDeletePolicy)
(Just _duPreview)
(Just AltJSON)
_duPayload
deploymentManagerService
where go
= buildClient
(Proxy :: Proxy DeploymentsUpdateResource)
mempty