{-# 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.TargetingTemplates.Patch
(
TargetingTemplatesPatchResource
, targetingTemplatesPatch
, TargetingTemplatesPatch
, ttpProFileId
, ttpPayload
, ttpId
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type TargetingTemplatesPatchResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"targetingTemplates" :>
QueryParam "id" (Textual Int64) :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TargetingTemplate :>
Patch '[JSON] TargetingTemplate
data TargetingTemplatesPatch = TargetingTemplatesPatch'
{ _ttpProFileId :: !(Textual Int64)
, _ttpPayload :: !TargetingTemplate
, _ttpId :: !(Textual Int64)
} deriving (Eq,Show,Data,Typeable,Generic)
targetingTemplatesPatch
:: Int64
-> TargetingTemplate
-> Int64
-> TargetingTemplatesPatch
targetingTemplatesPatch pTtpProFileId_ pTtpPayload_ pTtpId_ =
TargetingTemplatesPatch'
{ _ttpProFileId = _Coerce # pTtpProFileId_
, _ttpPayload = pTtpPayload_
, _ttpId = _Coerce # pTtpId_
}
ttpProFileId :: Lens' TargetingTemplatesPatch Int64
ttpProFileId
= lens _ttpProFileId (\ s a -> s{_ttpProFileId = a})
. _Coerce
ttpPayload :: Lens' TargetingTemplatesPatch TargetingTemplate
ttpPayload
= lens _ttpPayload (\ s a -> s{_ttpPayload = a})
ttpId :: Lens' TargetingTemplatesPatch Int64
ttpId
= lens _ttpId (\ s a -> s{_ttpId = a}) . _Coerce
instance GoogleRequest TargetingTemplatesPatch where
type Rs TargetingTemplatesPatch = TargetingTemplate
type Scopes TargetingTemplatesPatch =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient TargetingTemplatesPatch'{..}
= go _ttpProFileId (Just _ttpId) (Just AltJSON)
_ttpPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy TargetingTemplatesPatchResource)
mempty