{-# 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.Patch
(
ProjectsTopicsPatchResource
, projectsTopicsPatch
, ProjectsTopicsPatch
, ptpXgafv
, ptpUploadProtocol
, ptpAccessToken
, ptpUploadType
, ptpPayload
, ptpName
, ptpCallback
) where
import Network.Google.Prelude
import Network.Google.PubSub.Types
type ProjectsTopicsPatchResource =
"v1" :>
Capture "name" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] UpdateTopicRequest :>
Patch '[JSON] Topic
data ProjectsTopicsPatch = ProjectsTopicsPatch'
{ _ptpXgafv :: !(Maybe Xgafv)
, _ptpUploadProtocol :: !(Maybe Text)
, _ptpAccessToken :: !(Maybe Text)
, _ptpUploadType :: !(Maybe Text)
, _ptpPayload :: !UpdateTopicRequest
, _ptpName :: !Text
, _ptpCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsTopicsPatch
:: UpdateTopicRequest
-> Text
-> ProjectsTopicsPatch
projectsTopicsPatch pPtpPayload_ pPtpName_ =
ProjectsTopicsPatch'
{ _ptpXgafv = Nothing
, _ptpUploadProtocol = Nothing
, _ptpAccessToken = Nothing
, _ptpUploadType = Nothing
, _ptpPayload = pPtpPayload_
, _ptpName = pPtpName_
, _ptpCallback = Nothing
}
ptpXgafv :: Lens' ProjectsTopicsPatch (Maybe Xgafv)
ptpXgafv = lens _ptpXgafv (\ s a -> s{_ptpXgafv = a})
ptpUploadProtocol :: Lens' ProjectsTopicsPatch (Maybe Text)
ptpUploadProtocol
= lens _ptpUploadProtocol
(\ s a -> s{_ptpUploadProtocol = a})
ptpAccessToken :: Lens' ProjectsTopicsPatch (Maybe Text)
ptpAccessToken
= lens _ptpAccessToken
(\ s a -> s{_ptpAccessToken = a})
ptpUploadType :: Lens' ProjectsTopicsPatch (Maybe Text)
ptpUploadType
= lens _ptpUploadType
(\ s a -> s{_ptpUploadType = a})
ptpPayload :: Lens' ProjectsTopicsPatch UpdateTopicRequest
ptpPayload
= lens _ptpPayload (\ s a -> s{_ptpPayload = a})
ptpName :: Lens' ProjectsTopicsPatch Text
ptpName = lens _ptpName (\ s a -> s{_ptpName = a})
ptpCallback :: Lens' ProjectsTopicsPatch (Maybe Text)
ptpCallback
= lens _ptpCallback (\ s a -> s{_ptpCallback = a})
instance GoogleRequest ProjectsTopicsPatch where
type Rs ProjectsTopicsPatch = Topic
type Scopes ProjectsTopicsPatch =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"]
requestClient ProjectsTopicsPatch'{..}
= go _ptpName _ptpXgafv _ptpUploadProtocol
_ptpAccessToken
_ptpUploadType
_ptpCallback
(Just AltJSON)
_ptpPayload
pubSubService
where go
= buildClient
(Proxy :: Proxy ProjectsTopicsPatchResource)
mempty