{-# 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.Patch
(
ManagementCustomMetricsPatchResource
, managementCustomMetricsPatch
, ManagementCustomMetricsPatch
, mcmpCustomMetricId
, mcmpWebPropertyId
, mcmpIgnoreCustomDataSourceLinks
, mcmpPayload
, mcmpAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementCustomMetricsPatchResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"customMetrics" :>
Capture "customMetricId" Text :>
QueryParam "ignoreCustomDataSourceLinks" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CustomMetric :>
Patch '[JSON] CustomMetric
data ManagementCustomMetricsPatch = ManagementCustomMetricsPatch'
{ _mcmpCustomMetricId :: !Text
, _mcmpWebPropertyId :: !Text
, _mcmpIgnoreCustomDataSourceLinks :: !Bool
, _mcmpPayload :: !CustomMetric
, _mcmpAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementCustomMetricsPatch
:: Text
-> Text
-> CustomMetric
-> Text
-> ManagementCustomMetricsPatch
managementCustomMetricsPatch pMcmpCustomMetricId_ pMcmpWebPropertyId_ pMcmpPayload_ pMcmpAccountId_ =
ManagementCustomMetricsPatch'
{ _mcmpCustomMetricId = pMcmpCustomMetricId_
, _mcmpWebPropertyId = pMcmpWebPropertyId_
, _mcmpIgnoreCustomDataSourceLinks = False
, _mcmpPayload = pMcmpPayload_
, _mcmpAccountId = pMcmpAccountId_
}
mcmpCustomMetricId :: Lens' ManagementCustomMetricsPatch Text
mcmpCustomMetricId
= lens _mcmpCustomMetricId
(\ s a -> s{_mcmpCustomMetricId = a})
mcmpWebPropertyId :: Lens' ManagementCustomMetricsPatch Text
mcmpWebPropertyId
= lens _mcmpWebPropertyId
(\ s a -> s{_mcmpWebPropertyId = a})
mcmpIgnoreCustomDataSourceLinks :: Lens' ManagementCustomMetricsPatch Bool
mcmpIgnoreCustomDataSourceLinks
= lens _mcmpIgnoreCustomDataSourceLinks
(\ s a -> s{_mcmpIgnoreCustomDataSourceLinks = a})
mcmpPayload :: Lens' ManagementCustomMetricsPatch CustomMetric
mcmpPayload
= lens _mcmpPayload (\ s a -> s{_mcmpPayload = a})
mcmpAccountId :: Lens' ManagementCustomMetricsPatch Text
mcmpAccountId
= lens _mcmpAccountId
(\ s a -> s{_mcmpAccountId = a})
instance GoogleRequest ManagementCustomMetricsPatch
where
type Rs ManagementCustomMetricsPatch = CustomMetric
type Scopes ManagementCustomMetricsPatch =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementCustomMetricsPatch'{..}
= go _mcmpAccountId _mcmpWebPropertyId
_mcmpCustomMetricId
(Just _mcmpIgnoreCustomDataSourceLinks)
(Just AltJSON)
_mcmpPayload
analyticsService
where go
= buildClient
(Proxy :: Proxy ManagementCustomMetricsPatchResource)
mempty