{-# 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.CloudProFiler.Projects.ProFiles.Create
(
ProjectsProFilesCreateResource
, projectsProFilesCreate
, ProjectsProFilesCreate
, ppfcParent
, ppfcXgafv
, ppfcUploadProtocol
, ppfcAccessToken
, ppfcUploadType
, ppfcPayload
, ppfcCallback
) where
import Network.Google.CloudProFiler.Types
import Network.Google.Prelude
type ProjectsProFilesCreateResource =
"v2" :>
Capture "parent" Text :>
"profiles" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateProFileRequest :>
Post '[JSON] ProFile
data ProjectsProFilesCreate = ProjectsProFilesCreate'
{ _ppfcParent :: !Text
, _ppfcXgafv :: !(Maybe Xgafv)
, _ppfcUploadProtocol :: !(Maybe Text)
, _ppfcAccessToken :: !(Maybe Text)
, _ppfcUploadType :: !(Maybe Text)
, _ppfcPayload :: !CreateProFileRequest
, _ppfcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsProFilesCreate
:: Text
-> CreateProFileRequest
-> ProjectsProFilesCreate
projectsProFilesCreate pPpfcParent_ pPpfcPayload_ =
ProjectsProFilesCreate'
{ _ppfcParent = pPpfcParent_
, _ppfcXgafv = Nothing
, _ppfcUploadProtocol = Nothing
, _ppfcAccessToken = Nothing
, _ppfcUploadType = Nothing
, _ppfcPayload = pPpfcPayload_
, _ppfcCallback = Nothing
}
ppfcParent :: Lens' ProjectsProFilesCreate Text
ppfcParent
= lens _ppfcParent (\ s a -> s{_ppfcParent = a})
ppfcXgafv :: Lens' ProjectsProFilesCreate (Maybe Xgafv)
ppfcXgafv
= lens _ppfcXgafv (\ s a -> s{_ppfcXgafv = a})
ppfcUploadProtocol :: Lens' ProjectsProFilesCreate (Maybe Text)
ppfcUploadProtocol
= lens _ppfcUploadProtocol
(\ s a -> s{_ppfcUploadProtocol = a})
ppfcAccessToken :: Lens' ProjectsProFilesCreate (Maybe Text)
ppfcAccessToken
= lens _ppfcAccessToken
(\ s a -> s{_ppfcAccessToken = a})
ppfcUploadType :: Lens' ProjectsProFilesCreate (Maybe Text)
ppfcUploadType
= lens _ppfcUploadType
(\ s a -> s{_ppfcUploadType = a})
ppfcPayload :: Lens' ProjectsProFilesCreate CreateProFileRequest
ppfcPayload
= lens _ppfcPayload (\ s a -> s{_ppfcPayload = a})
ppfcCallback :: Lens' ProjectsProFilesCreate (Maybe Text)
ppfcCallback
= lens _ppfcCallback (\ s a -> s{_ppfcCallback = a})
instance GoogleRequest ProjectsProFilesCreate where
type Rs ProjectsProFilesCreate = ProFile
type Scopes ProjectsProFilesCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/monitoring.write"]
requestClient ProjectsProFilesCreate'{..}
= go _ppfcParent _ppfcXgafv _ppfcUploadProtocol
_ppfcAccessToken
_ppfcUploadType
_ppfcCallback
(Just AltJSON)
_ppfcPayload
cloudProfilerService
where go
= buildClient
(Proxy :: Proxy ProjectsProFilesCreateResource)
mempty