{-# 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.Creatives.Insert
(
CreativesInsertResource
, creativesInsert
, CreativesInsert
, ciProFileId
, ciPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type CreativesInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"creatives" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Creative :> Post '[JSON] Creative
data CreativesInsert = CreativesInsert'
{ _ciProFileId :: !(Textual Int64)
, _ciPayload :: !Creative
} deriving (Eq,Show,Data,Typeable,Generic)
creativesInsert
:: Int64
-> Creative
-> CreativesInsert
creativesInsert pCiProFileId_ pCiPayload_ =
CreativesInsert'
{ _ciProFileId = _Coerce # pCiProFileId_
, _ciPayload = pCiPayload_
}
ciProFileId :: Lens' CreativesInsert Int64
ciProFileId
= lens _ciProFileId (\ s a -> s{_ciProFileId = a}) .
_Coerce
ciPayload :: Lens' CreativesInsert Creative
ciPayload
= lens _ciPayload (\ s a -> s{_ciPayload = a})
instance GoogleRequest CreativesInsert where
type Rs CreativesInsert = Creative
type Scopes CreativesInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient CreativesInsert'{..}
= go _ciProFileId (Just AltJSON) _ciPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy CreativesInsertResource)
mempty