{-# 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.IAM.Projects.ServiceAccounts.SetIAMPolicy
(
ProjectsServiceAccountsSetIAMPolicyResource
, projectsServiceAccountsSetIAMPolicy
, ProjectsServiceAccountsSetIAMPolicy
, psasipXgafv
, psasipUploadProtocol
, psasipAccessToken
, psasipUploadType
, psasipPayload
, psasipResource
, psasipCallback
) where
import Network.Google.IAM.Types
import Network.Google.Prelude
type ProjectsServiceAccountsSetIAMPolicyResource =
"v1" :>
CaptureMode "resource" "setIamPolicy" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SetIAMPolicyRequest :>
Post '[JSON] Policy
data ProjectsServiceAccountsSetIAMPolicy = ProjectsServiceAccountsSetIAMPolicy'
{ _psasipXgafv :: !(Maybe Xgafv)
, _psasipUploadProtocol :: !(Maybe Text)
, _psasipAccessToken :: !(Maybe Text)
, _psasipUploadType :: !(Maybe Text)
, _psasipPayload :: !SetIAMPolicyRequest
, _psasipResource :: !Text
, _psasipCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsServiceAccountsSetIAMPolicy
:: SetIAMPolicyRequest
-> Text
-> ProjectsServiceAccountsSetIAMPolicy
projectsServiceAccountsSetIAMPolicy pPsasipPayload_ pPsasipResource_ =
ProjectsServiceAccountsSetIAMPolicy'
{ _psasipXgafv = Nothing
, _psasipUploadProtocol = Nothing
, _psasipAccessToken = Nothing
, _psasipUploadType = Nothing
, _psasipPayload = pPsasipPayload_
, _psasipResource = pPsasipResource_
, _psasipCallback = Nothing
}
psasipXgafv :: Lens' ProjectsServiceAccountsSetIAMPolicy (Maybe Xgafv)
psasipXgafv
= lens _psasipXgafv (\ s a -> s{_psasipXgafv = a})
psasipUploadProtocol :: Lens' ProjectsServiceAccountsSetIAMPolicy (Maybe Text)
psasipUploadProtocol
= lens _psasipUploadProtocol
(\ s a -> s{_psasipUploadProtocol = a})
psasipAccessToken :: Lens' ProjectsServiceAccountsSetIAMPolicy (Maybe Text)
psasipAccessToken
= lens _psasipAccessToken
(\ s a -> s{_psasipAccessToken = a})
psasipUploadType :: Lens' ProjectsServiceAccountsSetIAMPolicy (Maybe Text)
psasipUploadType
= lens _psasipUploadType
(\ s a -> s{_psasipUploadType = a})
psasipPayload :: Lens' ProjectsServiceAccountsSetIAMPolicy SetIAMPolicyRequest
psasipPayload
= lens _psasipPayload
(\ s a -> s{_psasipPayload = a})
psasipResource :: Lens' ProjectsServiceAccountsSetIAMPolicy Text
psasipResource
= lens _psasipResource
(\ s a -> s{_psasipResource = a})
psasipCallback :: Lens' ProjectsServiceAccountsSetIAMPolicy (Maybe Text)
psasipCallback
= lens _psasipCallback
(\ s a -> s{_psasipCallback = a})
instance GoogleRequest
ProjectsServiceAccountsSetIAMPolicy where
type Rs ProjectsServiceAccountsSetIAMPolicy = Policy
type Scopes ProjectsServiceAccountsSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient
ProjectsServiceAccountsSetIAMPolicy'{..}
= go _psasipResource _psasipXgafv
_psasipUploadProtocol
_psasipAccessToken
_psasipUploadType
_psasipCallback
(Just AltJSON)
_psasipPayload
iAMService
where go
= buildClient
(Proxy ::
Proxy ProjectsServiceAccountsSetIAMPolicyResource)
mempty