{-# 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.Analytics.Management.CustomMetrics.Update
(
ManagementCustomMetricsUpdateResource
, managementCustomMetricsUpdate
, ManagementCustomMetricsUpdate
, mcmuCustomMetricId
, mcmuWebPropertyId
, mcmuIgnoreCustomDataSourceLinks
, mcmuPayload
, mcmuAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementCustomMetricsUpdateResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"customMetrics" :>
Capture "customMetricId" Text :>
QueryParam "ignoreCustomDataSourceLinks" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CustomMetric :>
Put '[JSON] CustomMetric
data ManagementCustomMetricsUpdate = ManagementCustomMetricsUpdate'
{ _mcmuCustomMetricId :: !Text
, _mcmuWebPropertyId :: !Text
, _mcmuIgnoreCustomDataSourceLinks :: !Bool
, _mcmuPayload :: !CustomMetric
, _mcmuAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementCustomMetricsUpdate
:: Text
-> Text
-> CustomMetric
-> Text
-> ManagementCustomMetricsUpdate
managementCustomMetricsUpdate pMcmuCustomMetricId_ pMcmuWebPropertyId_ pMcmuPayload_ pMcmuAccountId_ =
ManagementCustomMetricsUpdate'
{ _mcmuCustomMetricId = pMcmuCustomMetricId_
, _mcmuWebPropertyId = pMcmuWebPropertyId_
, _mcmuIgnoreCustomDataSourceLinks = False
, _mcmuPayload = pMcmuPayload_
, _mcmuAccountId = pMcmuAccountId_
}
mcmuCustomMetricId :: Lens' ManagementCustomMetricsUpdate Text
mcmuCustomMetricId
= lens _mcmuCustomMetricId
(\ s a -> s{_mcmuCustomMetricId = a})
mcmuWebPropertyId :: Lens' ManagementCustomMetricsUpdate Text
mcmuWebPropertyId
= lens _mcmuWebPropertyId
(\ s a -> s{_mcmuWebPropertyId = a})
mcmuIgnoreCustomDataSourceLinks :: Lens' ManagementCustomMetricsUpdate Bool
mcmuIgnoreCustomDataSourceLinks
= lens _mcmuIgnoreCustomDataSourceLinks
(\ s a -> s{_mcmuIgnoreCustomDataSourceLinks = a})
mcmuPayload :: Lens' ManagementCustomMetricsUpdate CustomMetric
mcmuPayload
= lens _mcmuPayload (\ s a -> s{_mcmuPayload = a})
mcmuAccountId :: Lens' ManagementCustomMetricsUpdate Text
mcmuAccountId
= lens _mcmuAccountId
(\ s a -> s{_mcmuAccountId = a})
instance GoogleRequest ManagementCustomMetricsUpdate
where
type Rs ManagementCustomMetricsUpdate = CustomMetric
type Scopes ManagementCustomMetricsUpdate =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementCustomMetricsUpdate'{..}
= go _mcmuAccountId _mcmuWebPropertyId
_mcmuCustomMetricId
(Just _mcmuIgnoreCustomDataSourceLinks)
(Just AltJSON)
_mcmuPayload
analyticsService
where go
= buildClient
(Proxy ::
Proxy ManagementCustomMetricsUpdateResource)
mempty