{-# 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.Advertisers.Insert
(
AdvertisersInsertResource
, advertisersInsert
, AdvertisersInsert
, aiiProFileId
, aiiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type AdvertisersInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"advertisers" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Advertiser :> Post '[JSON] Advertiser
data AdvertisersInsert = AdvertisersInsert'
{ _aiiProFileId :: !(Textual Int64)
, _aiiPayload :: !Advertiser
} deriving (Eq,Show,Data,Typeable,Generic)
advertisersInsert
:: Int64
-> Advertiser
-> AdvertisersInsert
advertisersInsert pAiiProFileId_ pAiiPayload_ =
AdvertisersInsert'
{ _aiiProFileId = _Coerce # pAiiProFileId_
, _aiiPayload = pAiiPayload_
}
aiiProFileId :: Lens' AdvertisersInsert Int64
aiiProFileId
= lens _aiiProFileId (\ s a -> s{_aiiProFileId = a})
. _Coerce
aiiPayload :: Lens' AdvertisersInsert Advertiser
aiiPayload
= lens _aiiPayload (\ s a -> s{_aiiPayload = a})
instance GoogleRequest AdvertisersInsert where
type Rs AdvertisersInsert = Advertiser
type Scopes AdvertisersInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient AdvertisersInsert'{..}
= go _aiiProFileId (Just AltJSON) _aiiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy AdvertisersInsertResource)
mempty