{-# 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.Patch
(
DeploymentsPatchResource
, deploymentsPatch
, DeploymentsPatch
, dpCreatePolicy
, dpProject
, dpPayload
, dpDeletePolicy
, dpPreview
, dpDeployment
) where
import Network.Google.DeploymentManager.Types
import Network.Google.Prelude
type DeploymentsPatchResource =
"deploymentmanager" :>
"v2" :>
"projects" :>
Capture "project" Text :>
"global" :>
"deployments" :>
Capture "deployment" Text :>
QueryParam "createPolicy"
DeploymentsPatchCreatePolicy
:>
QueryParam "deletePolicy"
DeploymentsPatchDeletePolicy
:>
QueryParam "preview" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Deployment :> Patch '[JSON] Operation
data DeploymentsPatch = DeploymentsPatch'
{ _dpCreatePolicy :: !DeploymentsPatchCreatePolicy
, _dpProject :: !Text
, _dpPayload :: !Deployment
, _dpDeletePolicy :: !DeploymentsPatchDeletePolicy
, _dpPreview :: !Bool
, _dpDeployment :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
deploymentsPatch
:: Text
-> Deployment
-> Text
-> DeploymentsPatch
deploymentsPatch pDpProject_ pDpPayload_ pDpDeployment_ =
DeploymentsPatch'
{ _dpCreatePolicy = DPCPCreateOrAcquire
, _dpProject = pDpProject_
, _dpPayload = pDpPayload_
, _dpDeletePolicy = DPDPDelete'
, _dpPreview = False
, _dpDeployment = pDpDeployment_
}
dpCreatePolicy :: Lens' DeploymentsPatch DeploymentsPatchCreatePolicy
dpCreatePolicy
= lens _dpCreatePolicy
(\ s a -> s{_dpCreatePolicy = a})
dpProject :: Lens' DeploymentsPatch Text
dpProject
= lens _dpProject (\ s a -> s{_dpProject = a})
dpPayload :: Lens' DeploymentsPatch Deployment
dpPayload
= lens _dpPayload (\ s a -> s{_dpPayload = a})
dpDeletePolicy :: Lens' DeploymentsPatch DeploymentsPatchDeletePolicy
dpDeletePolicy
= lens _dpDeletePolicy
(\ s a -> s{_dpDeletePolicy = a})
dpPreview :: Lens' DeploymentsPatch Bool
dpPreview
= lens _dpPreview (\ s a -> s{_dpPreview = a})
dpDeployment :: Lens' DeploymentsPatch Text
dpDeployment
= lens _dpDeployment (\ s a -> s{_dpDeployment = a})
instance GoogleRequest DeploymentsPatch where
type Rs DeploymentsPatch = Operation
type Scopes DeploymentsPatch =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/ndev.cloudman"]
requestClient DeploymentsPatch'{..}
= go _dpProject _dpDeployment (Just _dpCreatePolicy)
(Just _dpDeletePolicy)
(Just _dpPreview)
(Just AltJSON)
_dpPayload
deploymentManagerService
where go
= buildClient
(Proxy :: Proxy DeploymentsPatchResource)
mempty