{-# 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.InstanceTemplates.SetIAMPolicy
(
InstanceTemplatesSetIAMPolicyResource
, instanceTemplatesSetIAMPolicy
, InstanceTemplatesSetIAMPolicy
, itsipProject
, itsipPayload
, itsipResource
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type InstanceTemplatesSetIAMPolicyResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"instanceTemplates" :>
Capture "resource" Text :>
"setIamPolicy" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] GlobalSetPolicyRequest :>
Post '[JSON] Policy
data InstanceTemplatesSetIAMPolicy = InstanceTemplatesSetIAMPolicy'
{ _itsipProject :: !Text
, _itsipPayload :: !GlobalSetPolicyRequest
, _itsipResource :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
instanceTemplatesSetIAMPolicy
:: Text
-> GlobalSetPolicyRequest
-> Text
-> InstanceTemplatesSetIAMPolicy
instanceTemplatesSetIAMPolicy pItsipProject_ pItsipPayload_ pItsipResource_ =
InstanceTemplatesSetIAMPolicy'
{ _itsipProject = pItsipProject_
, _itsipPayload = pItsipPayload_
, _itsipResource = pItsipResource_
}
itsipProject :: Lens' InstanceTemplatesSetIAMPolicy Text
itsipProject
= lens _itsipProject (\ s a -> s{_itsipProject = a})
itsipPayload :: Lens' InstanceTemplatesSetIAMPolicy GlobalSetPolicyRequest
itsipPayload
= lens _itsipPayload (\ s a -> s{_itsipPayload = a})
itsipResource :: Lens' InstanceTemplatesSetIAMPolicy Text
itsipResource
= lens _itsipResource
(\ s a -> s{_itsipResource = a})
instance GoogleRequest InstanceTemplatesSetIAMPolicy
where
type Rs InstanceTemplatesSetIAMPolicy = Policy
type Scopes InstanceTemplatesSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient InstanceTemplatesSetIAMPolicy'{..}
= go _itsipProject _itsipResource (Just AltJSON)
_itsipPayload
computeService
where go
= buildClient
(Proxy ::
Proxy InstanceTemplatesSetIAMPolicyResource)
mempty