{-# 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.AdExchangeBuyer.PretargetingConfig.Insert
(
PretargetingConfigInsertResource
, pretargetingConfigInsert
, PretargetingConfigInsert
, pciPayload
, pciAccountId
) where
import Network.Google.AdExchangeBuyer.Types
import Network.Google.Prelude
type PretargetingConfigInsertResource =
"adexchangebuyer" :>
"v1.4" :>
"pretargetingconfigs" :>
Capture "accountId" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] PretargetingConfig :>
Post '[JSON] PretargetingConfig
data PretargetingConfigInsert = PretargetingConfigInsert'
{ _pciPayload :: !PretargetingConfig
, _pciAccountId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
pretargetingConfigInsert
:: PretargetingConfig
-> Int64
-> PretargetingConfigInsert
pretargetingConfigInsert pPciPayload_ pPciAccountId_ =
PretargetingConfigInsert'
{ _pciPayload = pPciPayload_
, _pciAccountId = _Coerce # pPciAccountId_
}
pciPayload :: Lens' PretargetingConfigInsert PretargetingConfig
pciPayload
= lens _pciPayload (\ s a -> s{_pciPayload = a})
pciAccountId :: Lens' PretargetingConfigInsert Int64
pciAccountId
= lens _pciAccountId (\ s a -> s{_pciAccountId = a})
. _Coerce
instance GoogleRequest PretargetingConfigInsert where
type Rs PretargetingConfigInsert = PretargetingConfig
type Scopes PretargetingConfigInsert =
'["https://www.googleapis.com/auth/adexchange.buyer"]
requestClient PretargetingConfigInsert'{..}
= go _pciAccountId (Just AltJSON) _pciPayload
adExchangeBuyerService
where go
= buildClient
(Proxy :: Proxy PretargetingConfigInsertResource)
mempty