{-# 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.Compute.SecurityPolicies.Insert
(
SecurityPoliciesInsertResource
, securityPoliciesInsert
, SecurityPoliciesInsert
, spiRequestId
, spiProject
, spiPayload
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type SecurityPoliciesInsertResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"securityPolicies" :>
QueryParam "requestId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SecurityPolicy :>
Post '[JSON] Operation
data SecurityPoliciesInsert = SecurityPoliciesInsert'
{ _spiRequestId :: !(Maybe Text)
, _spiProject :: !Text
, _spiPayload :: !SecurityPolicy
} deriving (Eq,Show,Data,Typeable,Generic)
securityPoliciesInsert
:: Text
-> SecurityPolicy
-> SecurityPoliciesInsert
securityPoliciesInsert pSpiProject_ pSpiPayload_ =
SecurityPoliciesInsert'
{ _spiRequestId = Nothing
, _spiProject = pSpiProject_
, _spiPayload = pSpiPayload_
}
spiRequestId :: Lens' SecurityPoliciesInsert (Maybe Text)
spiRequestId
= lens _spiRequestId (\ s a -> s{_spiRequestId = a})
spiProject :: Lens' SecurityPoliciesInsert Text
spiProject
= lens _spiProject (\ s a -> s{_spiProject = a})
spiPayload :: Lens' SecurityPoliciesInsert SecurityPolicy
spiPayload
= lens _spiPayload (\ s a -> s{_spiPayload = a})
instance GoogleRequest SecurityPoliciesInsert where
type Rs SecurityPoliciesInsert = Operation
type Scopes SecurityPoliciesInsert =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient SecurityPoliciesInsert'{..}
= go _spiProject _spiRequestId (Just AltJSON)
_spiPayload
computeService
where go
= buildClient
(Proxy :: Proxy SecurityPoliciesInsertResource)
mempty