{-# 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.Ads.Insert
(
AdsInsertResource
, adsInsert
, AdsInsert
, aiProFileId
, aiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type AdsInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"ads" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Ad :> Post '[JSON] Ad
data AdsInsert = AdsInsert'
{ _aiProFileId :: !(Textual Int64)
, _aiPayload :: !Ad
} deriving (Eq,Show,Data,Typeable,Generic)
adsInsert
:: Int64
-> Ad
-> AdsInsert
adsInsert pAiProFileId_ pAiPayload_ =
AdsInsert'
{ _aiProFileId = _Coerce # pAiProFileId_
, _aiPayload = pAiPayload_
}
aiProFileId :: Lens' AdsInsert Int64
aiProFileId
= lens _aiProFileId (\ s a -> s{_aiProFileId = a}) .
_Coerce
aiPayload :: Lens' AdsInsert Ad
aiPayload
= lens _aiPayload (\ s a -> s{_aiPayload = a})
instance GoogleRequest AdsInsert where
type Rs AdsInsert = Ad
type Scopes AdsInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient AdsInsert'{..}
= go _aiProFileId (Just AltJSON) _aiPayload
dFAReportingService
where go
= buildClient (Proxy :: Proxy AdsInsertResource)
mempty