{-# 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.Creatives.AddDeal
(
CreativesAddDealResource
, creativesAddDeal
, CreativesAddDeal
, cadBuyerCreativeId
, cadDealId
, cadAccountId
) where
import Network.Google.AdExchangeBuyer.Types
import Network.Google.Prelude
type CreativesAddDealResource =
"adexchangebuyer" :>
"v1.4" :>
"creatives" :>
Capture "accountId" (Textual Int32) :>
Capture "buyerCreativeId" Text :>
"addDeal" :>
Capture "dealId" (Textual Int64) :>
QueryParam "alt" AltJSON :> Post '[JSON] ()
data CreativesAddDeal = CreativesAddDeal'
{ _cadBuyerCreativeId :: !Text
, _cadDealId :: !(Textual Int64)
, _cadAccountId :: !(Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
creativesAddDeal
:: Text
-> Int64
-> Int32
-> CreativesAddDeal
creativesAddDeal pCadBuyerCreativeId_ pCadDealId_ pCadAccountId_ =
CreativesAddDeal'
{ _cadBuyerCreativeId = pCadBuyerCreativeId_
, _cadDealId = _Coerce # pCadDealId_
, _cadAccountId = _Coerce # pCadAccountId_
}
cadBuyerCreativeId :: Lens' CreativesAddDeal Text
cadBuyerCreativeId
= lens _cadBuyerCreativeId
(\ s a -> s{_cadBuyerCreativeId = a})
cadDealId :: Lens' CreativesAddDeal Int64
cadDealId
= lens _cadDealId (\ s a -> s{_cadDealId = a}) .
_Coerce
cadAccountId :: Lens' CreativesAddDeal Int32
cadAccountId
= lens _cadAccountId (\ s a -> s{_cadAccountId = a})
. _Coerce
instance GoogleRequest CreativesAddDeal where
type Rs CreativesAddDeal = ()
type Scopes CreativesAddDeal =
'["https://www.googleapis.com/auth/adexchange.buyer"]
requestClient CreativesAddDeal'{..}
= go _cadAccountId _cadBuyerCreativeId _cadDealId
(Just AltJSON)
adExchangeBuyerService
where go
= buildClient
(Proxy :: Proxy CreativesAddDealResource)
mempty