{-# 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.AddRule
(
SecurityPoliciesAddRuleResource
, securityPoliciesAddRule
, SecurityPoliciesAddRule
, sparProject
, sparPayload
, sparSecurityPolicy
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type SecurityPoliciesAddRuleResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"securityPolicies" :>
Capture "securityPolicy" Text :>
"addRule" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SecurityPolicyRule :>
Post '[JSON] Operation
data SecurityPoliciesAddRule = SecurityPoliciesAddRule'
{ _sparProject :: !Text
, _sparPayload :: !SecurityPolicyRule
, _sparSecurityPolicy :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
securityPoliciesAddRule
:: Text
-> SecurityPolicyRule
-> Text
-> SecurityPoliciesAddRule
securityPoliciesAddRule pSparProject_ pSparPayload_ pSparSecurityPolicy_ =
SecurityPoliciesAddRule'
{ _sparProject = pSparProject_
, _sparPayload = pSparPayload_
, _sparSecurityPolicy = pSparSecurityPolicy_
}
sparProject :: Lens' SecurityPoliciesAddRule Text
sparProject
= lens _sparProject (\ s a -> s{_sparProject = a})
sparPayload :: Lens' SecurityPoliciesAddRule SecurityPolicyRule
sparPayload
= lens _sparPayload (\ s a -> s{_sparPayload = a})
sparSecurityPolicy :: Lens' SecurityPoliciesAddRule Text
sparSecurityPolicy
= lens _sparSecurityPolicy
(\ s a -> s{_sparSecurityPolicy = a})
instance GoogleRequest SecurityPoliciesAddRule where
type Rs SecurityPoliciesAddRule = Operation
type Scopes SecurityPoliciesAddRule =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient SecurityPoliciesAddRule'{..}
= go _sparProject _sparSecurityPolicy (Just AltJSON)
_sparPayload
computeService
where go
= buildClient
(Proxy :: Proxy SecurityPoliciesAddRuleResource)
mempty