{-# 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.CloudFunctions.Projects.Locations.Functions.Create
(
ProjectsLocationsFunctionsCreateResource
, projectsLocationsFunctionsCreate
, ProjectsLocationsFunctionsCreate
, plfcXgafv
, plfcUploadProtocol
, plfcLocation
, plfcAccessToken
, plfcUploadType
, plfcPayload
, plfcCallback
) where
import Network.Google.CloudFunctions.Types
import Network.Google.Prelude
type ProjectsLocationsFunctionsCreateResource =
"v1" :>
Capture "location" Text :>
"functions" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CloudFunction :>
Post '[JSON] Operation
data ProjectsLocationsFunctionsCreate = ProjectsLocationsFunctionsCreate'
{ _plfcXgafv :: !(Maybe Xgafv)
, _plfcUploadProtocol :: !(Maybe Text)
, _plfcLocation :: !Text
, _plfcAccessToken :: !(Maybe Text)
, _plfcUploadType :: !(Maybe Text)
, _plfcPayload :: !CloudFunction
, _plfcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsLocationsFunctionsCreate
:: Text
-> CloudFunction
-> ProjectsLocationsFunctionsCreate
projectsLocationsFunctionsCreate pPlfcLocation_ pPlfcPayload_ =
ProjectsLocationsFunctionsCreate'
{ _plfcXgafv = Nothing
, _plfcUploadProtocol = Nothing
, _plfcLocation = pPlfcLocation_
, _plfcAccessToken = Nothing
, _plfcUploadType = Nothing
, _plfcPayload = pPlfcPayload_
, _plfcCallback = Nothing
}
plfcXgafv :: Lens' ProjectsLocationsFunctionsCreate (Maybe Xgafv)
plfcXgafv
= lens _plfcXgafv (\ s a -> s{_plfcXgafv = a})
plfcUploadProtocol :: Lens' ProjectsLocationsFunctionsCreate (Maybe Text)
plfcUploadProtocol
= lens _plfcUploadProtocol
(\ s a -> s{_plfcUploadProtocol = a})
plfcLocation :: Lens' ProjectsLocationsFunctionsCreate Text
plfcLocation
= lens _plfcLocation (\ s a -> s{_plfcLocation = a})
plfcAccessToken :: Lens' ProjectsLocationsFunctionsCreate (Maybe Text)
plfcAccessToken
= lens _plfcAccessToken
(\ s a -> s{_plfcAccessToken = a})
plfcUploadType :: Lens' ProjectsLocationsFunctionsCreate (Maybe Text)
plfcUploadType
= lens _plfcUploadType
(\ s a -> s{_plfcUploadType = a})
plfcPayload :: Lens' ProjectsLocationsFunctionsCreate CloudFunction
plfcPayload
= lens _plfcPayload (\ s a -> s{_plfcPayload = a})
plfcCallback :: Lens' ProjectsLocationsFunctionsCreate (Maybe Text)
plfcCallback
= lens _plfcCallback (\ s a -> s{_plfcCallback = a})
instance GoogleRequest
ProjectsLocationsFunctionsCreate where
type Rs ProjectsLocationsFunctionsCreate = Operation
type Scopes ProjectsLocationsFunctionsCreate =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient ProjectsLocationsFunctionsCreate'{..}
= go _plfcLocation _plfcXgafv _plfcUploadProtocol
_plfcAccessToken
_plfcUploadType
_plfcCallback
(Just AltJSON)
_plfcPayload
cloudFunctionsService
where go
= buildClient
(Proxy ::
Proxy ProjectsLocationsFunctionsCreateResource)
mempty