{-# 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.PubSub.Projects.Topics.SetIAMPolicy
(
ProjectsTopicsSetIAMPolicyResource
, projectsTopicsSetIAMPolicy
, ProjectsTopicsSetIAMPolicy
, ptsipXgafv
, ptsipUploadProtocol
, ptsipAccessToken
, ptsipUploadType
, ptsipPayload
, ptsipResource
, ptsipCallback
) where
import Network.Google.Prelude
import Network.Google.PubSub.Types
type ProjectsTopicsSetIAMPolicyResource =
"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 ProjectsTopicsSetIAMPolicy = ProjectsTopicsSetIAMPolicy'
{ _ptsipXgafv :: !(Maybe Xgafv)
, _ptsipUploadProtocol :: !(Maybe Text)
, _ptsipAccessToken :: !(Maybe Text)
, _ptsipUploadType :: !(Maybe Text)
, _ptsipPayload :: !SetIAMPolicyRequest
, _ptsipResource :: !Text
, _ptsipCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsTopicsSetIAMPolicy
:: SetIAMPolicyRequest
-> Text
-> ProjectsTopicsSetIAMPolicy
projectsTopicsSetIAMPolicy pPtsipPayload_ pPtsipResource_ =
ProjectsTopicsSetIAMPolicy'
{ _ptsipXgafv = Nothing
, _ptsipUploadProtocol = Nothing
, _ptsipAccessToken = Nothing
, _ptsipUploadType = Nothing
, _ptsipPayload = pPtsipPayload_
, _ptsipResource = pPtsipResource_
, _ptsipCallback = Nothing
}
ptsipXgafv :: Lens' ProjectsTopicsSetIAMPolicy (Maybe Xgafv)
ptsipXgafv
= lens _ptsipXgafv (\ s a -> s{_ptsipXgafv = a})
ptsipUploadProtocol :: Lens' ProjectsTopicsSetIAMPolicy (Maybe Text)
ptsipUploadProtocol
= lens _ptsipUploadProtocol
(\ s a -> s{_ptsipUploadProtocol = a})
ptsipAccessToken :: Lens' ProjectsTopicsSetIAMPolicy (Maybe Text)
ptsipAccessToken
= lens _ptsipAccessToken
(\ s a -> s{_ptsipAccessToken = a})
ptsipUploadType :: Lens' ProjectsTopicsSetIAMPolicy (Maybe Text)
ptsipUploadType
= lens _ptsipUploadType
(\ s a -> s{_ptsipUploadType = a})
ptsipPayload :: Lens' ProjectsTopicsSetIAMPolicy SetIAMPolicyRequest
ptsipPayload
= lens _ptsipPayload (\ s a -> s{_ptsipPayload = a})
ptsipResource :: Lens' ProjectsTopicsSetIAMPolicy Text
ptsipResource
= lens _ptsipResource
(\ s a -> s{_ptsipResource = a})
ptsipCallback :: Lens' ProjectsTopicsSetIAMPolicy (Maybe Text)
ptsipCallback
= lens _ptsipCallback
(\ s a -> s{_ptsipCallback = a})
instance GoogleRequest ProjectsTopicsSetIAMPolicy
where
type Rs ProjectsTopicsSetIAMPolicy = Policy
type Scopes ProjectsTopicsSetIAMPolicy =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"]
requestClient ProjectsTopicsSetIAMPolicy'{..}
= go _ptsipResource _ptsipXgafv _ptsipUploadProtocol
_ptsipAccessToken
_ptsipUploadType
_ptsipCallback
(Just AltJSON)
_ptsipPayload
pubSubService
where go
= buildClient
(Proxy :: Proxy ProjectsTopicsSetIAMPolicyResource)
mempty