{-# 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.Insert
(
AdvertiserGroupsInsertResource
, advertiserGroupsInsert
, AdvertiserGroupsInsert
, agiProFileId
, agiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type AdvertiserGroupsInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"advertiserGroups" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AdvertiserGroup :>
Post '[JSON] AdvertiserGroup
data AdvertiserGroupsInsert = AdvertiserGroupsInsert'
{ _agiProFileId :: !(Textual Int64)
, _agiPayload :: !AdvertiserGroup
} deriving (Eq,Show,Data,Typeable,Generic)
advertiserGroupsInsert
:: Int64
-> AdvertiserGroup
-> AdvertiserGroupsInsert
advertiserGroupsInsert pAgiProFileId_ pAgiPayload_ =
AdvertiserGroupsInsert'
{ _agiProFileId = _Coerce # pAgiProFileId_
, _agiPayload = pAgiPayload_
}
agiProFileId :: Lens' AdvertiserGroupsInsert Int64
agiProFileId
= lens _agiProFileId (\ s a -> s{_agiProFileId = a})
. _Coerce
agiPayload :: Lens' AdvertiserGroupsInsert AdvertiserGroup
agiPayload
= lens _agiPayload (\ s a -> s{_agiPayload = a})
instance GoogleRequest AdvertiserGroupsInsert where
type Rs AdvertiserGroupsInsert = AdvertiserGroup
type Scopes AdvertiserGroupsInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient AdvertiserGroupsInsert'{..}
= go _agiProFileId (Just AltJSON) _agiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy AdvertiserGroupsInsertResource)
mempty