{-# 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.Pull
(
ProjectsSubscriptionsPullResource
, projectsSubscriptionsPull
, ProjectsSubscriptionsPull
, pspsXgafv
, pspsUploadProtocol
, pspsAccessToken
, pspsUploadType
, pspsPayload
, pspsSubscription
, pspsCallback
) where
import Network.Google.Prelude
import Network.Google.PubSub.Types
type ProjectsSubscriptionsPullResource =
"v1" :>
CaptureMode "subscription" "pull" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PullRequest :>
Post '[JSON] PullResponse
data ProjectsSubscriptionsPull = ProjectsSubscriptionsPull'
{ _pspsXgafv :: !(Maybe Xgafv)
, _pspsUploadProtocol :: !(Maybe Text)
, _pspsAccessToken :: !(Maybe Text)
, _pspsUploadType :: !(Maybe Text)
, _pspsPayload :: !PullRequest
, _pspsSubscription :: !Text
, _pspsCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsSubscriptionsPull
:: PullRequest
-> Text
-> ProjectsSubscriptionsPull
projectsSubscriptionsPull pPspsPayload_ pPspsSubscription_ =
ProjectsSubscriptionsPull'
{ _pspsXgafv = Nothing
, _pspsUploadProtocol = Nothing
, _pspsAccessToken = Nothing
, _pspsUploadType = Nothing
, _pspsPayload = pPspsPayload_
, _pspsSubscription = pPspsSubscription_
, _pspsCallback = Nothing
}
pspsXgafv :: Lens' ProjectsSubscriptionsPull (Maybe Xgafv)
pspsXgafv
= lens _pspsXgafv (\ s a -> s{_pspsXgafv = a})
pspsUploadProtocol :: Lens' ProjectsSubscriptionsPull (Maybe Text)
pspsUploadProtocol
= lens _pspsUploadProtocol
(\ s a -> s{_pspsUploadProtocol = a})
pspsAccessToken :: Lens' ProjectsSubscriptionsPull (Maybe Text)
pspsAccessToken
= lens _pspsAccessToken
(\ s a -> s{_pspsAccessToken = a})
pspsUploadType :: Lens' ProjectsSubscriptionsPull (Maybe Text)
pspsUploadType
= lens _pspsUploadType
(\ s a -> s{_pspsUploadType = a})
pspsPayload :: Lens' ProjectsSubscriptionsPull PullRequest
pspsPayload
= lens _pspsPayload (\ s a -> s{_pspsPayload = a})
pspsSubscription :: Lens' ProjectsSubscriptionsPull Text
pspsSubscription
= lens _pspsSubscription
(\ s a -> s{_pspsSubscription = a})
pspsCallback :: Lens' ProjectsSubscriptionsPull (Maybe Text)
pspsCallback
= lens _pspsCallback (\ s a -> s{_pspsCallback = a})
instance GoogleRequest ProjectsSubscriptionsPull
where
type Rs ProjectsSubscriptionsPull = PullResponse
type Scopes ProjectsSubscriptionsPull =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"]
requestClient ProjectsSubscriptionsPull'{..}
= go _pspsSubscription _pspsXgafv _pspsUploadProtocol
_pspsAccessToken
_pspsUploadType
_pspsCallback
(Just AltJSON)
_pspsPayload
pubSubService
where go
= buildClient
(Proxy :: Proxy ProjectsSubscriptionsPullResource)
mempty