{-# 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.Get
(
ProjectsMetricsGetResource
, projectsMetricsGet
, ProjectsMetricsGet
, pmgXgafv
, pmgUploadProtocol
, pmgAccessToken
, pmgMetricName
, pmgUploadType
, pmgCallback
) where
import Network.Google.Logging.Types
import Network.Google.Prelude
type ProjectsMetricsGetResource =
"v2" :>
Capture "metricName" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] LogMetric
data ProjectsMetricsGet = ProjectsMetricsGet'
{ _pmgXgafv :: !(Maybe Xgafv)
, _pmgUploadProtocol :: !(Maybe Text)
, _pmgAccessToken :: !(Maybe Text)
, _pmgMetricName :: !Text
, _pmgUploadType :: !(Maybe Text)
, _pmgCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsMetricsGet
:: Text
-> ProjectsMetricsGet
projectsMetricsGet pPmgMetricName_ =
ProjectsMetricsGet'
{ _pmgXgafv = Nothing
, _pmgUploadProtocol = Nothing
, _pmgAccessToken = Nothing
, _pmgMetricName = pPmgMetricName_
, _pmgUploadType = Nothing
, _pmgCallback = Nothing
}
pmgXgafv :: Lens' ProjectsMetricsGet (Maybe Xgafv)
pmgXgafv = lens _pmgXgafv (\ s a -> s{_pmgXgafv = a})
pmgUploadProtocol :: Lens' ProjectsMetricsGet (Maybe Text)
pmgUploadProtocol
= lens _pmgUploadProtocol
(\ s a -> s{_pmgUploadProtocol = a})
pmgAccessToken :: Lens' ProjectsMetricsGet (Maybe Text)
pmgAccessToken
= lens _pmgAccessToken
(\ s a -> s{_pmgAccessToken = a})
pmgMetricName :: Lens' ProjectsMetricsGet Text
pmgMetricName
= lens _pmgMetricName
(\ s a -> s{_pmgMetricName = a})
pmgUploadType :: Lens' ProjectsMetricsGet (Maybe Text)
pmgUploadType
= lens _pmgUploadType
(\ s a -> s{_pmgUploadType = a})
pmgCallback :: Lens' ProjectsMetricsGet (Maybe Text)
pmgCallback
= lens _pmgCallback (\ s a -> s{_pmgCallback = a})
instance GoogleRequest ProjectsMetricsGet where
type Rs ProjectsMetricsGet = LogMetric
type Scopes ProjectsMetricsGet =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud-platform.read-only",
"https://www.googleapis.com/auth/logging.admin",
"https://www.googleapis.com/auth/logging.read"]
requestClient ProjectsMetricsGet'{..}
= go _pmgMetricName _pmgXgafv _pmgUploadProtocol
_pmgAccessToken
_pmgUploadType
_pmgCallback
(Just AltJSON)
loggingService
where go
= buildClient
(Proxy :: Proxy ProjectsMetricsGetResource)
mempty