{-# 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.Create
(
ProjectsTopicsCreateResource
, projectsTopicsCreate
, ProjectsTopicsCreate
, ptcXgafv
, ptcUploadProtocol
, ptcAccessToken
, ptcUploadType
, ptcPayload
, ptcName
, ptcCallback
) where
import Network.Google.Prelude
import Network.Google.PubSub.Types
type ProjectsTopicsCreateResource =
"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] Topic :> Put '[JSON] Topic
data ProjectsTopicsCreate = ProjectsTopicsCreate'
{ _ptcXgafv :: !(Maybe Xgafv)
, _ptcUploadProtocol :: !(Maybe Text)
, _ptcAccessToken :: !(Maybe Text)
, _ptcUploadType :: !(Maybe Text)
, _ptcPayload :: !Topic
, _ptcName :: !Text
, _ptcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsTopicsCreate
:: Topic
-> Text
-> ProjectsTopicsCreate
projectsTopicsCreate pPtcPayload_ pPtcName_ =
ProjectsTopicsCreate'
{ _ptcXgafv = Nothing
, _ptcUploadProtocol = Nothing
, _ptcAccessToken = Nothing
, _ptcUploadType = Nothing
, _ptcPayload = pPtcPayload_
, _ptcName = pPtcName_
, _ptcCallback = Nothing
}
ptcXgafv :: Lens' ProjectsTopicsCreate (Maybe Xgafv)
ptcXgafv = lens _ptcXgafv (\ s a -> s{_ptcXgafv = a})
ptcUploadProtocol :: Lens' ProjectsTopicsCreate (Maybe Text)
ptcUploadProtocol
= lens _ptcUploadProtocol
(\ s a -> s{_ptcUploadProtocol = a})
ptcAccessToken :: Lens' ProjectsTopicsCreate (Maybe Text)
ptcAccessToken
= lens _ptcAccessToken
(\ s a -> s{_ptcAccessToken = a})
ptcUploadType :: Lens' ProjectsTopicsCreate (Maybe Text)
ptcUploadType
= lens _ptcUploadType
(\ s a -> s{_ptcUploadType = a})
ptcPayload :: Lens' ProjectsTopicsCreate Topic
ptcPayload
= lens _ptcPayload (\ s a -> s{_ptcPayload = a})
ptcName :: Lens' ProjectsTopicsCreate Text
ptcName = lens _ptcName (\ s a -> s{_ptcName = a})
ptcCallback :: Lens' ProjectsTopicsCreate (Maybe Text)
ptcCallback
= lens _ptcCallback (\ s a -> s{_ptcCallback = a})
instance GoogleRequest ProjectsTopicsCreate where
type Rs ProjectsTopicsCreate = Topic
type Scopes ProjectsTopicsCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"]
requestClient ProjectsTopicsCreate'{..}
= go _ptcName _ptcXgafv _ptcUploadProtocol
_ptcAccessToken
_ptcUploadType
_ptcCallback
(Just AltJSON)
_ptcPayload
pubSubService
where go
= buildClient
(Proxy :: Proxy ProjectsTopicsCreateResource)
mempty