{-# 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.Images.SetIAMPolicy
(
ImagesSetIAMPolicyResource
, imagesSetIAMPolicy
, ImagesSetIAMPolicy
, isiampProject
, isiampPayload
, isiampResource
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type ImagesSetIAMPolicyResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"images" :>
Capture "resource" Text :>
"setIamPolicy" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] GlobalSetPolicyRequest :>
Post '[JSON] Policy
data ImagesSetIAMPolicy = ImagesSetIAMPolicy'
{ _isiampProject :: !Text
, _isiampPayload :: !GlobalSetPolicyRequest
, _isiampResource :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
imagesSetIAMPolicy
:: Text
-> GlobalSetPolicyRequest
-> Text
-> ImagesSetIAMPolicy
imagesSetIAMPolicy pIsiampProject_ pIsiampPayload_ pIsiampResource_ =
ImagesSetIAMPolicy'
{ _isiampProject = pIsiampProject_
, _isiampPayload = pIsiampPayload_
, _isiampResource = pIsiampResource_
}
isiampProject :: Lens' ImagesSetIAMPolicy Text
isiampProject
= lens _isiampProject
(\ s a -> s{_isiampProject = a})
isiampPayload :: Lens' ImagesSetIAMPolicy GlobalSetPolicyRequest
isiampPayload
= lens _isiampPayload
(\ s a -> s{_isiampPayload = a})
isiampResource :: Lens' ImagesSetIAMPolicy Text
isiampResource
= lens _isiampResource
(\ s a -> s{_isiampResource = a})
instance GoogleRequest ImagesSetIAMPolicy where
type Rs ImagesSetIAMPolicy = Policy
type Scopes ImagesSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient ImagesSetIAMPolicy'{..}
= go _isiampProject _isiampResource (Just AltJSON)
_isiampPayload
computeService
where go
= buildClient
(Proxy :: Proxy ImagesSetIAMPolicyResource)
mempty