{-# 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.DFAReporting.Campaigns.Patch
(
CampaignsPatchResource
, campaignsPatch
, CampaignsPatch
, cpProFileId
, cpPayload
, cpId
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type CampaignsPatchResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"campaigns" :>
QueryParam "id" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Campaign :> Patch '[JSON] Campaign
data CampaignsPatch = CampaignsPatch'
{ _cpProFileId :: !(Textual Int64)
, _cpPayload :: !Campaign
, _cpId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
campaignsPatch
:: Int64
-> Campaign
-> Int64
-> CampaignsPatch
campaignsPatch pCpProFileId_ pCpPayload_ pCpId_ =
CampaignsPatch'
{ _cpProFileId = _Coerce # pCpProFileId_
, _cpPayload = pCpPayload_
, _cpId = _Coerce # pCpId_
}
cpProFileId :: Lens' CampaignsPatch Int64
cpProFileId
= lens _cpProFileId (\ s a -> s{_cpProFileId = a}) .
_Coerce
cpPayload :: Lens' CampaignsPatch Campaign
cpPayload
= lens _cpPayload (\ s a -> s{_cpPayload = a})
cpId :: Lens' CampaignsPatch Int64
cpId = lens _cpId (\ s a -> s{_cpId = a}) . _Coerce
instance GoogleRequest CampaignsPatch where
type Rs CampaignsPatch = Campaign
type Scopes CampaignsPatch =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient CampaignsPatch'{..}
= go _cpProFileId (Just _cpId) (Just AltJSON)
_cpPayload
dFAReportingService
where go
= buildClient (Proxy :: Proxy CampaignsPatchResource)
mempty