{-# 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.Budget.Patch
(
BudgetPatchResource
, budgetPatch
, BudgetPatch
, bpPayload
, bpAccountId
, bpBillingId
) where
import Network.Google.AdExchangeBuyer.Types
import Network.Google.Prelude
type BudgetPatchResource =
"adexchangebuyer" :>
"v1.4" :>
"billinginfo" :>
Capture "accountId" (Textual Int64) :>
Capture "billingId" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Budget :> Patch '[JSON] Budget
data BudgetPatch = BudgetPatch'
{ _bpPayload :: !Budget
, _bpAccountId :: !(Textual Int64)
, _bpBillingId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
budgetPatch
:: Budget
-> Int64
-> Int64
-> BudgetPatch
budgetPatch pBpPayload_ pBpAccountId_ pBpBillingId_ =
BudgetPatch'
{ _bpPayload = pBpPayload_
, _bpAccountId = _Coerce # pBpAccountId_
, _bpBillingId = _Coerce # pBpBillingId_
}
bpPayload :: Lens' BudgetPatch Budget
bpPayload
= lens _bpPayload (\ s a -> s{_bpPayload = a})
bpAccountId :: Lens' BudgetPatch Int64
bpAccountId
= lens _bpAccountId (\ s a -> s{_bpAccountId = a}) .
_Coerce
bpBillingId :: Lens' BudgetPatch Int64
bpBillingId
= lens _bpBillingId (\ s a -> s{_bpBillingId = a}) .
_Coerce
instance GoogleRequest BudgetPatch where
type Rs BudgetPatch = Budget
type Scopes BudgetPatch =
'["https://www.googleapis.com/auth/adexchange.buyer"]
requestClient BudgetPatch'{..}
= go _bpAccountId _bpBillingId (Just AltJSON)
_bpPayload
adExchangeBuyerService
where go
= buildClient (Proxy :: Proxy BudgetPatchResource)
mempty