{-# 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.CreativeFields.Insert
(
CreativeFieldsInsertResource
, creativeFieldsInsert
, CreativeFieldsInsert
, cfiProFileId
, cfiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type CreativeFieldsInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"creativeFields" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreativeField :>
Post '[JSON] CreativeField
data CreativeFieldsInsert = CreativeFieldsInsert'
{ _cfiProFileId :: !(Textual Int64)
, _cfiPayload :: !CreativeField
} deriving (Eq,Show,Data,Typeable,Generic)
creativeFieldsInsert
:: Int64
-> CreativeField
-> CreativeFieldsInsert
creativeFieldsInsert pCfiProFileId_ pCfiPayload_ =
CreativeFieldsInsert'
{ _cfiProFileId = _Coerce # pCfiProFileId_
, _cfiPayload = pCfiPayload_
}
cfiProFileId :: Lens' CreativeFieldsInsert Int64
cfiProFileId
= lens _cfiProFileId (\ s a -> s{_cfiProFileId = a})
. _Coerce
cfiPayload :: Lens' CreativeFieldsInsert CreativeField
cfiPayload
= lens _cfiPayload (\ s a -> s{_cfiPayload = a})
instance GoogleRequest CreativeFieldsInsert where
type Rs CreativeFieldsInsert = CreativeField
type Scopes CreativeFieldsInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient CreativeFieldsInsert'{..}
= go _cfiProFileId (Just AltJSON) _cfiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy CreativeFieldsInsertResource)
mempty