{-# 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.DFAReporting.SubAccounts.Update
(
SubAccountsUpdateResource
, subAccountsUpdate
, SubAccountsUpdate
, sauProFileId
, sauPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type SubAccountsUpdateResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"subaccounts" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SubAccount :> Put '[JSON] SubAccount
data SubAccountsUpdate = SubAccountsUpdate'
{ _sauProFileId :: !(Textual Int64)
, _sauPayload :: !SubAccount
} deriving (Eq,Show,Data,Typeable,Generic)
subAccountsUpdate
:: Int64
-> SubAccount
-> SubAccountsUpdate
subAccountsUpdate pSauProFileId_ pSauPayload_ =
SubAccountsUpdate'
{ _sauProFileId = _Coerce # pSauProFileId_
, _sauPayload = pSauPayload_
}
sauProFileId :: Lens' SubAccountsUpdate Int64
sauProFileId
= lens _sauProFileId (\ s a -> s{_sauProFileId = a})
. _Coerce
sauPayload :: Lens' SubAccountsUpdate SubAccount
sauPayload
= lens _sauPayload (\ s a -> s{_sauPayload = a})
instance GoogleRequest SubAccountsUpdate where
type Rs SubAccountsUpdate = SubAccount
type Scopes SubAccountsUpdate =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient SubAccountsUpdate'{..}
= go _sauProFileId (Just AltJSON) _sauPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy SubAccountsUpdateResource)
mempty