{-# 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.Insert
(
ManagementCustomMetricsInsertResource
, managementCustomMetricsInsert
, ManagementCustomMetricsInsert
, mcmiWebPropertyId
, mcmiPayload
, mcmiAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementCustomMetricsInsertResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"customMetrics" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CustomMetric :>
Post '[JSON] CustomMetric
data ManagementCustomMetricsInsert = ManagementCustomMetricsInsert'
{ _mcmiWebPropertyId :: !Text
, _mcmiPayload :: !CustomMetric
, _mcmiAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementCustomMetricsInsert
:: Text
-> CustomMetric
-> Text
-> ManagementCustomMetricsInsert
managementCustomMetricsInsert pMcmiWebPropertyId_ pMcmiPayload_ pMcmiAccountId_ =
ManagementCustomMetricsInsert'
{ _mcmiWebPropertyId = pMcmiWebPropertyId_
, _mcmiPayload = pMcmiPayload_
, _mcmiAccountId = pMcmiAccountId_
}
mcmiWebPropertyId :: Lens' ManagementCustomMetricsInsert Text
mcmiWebPropertyId
= lens _mcmiWebPropertyId
(\ s a -> s{_mcmiWebPropertyId = a})
mcmiPayload :: Lens' ManagementCustomMetricsInsert CustomMetric
mcmiPayload
= lens _mcmiPayload (\ s a -> s{_mcmiPayload = a})
mcmiAccountId :: Lens' ManagementCustomMetricsInsert Text
mcmiAccountId
= lens _mcmiAccountId
(\ s a -> s{_mcmiAccountId = a})
instance GoogleRequest ManagementCustomMetricsInsert
where
type Rs ManagementCustomMetricsInsert = CustomMetric
type Scopes ManagementCustomMetricsInsert =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementCustomMetricsInsert'{..}
= go _mcmiAccountId _mcmiWebPropertyId (Just AltJSON)
_mcmiPayload
analyticsService
where go
= buildClient
(Proxy ::
Proxy ManagementCustomMetricsInsertResource)
mempty