{-# 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.Logging.Projects.Metrics.Update
(
ProjectsMetricsUpdateResource
, projectsMetricsUpdate
, ProjectsMetricsUpdate
, pmuXgafv
, pmuUploadProtocol
, pmuAccessToken
, pmuMetricName
, pmuUploadType
, pmuPayload
, pmuCallback
) where
import Network.Google.Logging.Types
import Network.Google.Prelude
type ProjectsMetricsUpdateResource =
"v2" :>
Capture "metricName" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] LogMetric :> Put '[JSON] LogMetric
data ProjectsMetricsUpdate = ProjectsMetricsUpdate'
{ _pmuXgafv :: !(Maybe Xgafv)
, _pmuUploadProtocol :: !(Maybe Text)
, _pmuAccessToken :: !(Maybe Text)
, _pmuMetricName :: !Text
, _pmuUploadType :: !(Maybe Text)
, _pmuPayload :: !LogMetric
, _pmuCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsMetricsUpdate
:: Text
-> LogMetric
-> ProjectsMetricsUpdate
projectsMetricsUpdate pPmuMetricName_ pPmuPayload_ =
ProjectsMetricsUpdate'
{ _pmuXgafv = Nothing
, _pmuUploadProtocol = Nothing
, _pmuAccessToken = Nothing
, _pmuMetricName = pPmuMetricName_
, _pmuUploadType = Nothing
, _pmuPayload = pPmuPayload_
, _pmuCallback = Nothing
}
pmuXgafv :: Lens' ProjectsMetricsUpdate (Maybe Xgafv)
pmuXgafv = lens _pmuXgafv (\ s a -> s{_pmuXgafv = a})
pmuUploadProtocol :: Lens' ProjectsMetricsUpdate (Maybe Text)
pmuUploadProtocol
= lens _pmuUploadProtocol
(\ s a -> s{_pmuUploadProtocol = a})
pmuAccessToken :: Lens' ProjectsMetricsUpdate (Maybe Text)
pmuAccessToken
= lens _pmuAccessToken
(\ s a -> s{_pmuAccessToken = a})
pmuMetricName :: Lens' ProjectsMetricsUpdate Text
pmuMetricName
= lens _pmuMetricName
(\ s a -> s{_pmuMetricName = a})
pmuUploadType :: Lens' ProjectsMetricsUpdate (Maybe Text)
pmuUploadType
= lens _pmuUploadType
(\ s a -> s{_pmuUploadType = a})
pmuPayload :: Lens' ProjectsMetricsUpdate LogMetric
pmuPayload
= lens _pmuPayload (\ s a -> s{_pmuPayload = a})
pmuCallback :: Lens' ProjectsMetricsUpdate (Maybe Text)
pmuCallback
= lens _pmuCallback (\ s a -> s{_pmuCallback = a})
instance GoogleRequest ProjectsMetricsUpdate where
type Rs ProjectsMetricsUpdate = LogMetric
type Scopes ProjectsMetricsUpdate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/logging.admin",
"https://www.googleapis.com/auth/logging.write"]
requestClient ProjectsMetricsUpdate'{..}
= go _pmuMetricName _pmuXgafv _pmuUploadProtocol
_pmuAccessToken
_pmuUploadType
_pmuCallback
(Just AltJSON)
_pmuPayload
loggingService
where go
= buildClient
(Proxy :: Proxy ProjectsMetricsUpdateResource)
mempty