{-# 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.GetRule
(
SecurityPoliciesGetRuleResource
, securityPoliciesGetRule
, SecurityPoliciesGetRule
, spgrPriority
, spgrProject
, spgrSecurityPolicy
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type SecurityPoliciesGetRuleResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"securityPolicies" :>
Capture "securityPolicy" Text :>
"getRule" :>
QueryParam "priority" (Textual Int32) :>
QueryParam "alt" AltJSON :>
Get '[JSON] SecurityPolicyRule
data SecurityPoliciesGetRule = SecurityPoliciesGetRule'
{ _spgrPriority :: !(Maybe (Textual Int32))
, _spgrProject :: !Text
, _spgrSecurityPolicy :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
securityPoliciesGetRule
:: Text
-> Text
-> SecurityPoliciesGetRule
securityPoliciesGetRule pSpgrProject_ pSpgrSecurityPolicy_ =
SecurityPoliciesGetRule'
{ _spgrPriority = Nothing
, _spgrProject = pSpgrProject_
, _spgrSecurityPolicy = pSpgrSecurityPolicy_
}
spgrPriority :: Lens' SecurityPoliciesGetRule (Maybe Int32)
spgrPriority
= lens _spgrPriority (\ s a -> s{_spgrPriority = a})
. mapping _Coerce
spgrProject :: Lens' SecurityPoliciesGetRule Text
spgrProject
= lens _spgrProject (\ s a -> s{_spgrProject = a})
spgrSecurityPolicy :: Lens' SecurityPoliciesGetRule Text
spgrSecurityPolicy
= lens _spgrSecurityPolicy
(\ s a -> s{_spgrSecurityPolicy = a})
instance GoogleRequest SecurityPoliciesGetRule where
type Rs SecurityPoliciesGetRule = SecurityPolicyRule
type Scopes SecurityPoliciesGetRule =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"]
requestClient SecurityPoliciesGetRule'{..}
= go _spgrProject _spgrSecurityPolicy _spgrPriority
(Just AltJSON)
computeService
where go
= buildClient
(Proxy :: Proxy SecurityPoliciesGetRuleResource)
mempty