{-# 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.Create
(
ProjectsSubscriptionsCreateResource
, projectsSubscriptionsCreate
, ProjectsSubscriptionsCreate
, pscXgafv
, pscUploadProtocol
, pscAccessToken
, pscUploadType
, pscPayload
, pscName
, pscCallback
) where
import Network.Google.Prelude
import Network.Google.PubSub.Types
type ProjectsSubscriptionsCreateResource =
"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] Subscription :>
Put '[JSON] Subscription
data ProjectsSubscriptionsCreate = ProjectsSubscriptionsCreate'
{ _pscXgafv :: !(Maybe Xgafv)
, _pscUploadProtocol :: !(Maybe Text)
, _pscAccessToken :: !(Maybe Text)
, _pscUploadType :: !(Maybe Text)
, _pscPayload :: !Subscription
, _pscName :: !Text
, _pscCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsSubscriptionsCreate
:: Subscription
-> Text
-> ProjectsSubscriptionsCreate
projectsSubscriptionsCreate pPscPayload_ pPscName_ =
ProjectsSubscriptionsCreate'
{ _pscXgafv = Nothing
, _pscUploadProtocol = Nothing
, _pscAccessToken = Nothing
, _pscUploadType = Nothing
, _pscPayload = pPscPayload_
, _pscName = pPscName_
, _pscCallback = Nothing
}
pscXgafv :: Lens' ProjectsSubscriptionsCreate (Maybe Xgafv)
pscXgafv = lens _pscXgafv (\ s a -> s{_pscXgafv = a})
pscUploadProtocol :: Lens' ProjectsSubscriptionsCreate (Maybe Text)
pscUploadProtocol
= lens _pscUploadProtocol
(\ s a -> s{_pscUploadProtocol = a})
pscAccessToken :: Lens' ProjectsSubscriptionsCreate (Maybe Text)
pscAccessToken
= lens _pscAccessToken
(\ s a -> s{_pscAccessToken = a})
pscUploadType :: Lens' ProjectsSubscriptionsCreate (Maybe Text)
pscUploadType
= lens _pscUploadType
(\ s a -> s{_pscUploadType = a})
pscPayload :: Lens' ProjectsSubscriptionsCreate Subscription
pscPayload
= lens _pscPayload (\ s a -> s{_pscPayload = a})
pscName :: Lens' ProjectsSubscriptionsCreate Text
pscName = lens _pscName (\ s a -> s{_pscName = a})
pscCallback :: Lens' ProjectsSubscriptionsCreate (Maybe Text)
pscCallback
= lens _pscCallback (\ s a -> s{_pscCallback = a})
instance GoogleRequest ProjectsSubscriptionsCreate
where
type Rs ProjectsSubscriptionsCreate = Subscription
type Scopes ProjectsSubscriptionsCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/pubsub"]
requestClient ProjectsSubscriptionsCreate'{..}
= go _pscName _pscXgafv _pscUploadProtocol
_pscAccessToken
_pscUploadType
_pscCallback
(Just AltJSON)
_pscPayload
pubSubService
where go
= buildClient
(Proxy :: Proxy ProjectsSubscriptionsCreateResource)
mempty