{-# 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.Create
(
ProjectsMetricsCreateResource
, projectsMetricsCreate
, ProjectsMetricsCreate
, pmcParent
, pmcXgafv
, pmcUploadProtocol
, pmcAccessToken
, pmcUploadType
, pmcPayload
, pmcCallback
) where
import Network.Google.Logging.Types
import Network.Google.Prelude
type ProjectsMetricsCreateResource =
"v2" :>
Capture "parent" Text :>
"metrics" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] LogMetric :> Post '[JSON] LogMetric
data ProjectsMetricsCreate = ProjectsMetricsCreate'
{ _pmcParent :: !Text
, _pmcXgafv :: !(Maybe Xgafv)
, _pmcUploadProtocol :: !(Maybe Text)
, _pmcAccessToken :: !(Maybe Text)
, _pmcUploadType :: !(Maybe Text)
, _pmcPayload :: !LogMetric
, _pmcCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsMetricsCreate
:: Text
-> LogMetric
-> ProjectsMetricsCreate
projectsMetricsCreate pPmcParent_ pPmcPayload_ =
ProjectsMetricsCreate'
{ _pmcParent = pPmcParent_
, _pmcXgafv = Nothing
, _pmcUploadProtocol = Nothing
, _pmcAccessToken = Nothing
, _pmcUploadType = Nothing
, _pmcPayload = pPmcPayload_
, _pmcCallback = Nothing
}
pmcParent :: Lens' ProjectsMetricsCreate Text
pmcParent
= lens _pmcParent (\ s a -> s{_pmcParent = a})
pmcXgafv :: Lens' ProjectsMetricsCreate (Maybe Xgafv)
pmcXgafv = lens _pmcXgafv (\ s a -> s{_pmcXgafv = a})
pmcUploadProtocol :: Lens' ProjectsMetricsCreate (Maybe Text)
pmcUploadProtocol
= lens _pmcUploadProtocol
(\ s a -> s{_pmcUploadProtocol = a})
pmcAccessToken :: Lens' ProjectsMetricsCreate (Maybe Text)
pmcAccessToken
= lens _pmcAccessToken
(\ s a -> s{_pmcAccessToken = a})
pmcUploadType :: Lens' ProjectsMetricsCreate (Maybe Text)
pmcUploadType
= lens _pmcUploadType
(\ s a -> s{_pmcUploadType = a})
pmcPayload :: Lens' ProjectsMetricsCreate LogMetric
pmcPayload
= lens _pmcPayload (\ s a -> s{_pmcPayload = a})
pmcCallback :: Lens' ProjectsMetricsCreate (Maybe Text)
pmcCallback
= lens _pmcCallback (\ s a -> s{_pmcCallback = a})
instance GoogleRequest ProjectsMetricsCreate where
type Rs ProjectsMetricsCreate = LogMetric
type Scopes ProjectsMetricsCreate =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/logging.admin",
"https://www.googleapis.com/auth/logging.write"]
requestClient ProjectsMetricsCreate'{..}
= go _pmcParent _pmcXgafv _pmcUploadProtocol
_pmcAccessToken
_pmcUploadType
_pmcCallback
(Just AltJSON)
_pmcPayload
loggingService
where go
= buildClient
(Proxy :: Proxy ProjectsMetricsCreateResource)
mempty