{-# 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.MetricDescriptors.Create
(
ProjectsMetricDescriptorsCreateResource
, projectsMetricDescriptorsCreate
, ProjectsMetricDescriptorsCreate
, pmdcXgafv
, pmdcUploadProtocol
, pmdcAccessToken
, pmdcUploadType
, pmdcPayload
, pmdcName
, pmdcCallback
) where
import Network.Google.Monitoring.Types
import Network.Google.Prelude
type ProjectsMetricDescriptorsCreateResource =
"v3" :>
Capture "name" Text :>
"metricDescriptors" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] MetricDescriptor :>
Post '[JSON] MetricDescriptor
data ProjectsMetricDescriptorsCreate = ProjectsMetricDescriptorsCreate'
{ _pmdcXgafv :: !(Maybe Xgafv)
, _pmdcUploadProtocol :: !(Maybe Text)
, _pmdcAccessToken :: !(Maybe Text)
, _pmdcUploadType :: !(Maybe Text)
, _pmdcPayload :: !MetricDescriptor
, _pmdcName :: !Text
, _pmdcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsMetricDescriptorsCreate
:: MetricDescriptor
-> Text
-> ProjectsMetricDescriptorsCreate
projectsMetricDescriptorsCreate pPmdcPayload_ pPmdcName_ =
ProjectsMetricDescriptorsCreate'
{ _pmdcXgafv = Nothing
, _pmdcUploadProtocol = Nothing
, _pmdcAccessToken = Nothing
, _pmdcUploadType = Nothing
, _pmdcPayload = pPmdcPayload_
, _pmdcName = pPmdcName_
, _pmdcCallback = Nothing
}
pmdcXgafv :: Lens' ProjectsMetricDescriptorsCreate (Maybe Xgafv)
pmdcXgafv
= lens _pmdcXgafv (\ s a -> s{_pmdcXgafv = a})
pmdcUploadProtocol :: Lens' ProjectsMetricDescriptorsCreate (Maybe Text)
pmdcUploadProtocol
= lens _pmdcUploadProtocol
(\ s a -> s{_pmdcUploadProtocol = a})
pmdcAccessToken :: Lens' ProjectsMetricDescriptorsCreate (Maybe Text)
pmdcAccessToken
= lens _pmdcAccessToken
(\ s a -> s{_pmdcAccessToken = a})
pmdcUploadType :: Lens' ProjectsMetricDescriptorsCreate (Maybe Text)
pmdcUploadType
= lens _pmdcUploadType
(\ s a -> s{_pmdcUploadType = a})
pmdcPayload :: Lens' ProjectsMetricDescriptorsCreate MetricDescriptor
pmdcPayload
= lens _pmdcPayload (\ s a -> s{_pmdcPayload = a})
pmdcName :: Lens' ProjectsMetricDescriptorsCreate Text
pmdcName = lens _pmdcName (\ s a -> s{_pmdcName = a})
pmdcCallback :: Lens' ProjectsMetricDescriptorsCreate (Maybe Text)
pmdcCallback
= lens _pmdcCallback (\ s a -> s{_pmdcCallback = a})
instance GoogleRequest
ProjectsMetricDescriptorsCreate where
type Rs ProjectsMetricDescriptorsCreate =
MetricDescriptor
type Scopes ProjectsMetricDescriptorsCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/monitoring.write"]
requestClient ProjectsMetricDescriptorsCreate'{..}
= go _pmdcName _pmdcXgafv _pmdcUploadProtocol
_pmdcAccessToken
_pmdcUploadType
_pmdcCallback
(Just AltJSON)
_pmdcPayload
monitoringService
where go
= buildClient
(Proxy ::
Proxy ProjectsMetricDescriptorsCreateResource)
mempty