{-# 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.Patch
(
ManagementGoalsPatchResource
, managementGoalsPatch
, ManagementGoalsPatch
, mgpWebPropertyId
, mgpGoalId
, mgpProFileId
, mgpPayload
, mgpAccountId
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type ManagementGoalsPatchResource =
"analytics" :>
"v3" :>
"management" :>
"accounts" :>
Capture "accountId" Text :>
"webproperties" :>
Capture "webPropertyId" Text :>
"profiles" :>
Capture "profileId" Text :>
"goals" :>
Capture "goalId" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Goal :> Patch '[JSON] Goal
data ManagementGoalsPatch = ManagementGoalsPatch'
{ _mgpWebPropertyId :: !Text
, _mgpGoalId :: !Text
, _mgpProFileId :: !Text
, _mgpPayload :: !Goal
, _mgpAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
managementGoalsPatch
:: Text
-> Text
-> Text
-> Goal
-> Text
-> ManagementGoalsPatch
managementGoalsPatch pMgpWebPropertyId_ pMgpGoalId_ pMgpProFileId_ pMgpPayload_ pMgpAccountId_ =
ManagementGoalsPatch'
{ _mgpWebPropertyId = pMgpWebPropertyId_
, _mgpGoalId = pMgpGoalId_
, _mgpProFileId = pMgpProFileId_
, _mgpPayload = pMgpPayload_
, _mgpAccountId = pMgpAccountId_
}
mgpWebPropertyId :: Lens' ManagementGoalsPatch Text
mgpWebPropertyId
= lens _mgpWebPropertyId
(\ s a -> s{_mgpWebPropertyId = a})
mgpGoalId :: Lens' ManagementGoalsPatch Text
mgpGoalId
= lens _mgpGoalId (\ s a -> s{_mgpGoalId = a})
mgpProFileId :: Lens' ManagementGoalsPatch Text
mgpProFileId
= lens _mgpProFileId (\ s a -> s{_mgpProFileId = a})
mgpPayload :: Lens' ManagementGoalsPatch Goal
mgpPayload
= lens _mgpPayload (\ s a -> s{_mgpPayload = a})
mgpAccountId :: Lens' ManagementGoalsPatch Text
mgpAccountId
= lens _mgpAccountId (\ s a -> s{_mgpAccountId = a})
instance GoogleRequest ManagementGoalsPatch where
type Rs ManagementGoalsPatch = Goal
type Scopes ManagementGoalsPatch =
'["https://www.googleapis.com/auth/analytics.edit"]
requestClient ManagementGoalsPatch'{..}
= go _mgpAccountId _mgpWebPropertyId _mgpProFileId
_mgpGoalId
(Just AltJSON)
_mgpPayload
analyticsService
where go
= buildClient
(Proxy :: Proxy ManagementGoalsPatchResource)
mempty