{-# 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.DynamicTargetingKeys.Insert
(
DynamicTargetingKeysInsertResource
, dynamicTargetingKeysInsert
, DynamicTargetingKeysInsert
, dtkiProFileId
, dtkiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type DynamicTargetingKeysInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"dynamicTargetingKeys" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] DynamicTargetingKey :>
Post '[JSON] DynamicTargetingKey
data DynamicTargetingKeysInsert = DynamicTargetingKeysInsert'
{ _dtkiProFileId :: !(Textual Int64)
, _dtkiPayload :: !DynamicTargetingKey
} deriving (Eq,Show,Data,Typeable,Generic)
dynamicTargetingKeysInsert
:: Int64
-> DynamicTargetingKey
-> DynamicTargetingKeysInsert
dynamicTargetingKeysInsert pDtkiProFileId_ pDtkiPayload_ =
DynamicTargetingKeysInsert'
{ _dtkiProFileId = _Coerce # pDtkiProFileId_
, _dtkiPayload = pDtkiPayload_
}
dtkiProFileId :: Lens' DynamicTargetingKeysInsert Int64
dtkiProFileId
= lens _dtkiProFileId
(\ s a -> s{_dtkiProFileId = a})
. _Coerce
dtkiPayload :: Lens' DynamicTargetingKeysInsert DynamicTargetingKey
dtkiPayload
= lens _dtkiPayload (\ s a -> s{_dtkiPayload = a})
instance GoogleRequest DynamicTargetingKeysInsert
where
type Rs DynamicTargetingKeysInsert =
DynamicTargetingKey
type Scopes DynamicTargetingKeysInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient DynamicTargetingKeysInsert'{..}
= go _dtkiProFileId (Just AltJSON) _dtkiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy DynamicTargetingKeysInsertResource)
mempty