{-# 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.Update
(
CampaignsUpdateResource
, campaignsUpdate
, CampaignsUpdate
, cuProFileId
, cuPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type CampaignsUpdateResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"campaigns" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Campaign :> Put '[JSON] Campaign
data CampaignsUpdate = CampaignsUpdate'
{ _cuProFileId :: !(Textual Int64)
, _cuPayload :: !Campaign
} deriving (Eq,Show,Data,Typeable,Generic)
campaignsUpdate
:: Int64
-> Campaign
-> CampaignsUpdate
campaignsUpdate pCuProFileId_ pCuPayload_ =
CampaignsUpdate'
{ _cuProFileId = _Coerce # pCuProFileId_
, _cuPayload = pCuPayload_
}
cuProFileId :: Lens' CampaignsUpdate Int64
cuProFileId
= lens _cuProFileId (\ s a -> s{_cuProFileId = a}) .
_Coerce
cuPayload :: Lens' CampaignsUpdate Campaign
cuPayload
= lens _cuPayload (\ s a -> s{_cuPayload = a})
instance GoogleRequest CampaignsUpdate where
type Rs CampaignsUpdate = Campaign
type Scopes CampaignsUpdate =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient CampaignsUpdate'{..}
= go _cuProFileId (Just AltJSON) _cuPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy CampaignsUpdateResource)
mempty