{-# 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.AdvertiserGroups.Patch
(
AdvertiserGroupsPatchResource
, advertiserGroupsPatch
, AdvertiserGroupsPatch
, agpProFileId
, agpPayload
, agpId
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type AdvertiserGroupsPatchResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"advertiserGroups" :>
QueryParam "id" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AdvertiserGroup :>
Patch '[JSON] AdvertiserGroup
data AdvertiserGroupsPatch = AdvertiserGroupsPatch'
{ _agpProFileId :: !(Textual Int64)
, _agpPayload :: !AdvertiserGroup
, _agpId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
advertiserGroupsPatch
:: Int64
-> AdvertiserGroup
-> Int64
-> AdvertiserGroupsPatch
advertiserGroupsPatch pAgpProFileId_ pAgpPayload_ pAgpId_ =
AdvertiserGroupsPatch'
{ _agpProFileId = _Coerce # pAgpProFileId_
, _agpPayload = pAgpPayload_
, _agpId = _Coerce # pAgpId_
}
agpProFileId :: Lens' AdvertiserGroupsPatch Int64
agpProFileId
= lens _agpProFileId (\ s a -> s{_agpProFileId = a})
. _Coerce
agpPayload :: Lens' AdvertiserGroupsPatch AdvertiserGroup
agpPayload
= lens _agpPayload (\ s a -> s{_agpPayload = a})
agpId :: Lens' AdvertiserGroupsPatch Int64
agpId
= lens _agpId (\ s a -> s{_agpId = a}) . _Coerce
instance GoogleRequest AdvertiserGroupsPatch where
type Rs AdvertiserGroupsPatch = AdvertiserGroup
type Scopes AdvertiserGroupsPatch =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient AdvertiserGroupsPatch'{..}
= go _agpProFileId (Just _agpId) (Just AltJSON)
_agpPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy AdvertiserGroupsPatchResource)
mempty