{-# 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.Subscriptions.Patch
(
ProjectsSubscriptionsPatchResource
, projectsSubscriptionsPatch
, ProjectsSubscriptionsPatch
, pspXgafv
, pspUploadProtocol
, pspAccessToken
, pspUploadType
, pspPayload
, pspName
, pspCallback
) where
import Network.Google.Prelude
import Network.Google.PubSub.Types
type ProjectsSubscriptionsPatchResource =
"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] UpdateSubscriptionRequest :>
Patch '[JSON] Subscription
data ProjectsSubscriptionsPatch = ProjectsSubscriptionsPatch'
{ _pspXgafv :: !(Maybe Xgafv)
, _pspUploadProtocol :: !(Maybe Text)
, _pspAccessToken :: !(Maybe Text)
, _pspUploadType :: !(Maybe Text)
, _pspPayload :: !UpdateSubscriptionRequest
, _pspName :: !Text
, _pspCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsSubscriptionsPatch
:: UpdateSubscriptionRequest
-> Text
-> ProjectsSubscriptionsPatch
projectsSubscriptionsPatch pPspPayload_ pPspName_ =
ProjectsSubscriptionsPatch'
{ _pspXgafv = Nothing
, _pspUploadProtocol = Nothing
, _pspAccessToken = Nothing
, _pspUploadType = Nothing
, _pspPayload = pPspPayload_
, _pspName = pPspName_
, _pspCallback = Nothing
}
pspXgafv :: Lens' ProjectsSubscriptionsPatch (Maybe Xgafv)
pspXgafv = lens _pspXgafv (\ s a -> s{_pspXgafv = a})
pspUploadProtocol :: Lens' ProjectsSubscriptionsPatch (Maybe Text)
pspUploadProtocol
= lens _pspUploadProtocol
(\ s a -> s{_pspUploadProtocol = a})
pspAccessToken :: Lens' ProjectsSubscriptionsPatch (Maybe Text)
pspAccessToken
= lens _pspAccessToken
(\ s a -> s{_pspAccessToken = a})
pspUploadType :: Lens' ProjectsSubscriptionsPatch (Maybe Text)
pspUploadType
= lens _pspUploadType
(\ s a -> s{_pspUploadType = a})
pspPayload :: Lens' ProjectsSubscriptionsPatch UpdateSubscriptionRequest
pspPayload
= lens _pspPayload (\ s a -> s{_pspPayload = a})
pspName :: Lens' ProjectsSubscriptionsPatch Text
pspName = lens _pspName (\ s a -> s{_pspName = a})
pspCallback :: Lens' ProjectsSubscriptionsPatch (Maybe Text)
pspCallback
= lens _pspCallback (\ s a -> s{_pspCallback = a})
instance GoogleRequest ProjectsSubscriptionsPatch
where
type Rs ProjectsSubscriptionsPatch = Subscription
type Scopes ProjectsSubscriptionsPatch =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"]
requestClient ProjectsSubscriptionsPatch'{..}
= go _pspName _pspXgafv _pspUploadProtocol
_pspAccessToken
_pspUploadType
_pspCallback
(Just AltJSON)
_pspPayload
pubSubService
where go
= buildClient
(Proxy :: Proxy ProjectsSubscriptionsPatchResource)
mempty