{-# 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.Insert
(
TargetingTemplatesInsertResource
, targetingTemplatesInsert
, TargetingTemplatesInsert
, ttiProFileId
, ttiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type TargetingTemplatesInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"targetingTemplates" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TargetingTemplate :>
Post '[JSON] TargetingTemplate
data TargetingTemplatesInsert = TargetingTemplatesInsert'
{ _ttiProFileId :: !(Textual Int64)
, _ttiPayload :: !TargetingTemplate
} deriving (Eq,Show,Data,Typeable,Generic)
targetingTemplatesInsert
:: Int64
-> TargetingTemplate
-> TargetingTemplatesInsert
targetingTemplatesInsert pTtiProFileId_ pTtiPayload_ =
TargetingTemplatesInsert'
{ _ttiProFileId = _Coerce # pTtiProFileId_
, _ttiPayload = pTtiPayload_
}
ttiProFileId :: Lens' TargetingTemplatesInsert Int64
ttiProFileId
= lens _ttiProFileId (\ s a -> s{_ttiProFileId = a})
. _Coerce
ttiPayload :: Lens' TargetingTemplatesInsert TargetingTemplate
ttiPayload
= lens _ttiPayload (\ s a -> s{_ttiPayload = a})
instance GoogleRequest TargetingTemplatesInsert where
type Rs TargetingTemplatesInsert = TargetingTemplate
type Scopes TargetingTemplatesInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient TargetingTemplatesInsert'{..}
= go _ttiProFileId (Just AltJSON) _ttiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy TargetingTemplatesInsertResource)
mempty