{-# 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.MarketplaceDeals.Insert
(
MarketplaceDealsInsertResource
, marketplaceDealsInsert
, MarketplaceDealsInsert
, mdiPayload
, mdiProposalId
) where
import Network.Google.AdExchangeBuyer.Types
import Network.Google.Prelude
type MarketplaceDealsInsertResource =
"adexchangebuyer" :>
"v1.4" :>
"proposals" :>
Capture "proposalId" Text :>
"deals" :>
"insert" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AddOrderDealsRequest :>
Post '[JSON] AddOrderDealsResponse
data MarketplaceDealsInsert = MarketplaceDealsInsert'
{ _mdiPayload :: !AddOrderDealsRequest
, _mdiProposalId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
marketplaceDealsInsert
:: AddOrderDealsRequest
-> Text
-> MarketplaceDealsInsert
marketplaceDealsInsert pMdiPayload_ pMdiProposalId_ =
MarketplaceDealsInsert'
{ _mdiPayload = pMdiPayload_
, _mdiProposalId = pMdiProposalId_
}
mdiPayload :: Lens' MarketplaceDealsInsert AddOrderDealsRequest
mdiPayload
= lens _mdiPayload (\ s a -> s{_mdiPayload = a})
mdiProposalId :: Lens' MarketplaceDealsInsert Text
mdiProposalId
= lens _mdiProposalId
(\ s a -> s{_mdiProposalId = a})
instance GoogleRequest MarketplaceDealsInsert where
type Rs MarketplaceDealsInsert =
AddOrderDealsResponse
type Scopes MarketplaceDealsInsert =
'["https://www.googleapis.com/auth/adexchange.buyer"]
requestClient MarketplaceDealsInsert'{..}
= go _mdiProposalId (Just AltJSON) _mdiPayload
adExchangeBuyerService
where go
= buildClient
(Proxy :: Proxy MarketplaceDealsInsertResource)
mempty