{-# 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.Patch
(
AccountsPatchResource
, accountsPatch
, AccountsPatch
, apPayload
, apConfirmUnsafeAccountChange
, apId
) where
import Network.Google.AdExchangeBuyer.Types
import Network.Google.Prelude
type AccountsPatchResource =
"adexchangebuyer" :>
"v1.4" :>
"accounts" :>
Capture "id" (Textual Int32) :>
QueryParam "confirmUnsafeAccountChange" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Account :> Patch '[JSON] Account
data AccountsPatch = AccountsPatch'
{ _apPayload :: !Account
, _apConfirmUnsafeAccountChange :: !(Maybe Bool)
, _apId :: !(Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
accountsPatch
:: Account
-> Int32
-> AccountsPatch
accountsPatch pApPayload_ pApId_ =
AccountsPatch'
{ _apPayload = pApPayload_
, _apConfirmUnsafeAccountChange = Nothing
, _apId = _Coerce # pApId_
}
apPayload :: Lens' AccountsPatch Account
apPayload
= lens _apPayload (\ s a -> s{_apPayload = a})
apConfirmUnsafeAccountChange :: Lens' AccountsPatch (Maybe Bool)
apConfirmUnsafeAccountChange
= lens _apConfirmUnsafeAccountChange
(\ s a -> s{_apConfirmUnsafeAccountChange = a})
apId :: Lens' AccountsPatch Int32
apId = lens _apId (\ s a -> s{_apId = a}) . _Coerce
instance GoogleRequest AccountsPatch where
type Rs AccountsPatch = Account
type Scopes AccountsPatch =
'["https://www.googleapis.com/auth/adexchange.buyer"]
requestClient AccountsPatch'{..}
= go _apId _apConfirmUnsafeAccountChange
(Just AltJSON)
_apPayload
adExchangeBuyerService
where go
= buildClient (Proxy :: Proxy AccountsPatchResource)
mempty