{-# 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.Instances.SetIAMPolicy
(
InstancesSetIAMPolicyResource
, instancesSetIAMPolicy
, InstancesSetIAMPolicy
, isipProject
, isipZone
, isipPayload
, isipResource
) where
import Network.Google.Compute.Types
import Network.Google.Prelude
type InstancesSetIAMPolicyResource =
"compute" :>
"v1" :>
"projects" :>
Capture "project" Text :>
"zones" :>
Capture "zone" Text :>
"instances" :>
Capture "resource" Text :>
"setIamPolicy" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ZoneSetPolicyRequest :>
Post '[JSON] Policy
data InstancesSetIAMPolicy = InstancesSetIAMPolicy'
{ _isipProject :: !Text
, _isipZone :: !Text
, _isipPayload :: !ZoneSetPolicyRequest
, _isipResource :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
instancesSetIAMPolicy
:: Text
-> Text
-> ZoneSetPolicyRequest
-> Text
-> InstancesSetIAMPolicy
instancesSetIAMPolicy pIsipProject_ pIsipZone_ pIsipPayload_ pIsipResource_ =
InstancesSetIAMPolicy'
{ _isipProject = pIsipProject_
, _isipZone = pIsipZone_
, _isipPayload = pIsipPayload_
, _isipResource = pIsipResource_
}
isipProject :: Lens' InstancesSetIAMPolicy Text
isipProject
= lens _isipProject (\ s a -> s{_isipProject = a})
isipZone :: Lens' InstancesSetIAMPolicy Text
isipZone = lens _isipZone (\ s a -> s{_isipZone = a})
isipPayload :: Lens' InstancesSetIAMPolicy ZoneSetPolicyRequest
isipPayload
= lens _isipPayload (\ s a -> s{_isipPayload = a})
isipResource :: Lens' InstancesSetIAMPolicy Text
isipResource
= lens _isipResource (\ s a -> s{_isipResource = a})
instance GoogleRequest InstancesSetIAMPolicy where
type Rs InstancesSetIAMPolicy = Policy
type Scopes InstancesSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"]
requestClient InstancesSetIAMPolicy'{..}
= go _isipProject _isipZone _isipResource
(Just AltJSON)
_isipPayload
computeService
where go
= buildClient
(Proxy :: Proxy InstancesSetIAMPolicyResource)
mempty