{-# 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.Goals.Insert
(
ManagementGoalsInsertResource
, managementGoalsInsert
, ManagementGoalsInsert
, mgiWebPropertyId
, mgiProFileId
, mgiPayload
, mgiAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementGoalsInsertResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"profiles" :>
Capture "profileId" Text :>
"goals" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Goal :> Post '[JSON] Goal
data ManagementGoalsInsert = ManagementGoalsInsert'
{ _mgiWebPropertyId :: !Text
, _mgiProFileId :: !Text
, _mgiPayload :: !Goal
, _mgiAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementGoalsInsert
:: Text
-> Text
-> Goal
-> Text
-> ManagementGoalsInsert
managementGoalsInsert pMgiWebPropertyId_ pMgiProFileId_ pMgiPayload_ pMgiAccountId_ =
ManagementGoalsInsert'
{ _mgiWebPropertyId = pMgiWebPropertyId_
, _mgiProFileId = pMgiProFileId_
, _mgiPayload = pMgiPayload_
, _mgiAccountId = pMgiAccountId_
}
mgiWebPropertyId :: Lens' ManagementGoalsInsert Text
mgiWebPropertyId
= lens _mgiWebPropertyId
(\ s a -> s{_mgiWebPropertyId = a})
mgiProFileId :: Lens' ManagementGoalsInsert Text
mgiProFileId
= lens _mgiProFileId (\ s a -> s{_mgiProFileId = a})
mgiPayload :: Lens' ManagementGoalsInsert Goal
mgiPayload
= lens _mgiPayload (\ s a -> s{_mgiPayload = a})
mgiAccountId :: Lens' ManagementGoalsInsert Text
mgiAccountId
= lens _mgiAccountId (\ s a -> s{_mgiAccountId = a})
instance GoogleRequest ManagementGoalsInsert where
type Rs ManagementGoalsInsert = Goal
type Scopes ManagementGoalsInsert =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementGoalsInsert'{..}
= go _mgiAccountId _mgiWebPropertyId _mgiProFileId
(Just AltJSON)
_mgiPayload
analyticsService
where go
= buildClient
(Proxy :: Proxy ManagementGoalsInsertResource)
mempty