{-# 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.Snapshots.SetIAMPolicy
(
SnapshotsSetIAMPolicyResource
, snapshotsSetIAMPolicy
, SnapshotsSetIAMPolicy
, ssipProject
, ssipPayload
, ssipResource
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type SnapshotsSetIAMPolicyResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"global" :>
"snapshots" :>
Capture "resource" Text :>
"setIamPolicy" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] GlobalSetPolicyRequest :>
Post '[JSON] Policy
data SnapshotsSetIAMPolicy = SnapshotsSetIAMPolicy'
{ _ssipProject :: !Text
, _ssipPayload :: !GlobalSetPolicyRequest
, _ssipResource :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
snapshotsSetIAMPolicy
:: Text
-> GlobalSetPolicyRequest
-> Text
-> SnapshotsSetIAMPolicy
snapshotsSetIAMPolicy pSsipProject_ pSsipPayload_ pSsipResource_ =
SnapshotsSetIAMPolicy'
{ _ssipProject = pSsipProject_
, _ssipPayload = pSsipPayload_
, _ssipResource = pSsipResource_
}
ssipProject :: Lens' SnapshotsSetIAMPolicy Text
ssipProject
= lens _ssipProject (\ s a -> s{_ssipProject = a})
ssipPayload :: Lens' SnapshotsSetIAMPolicy GlobalSetPolicyRequest
ssipPayload
= lens _ssipPayload (\ s a -> s{_ssipPayload = a})
ssipResource :: Lens' SnapshotsSetIAMPolicy Text
ssipResource
= lens _ssipResource (\ s a -> s{_ssipResource = a})
instance GoogleRequest SnapshotsSetIAMPolicy where
type Rs SnapshotsSetIAMPolicy = Policy
type Scopes SnapshotsSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient SnapshotsSetIAMPolicy'{..}
= go _ssipProject _ssipResource (Just AltJSON)
_ssipPayload
computeService
where go
= buildClient
(Proxy :: Proxy SnapshotsSetIAMPolicyResource)
mempty