{-# 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.Patch
(
SubAccountsPatchResource
, subAccountsPatch
, SubAccountsPatch
, sapProFileId
, sapPayload
, sapId
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type SubAccountsPatchResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"subaccounts" :>
QueryParam "id" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SubAccount :>
Patch '[JSON] SubAccount
data SubAccountsPatch = SubAccountsPatch'
{ _sapProFileId :: !(Textual Int64)
, _sapPayload :: !SubAccount
, _sapId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
subAccountsPatch
:: Int64
-> SubAccount
-> Int64
-> SubAccountsPatch
subAccountsPatch pSapProFileId_ pSapPayload_ pSapId_ =
SubAccountsPatch'
{ _sapProFileId = _Coerce # pSapProFileId_
, _sapPayload = pSapPayload_
, _sapId = _Coerce # pSapId_
}
sapProFileId :: Lens' SubAccountsPatch Int64
sapProFileId
= lens _sapProFileId (\ s a -> s{_sapProFileId = a})
. _Coerce
sapPayload :: Lens' SubAccountsPatch SubAccount
sapPayload
= lens _sapPayload (\ s a -> s{_sapPayload = a})
sapId :: Lens' SubAccountsPatch Int64
sapId
= lens _sapId (\ s a -> s{_sapId = a}) . _Coerce
instance GoogleRequest SubAccountsPatch where
type Rs SubAccountsPatch = SubAccount
type Scopes SubAccountsPatch =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient SubAccountsPatch'{..}
= go _sapProFileId (Just _sapId) (Just AltJSON)
_sapPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy SubAccountsPatchResource)
mempty