{-# 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.CustomDimensions.Insert
(
ManagementCustomDimensionsInsertResource
, managementCustomDimensionsInsert
, ManagementCustomDimensionsInsert
, mcdiWebPropertyId
, mcdiPayload
, mcdiAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementCustomDimensionsInsertResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"customDimensions" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CustomDimension :>
Post '[JSON] CustomDimension
data ManagementCustomDimensionsInsert = ManagementCustomDimensionsInsert'
{ _mcdiWebPropertyId :: !Text
, _mcdiPayload :: !CustomDimension
, _mcdiAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementCustomDimensionsInsert
:: Text
-> CustomDimension
-> Text
-> ManagementCustomDimensionsInsert
managementCustomDimensionsInsert pMcdiWebPropertyId_ pMcdiPayload_ pMcdiAccountId_ =
ManagementCustomDimensionsInsert'
{ _mcdiWebPropertyId = pMcdiWebPropertyId_
, _mcdiPayload = pMcdiPayload_
, _mcdiAccountId = pMcdiAccountId_
}
mcdiWebPropertyId :: Lens' ManagementCustomDimensionsInsert Text
mcdiWebPropertyId
= lens _mcdiWebPropertyId
(\ s a -> s{_mcdiWebPropertyId = a})
mcdiPayload :: Lens' ManagementCustomDimensionsInsert CustomDimension
mcdiPayload
= lens _mcdiPayload (\ s a -> s{_mcdiPayload = a})
mcdiAccountId :: Lens' ManagementCustomDimensionsInsert Text
mcdiAccountId
= lens _mcdiAccountId
(\ s a -> s{_mcdiAccountId = a})
instance GoogleRequest
ManagementCustomDimensionsInsert where
type Rs ManagementCustomDimensionsInsert =
CustomDimension
type Scopes ManagementCustomDimensionsInsert =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementCustomDimensionsInsert'{..}
= go _mcdiAccountId _mcdiWebPropertyId (Just AltJSON)
_mcdiPayload
analyticsService
where go
= buildClient
(Proxy ::
Proxy ManagementCustomDimensionsInsertResource)
mempty