{-# 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.Monitoring.Projects.TimeSeries.Create
(
ProjectsTimeSeriesCreateResource
, projectsTimeSeriesCreate
, ProjectsTimeSeriesCreate
, ptscXgafv
, ptscUploadProtocol
, ptscAccessToken
, ptscUploadType
, ptscPayload
, ptscName
, ptscCallback
) where
import Network.Google.Monitoring.Types
import Network.Google.Prelude
type ProjectsTimeSeriesCreateResource =
"v3" :>
Capture "name" Text :>
"timeSeries" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreateTimeSeriesRequest :>
Post '[JSON] Empty
data ProjectsTimeSeriesCreate = ProjectsTimeSeriesCreate'
{ _ptscXgafv :: !(Maybe Xgafv)
, _ptscUploadProtocol :: !(Maybe Text)
, _ptscAccessToken :: !(Maybe Text)
, _ptscUploadType :: !(Maybe Text)
, _ptscPayload :: !CreateTimeSeriesRequest
, _ptscName :: !Text
, _ptscCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsTimeSeriesCreate
:: CreateTimeSeriesRequest
-> Text
-> ProjectsTimeSeriesCreate
projectsTimeSeriesCreate pPtscPayload_ pPtscName_ =
ProjectsTimeSeriesCreate'
{ _ptscXgafv = Nothing
, _ptscUploadProtocol = Nothing
, _ptscAccessToken = Nothing
, _ptscUploadType = Nothing
, _ptscPayload = pPtscPayload_
, _ptscName = pPtscName_
, _ptscCallback = Nothing
}
ptscXgafv :: Lens' ProjectsTimeSeriesCreate (Maybe Xgafv)
ptscXgafv
= lens _ptscXgafv (\ s a -> s{_ptscXgafv = a})
ptscUploadProtocol :: Lens' ProjectsTimeSeriesCreate (Maybe Text)
ptscUploadProtocol
= lens _ptscUploadProtocol
(\ s a -> s{_ptscUploadProtocol = a})
ptscAccessToken :: Lens' ProjectsTimeSeriesCreate (Maybe Text)
ptscAccessToken
= lens _ptscAccessToken
(\ s a -> s{_ptscAccessToken = a})
ptscUploadType :: Lens' ProjectsTimeSeriesCreate (Maybe Text)
ptscUploadType
= lens _ptscUploadType
(\ s a -> s{_ptscUploadType = a})
ptscPayload :: Lens' ProjectsTimeSeriesCreate CreateTimeSeriesRequest
ptscPayload
= lens _ptscPayload (\ s a -> s{_ptscPayload = a})
ptscName :: Lens' ProjectsTimeSeriesCreate Text
ptscName = lens _ptscName (\ s a -> s{_ptscName = a})
ptscCallback :: Lens' ProjectsTimeSeriesCreate (Maybe Text)
ptscCallback
= lens _ptscCallback (\ s a -> s{_ptscCallback = a})
instance GoogleRequest ProjectsTimeSeriesCreate where
type Rs ProjectsTimeSeriesCreate = Empty
type Scopes ProjectsTimeSeriesCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/monitoring.write"]
requestClient ProjectsTimeSeriesCreate'{..}
= go _ptscName _ptscXgafv _ptscUploadProtocol
_ptscAccessToken
_ptscUploadType
_ptscCallback
(Just AltJSON)
_ptscPayload
monitoringService
where go
= buildClient
(Proxy :: Proxy ProjectsTimeSeriesCreateResource)
mempty