{-# 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.Insert
(
DeploymentsInsertResource
, deploymentsInsert
, DeploymentsInsert
, diCreatePolicy
, diProject
, diPayload
, diPreview
) where
import Network.Google.DeploymentManager.Types
import Network.Google.Prelude
type DeploymentsInsertResource =
"deploymentmanager" :>
"v2" :>
"projects" :>
Capture "project" Text :>
"global" :>
"deployments" :>
QueryParam "createPolicy"
DeploymentsInsertCreatePolicy
:>
QueryParam "preview" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Deployment :> Post '[JSON] Operation
data DeploymentsInsert = DeploymentsInsert'
{ _diCreatePolicy :: !DeploymentsInsertCreatePolicy
, _diProject :: !Text
, _diPayload :: !Deployment
, _diPreview :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
deploymentsInsert
:: Text
-> Deployment
-> DeploymentsInsert
deploymentsInsert pDiProject_ pDiPayload_ =
DeploymentsInsert'
{ _diCreatePolicy = DICPCreateOrAcquire
, _diProject = pDiProject_
, _diPayload = pDiPayload_
, _diPreview = Nothing
}
diCreatePolicy :: Lens' DeploymentsInsert DeploymentsInsertCreatePolicy
diCreatePolicy
= lens _diCreatePolicy
(\ s a -> s{_diCreatePolicy = a})
diProject :: Lens' DeploymentsInsert Text
diProject
= lens _diProject (\ s a -> s{_diProject = a})
diPayload :: Lens' DeploymentsInsert Deployment
diPayload
= lens _diPayload (\ s a -> s{_diPayload = a})
diPreview :: Lens' DeploymentsInsert (Maybe Bool)
diPreview
= lens _diPreview (\ s a -> s{_diPreview = a})
instance GoogleRequest DeploymentsInsert where
type Rs DeploymentsInsert = Operation
type Scopes DeploymentsInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/ndev.cloudman"]
requestClient DeploymentsInsert'{..}
= go _diProject (Just _diCreatePolicy) _diPreview
(Just AltJSON)
_diPayload
deploymentManagerService
where go
= buildClient
(Proxy :: Proxy DeploymentsInsertResource)
mempty