{-# 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.GenerateUploadURL
(
ProjectsLocationsFunctionsGenerateUploadURLResource
, projectsLocationsFunctionsGenerateUploadURL
, ProjectsLocationsFunctionsGenerateUploadURL
, plfguuParent
, plfguuXgafv
, plfguuUploadProtocol
, plfguuAccessToken
, plfguuUploadType
, plfguuPayload
, plfguuCallback
) where
import Network.Google.CloudFunctions.Types
import Network.Google.Prelude
type ProjectsLocationsFunctionsGenerateUploadURLResource
=
"v1" :>
Capture "parent" Text :>
"functions:generateUploadUrl" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] GenerateUploadURLRequest :>
Post '[JSON] GenerateUploadURLResponse
data ProjectsLocationsFunctionsGenerateUploadURL = ProjectsLocationsFunctionsGenerateUploadURL'
{ _plfguuParent :: !Text
, _plfguuXgafv :: !(Maybe Xgafv)
, _plfguuUploadProtocol :: !(Maybe Text)
, _plfguuAccessToken :: !(Maybe Text)
, _plfguuUploadType :: !(Maybe Text)
, _plfguuPayload :: !GenerateUploadURLRequest
, _plfguuCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsLocationsFunctionsGenerateUploadURL
:: Text
-> GenerateUploadURLRequest
-> ProjectsLocationsFunctionsGenerateUploadURL
projectsLocationsFunctionsGenerateUploadURL pPlfguuParent_ pPlfguuPayload_ =
ProjectsLocationsFunctionsGenerateUploadURL'
{ _plfguuParent = pPlfguuParent_
, _plfguuXgafv = Nothing
, _plfguuUploadProtocol = Nothing
, _plfguuAccessToken = Nothing
, _plfguuUploadType = Nothing
, _plfguuPayload = pPlfguuPayload_
, _plfguuCallback = Nothing
}
plfguuParent :: Lens' ProjectsLocationsFunctionsGenerateUploadURL Text
plfguuParent
= lens _plfguuParent (\ s a -> s{_plfguuParent = a})
plfguuXgafv :: Lens' ProjectsLocationsFunctionsGenerateUploadURL (Maybe Xgafv)
plfguuXgafv
= lens _plfguuXgafv (\ s a -> s{_plfguuXgafv = a})
plfguuUploadProtocol :: Lens' ProjectsLocationsFunctionsGenerateUploadURL (Maybe Text)
plfguuUploadProtocol
= lens _plfguuUploadProtocol
(\ s a -> s{_plfguuUploadProtocol = a})
plfguuAccessToken :: Lens' ProjectsLocationsFunctionsGenerateUploadURL (Maybe Text)
plfguuAccessToken
= lens _plfguuAccessToken
(\ s a -> s{_plfguuAccessToken = a})
plfguuUploadType :: Lens' ProjectsLocationsFunctionsGenerateUploadURL (Maybe Text)
plfguuUploadType
= lens _plfguuUploadType
(\ s a -> s{_plfguuUploadType = a})
plfguuPayload :: Lens' ProjectsLocationsFunctionsGenerateUploadURL GenerateUploadURLRequest
plfguuPayload
= lens _plfguuPayload
(\ s a -> s{_plfguuPayload = a})
plfguuCallback :: Lens' ProjectsLocationsFunctionsGenerateUploadURL (Maybe Text)
plfguuCallback
= lens _plfguuCallback
(\ s a -> s{_plfguuCallback = a})
instance GoogleRequest
ProjectsLocationsFunctionsGenerateUploadURL where
type Rs ProjectsLocationsFunctionsGenerateUploadURL =
GenerateUploadURLResponse
type Scopes
ProjectsLocationsFunctionsGenerateUploadURL
= '["https://www.googleapis.com/auth/cloud-platform"]
requestClient
ProjectsLocationsFunctionsGenerateUploadURL'{..}
= go _plfguuParent _plfguuXgafv _plfguuUploadProtocol
_plfguuAccessToken
_plfguuUploadType
_plfguuCallback
(Just AltJSON)
_plfguuPayload
cloudFunctionsService
where go
= buildClient
(Proxy ::
Proxy
ProjectsLocationsFunctionsGenerateUploadURLResource)
mempty