{-# 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.Accounts.Update
(
AccountsUpdateResource
, accountsUpdate
, AccountsUpdate
, auPayload
, auConfirmUnsafeAccountChange
, auId
) where
import Network.Google.AdExchangeBuyer.Types
import Network.Google.Prelude
type AccountsUpdateResource =
"adexchangebuyer" :>
"v1.4" :>
"accounts" :>
Capture "id" (Textual Int32) :>
QueryParam "confirmUnsafeAccountChange" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Account :> Put '[JSON] Account
data AccountsUpdate = AccountsUpdate'
{ _auPayload :: !Account
, _auConfirmUnsafeAccountChange :: !(Maybe Bool)
, _auId :: !(Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
accountsUpdate
:: Account
-> Int32
-> AccountsUpdate
accountsUpdate pAuPayload_ pAuId_ =
AccountsUpdate'
{ _auPayload = pAuPayload_
, _auConfirmUnsafeAccountChange = Nothing
, _auId = _Coerce # pAuId_
}
auPayload :: Lens' AccountsUpdate Account
auPayload
= lens _auPayload (\ s a -> s{_auPayload = a})
auConfirmUnsafeAccountChange :: Lens' AccountsUpdate (Maybe Bool)
auConfirmUnsafeAccountChange
= lens _auConfirmUnsafeAccountChange
(\ s a -> s{_auConfirmUnsafeAccountChange = a})
auId :: Lens' AccountsUpdate Int32
auId = lens _auId (\ s a -> s{_auId = a}) . _Coerce
instance GoogleRequest AccountsUpdate where
type Rs AccountsUpdate = Account
type Scopes AccountsUpdate =
'["https://www.googleapis.com/auth/adexchange.buyer"]
requestClient AccountsUpdate'{..}
= go _auId _auConfirmUnsafeAccountChange
(Just AltJSON)
_auPayload
adExchangeBuyerService
where go
= buildClient (Proxy :: Proxy AccountsUpdateResource)
mempty