{-# 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.Publish
(
ProjectsTopicsPublishResource
, projectsTopicsPublish
, ProjectsTopicsPublish
, ptptXgafv
, ptptUploadProtocol
, ptptAccessToken
, ptptUploadType
, ptptPayload
, ptptTopic
, ptptCallback
) where
import Network.Google.Prelude
import Network.Google.PubSub.Types
type ProjectsTopicsPublishResource =
"v1" :>
CaptureMode "topic" "publish" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PublishRequest :>
Post '[JSON] PublishResponse
data ProjectsTopicsPublish = ProjectsTopicsPublish'
{ _ptptXgafv :: !(Maybe Xgafv)
, _ptptUploadProtocol :: !(Maybe Text)
, _ptptAccessToken :: !(Maybe Text)
, _ptptUploadType :: !(Maybe Text)
, _ptptPayload :: !PublishRequest
, _ptptTopic :: !Text
, _ptptCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsTopicsPublish
:: PublishRequest
-> Text
-> ProjectsTopicsPublish
projectsTopicsPublish pPtptPayload_ pPtptTopic_ =
ProjectsTopicsPublish'
{ _ptptXgafv = Nothing
, _ptptUploadProtocol = Nothing
, _ptptAccessToken = Nothing
, _ptptUploadType = Nothing
, _ptptPayload = pPtptPayload_
, _ptptTopic = pPtptTopic_
, _ptptCallback = Nothing
}
ptptXgafv :: Lens' ProjectsTopicsPublish (Maybe Xgafv)
ptptXgafv
= lens _ptptXgafv (\ s a -> s{_ptptXgafv = a})
ptptUploadProtocol :: Lens' ProjectsTopicsPublish (Maybe Text)
ptptUploadProtocol
= lens _ptptUploadProtocol
(\ s a -> s{_ptptUploadProtocol = a})
ptptAccessToken :: Lens' ProjectsTopicsPublish (Maybe Text)
ptptAccessToken
= lens _ptptAccessToken
(\ s a -> s{_ptptAccessToken = a})
ptptUploadType :: Lens' ProjectsTopicsPublish (Maybe Text)
ptptUploadType
= lens _ptptUploadType
(\ s a -> s{_ptptUploadType = a})
ptptPayload :: Lens' ProjectsTopicsPublish PublishRequest
ptptPayload
= lens _ptptPayload (\ s a -> s{_ptptPayload = a})
ptptTopic :: Lens' ProjectsTopicsPublish Text
ptptTopic
= lens _ptptTopic (\ s a -> s{_ptptTopic = a})
ptptCallback :: Lens' ProjectsTopicsPublish (Maybe Text)
ptptCallback
= lens _ptptCallback (\ s a -> s{_ptptCallback = a})
instance GoogleRequest ProjectsTopicsPublish where
type Rs ProjectsTopicsPublish = PublishResponse
type Scopes ProjectsTopicsPublish =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"]
requestClient ProjectsTopicsPublish'{..}
= go _ptptTopic _ptptXgafv _ptptUploadProtocol
_ptptAccessToken
_ptptUploadType
_ptptCallback
(Just AltJSON)
_ptptPayload
pubSubService
where go
= buildClient
(Proxy :: Proxy ProjectsTopicsPublishResource)
mempty