{-# 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.CreativeAssets.Insert
(
CreativeAssetsInsertResource
, creativeAssetsInsert
, CreativeAssetsInsert
, caiAdvertiserId
, caiProFileId
, caiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type CreativeAssetsInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"creativeAssets" :>
Capture "advertiserId" (Textual Int64) :>
"creativeAssets" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreativeAssetMetadata :>
Post '[JSON] CreativeAssetMetadata
:<|>
"upload" :>
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"creativeAssets" :>
Capture "advertiserId" (Textual Int64) :>
"creativeAssets" :>
QueryParam "alt" AltJSON :>
QueryParam "uploadType" Multipart :>
MultipartRelated '[JSON] CreativeAssetMetadata :>
Post '[JSON] CreativeAssetMetadata
data CreativeAssetsInsert = CreativeAssetsInsert'
{ _caiAdvertiserId :: !(Textual Int64)
, _caiProFileId :: !(Textual Int64)
, _caiPayload :: !CreativeAssetMetadata
} deriving (Eq,Show,Data,Typeable,Generic)
creativeAssetsInsert
:: Int64
-> Int64
-> CreativeAssetMetadata
-> CreativeAssetsInsert
creativeAssetsInsert pCaiAdvertiserId_ pCaiProFileId_ pCaiPayload_ =
CreativeAssetsInsert'
{ _caiAdvertiserId = _Coerce # pCaiAdvertiserId_
, _caiProFileId = _Coerce # pCaiProFileId_
, _caiPayload = pCaiPayload_
}
caiAdvertiserId :: Lens' CreativeAssetsInsert Int64
caiAdvertiserId
= lens _caiAdvertiserId
(\ s a -> s{_caiAdvertiserId = a})
. _Coerce
caiProFileId :: Lens' CreativeAssetsInsert Int64
caiProFileId
= lens _caiProFileId (\ s a -> s{_caiProFileId = a})
. _Coerce
caiPayload :: Lens' CreativeAssetsInsert CreativeAssetMetadata
caiPayload
= lens _caiPayload (\ s a -> s{_caiPayload = a})
instance GoogleRequest CreativeAssetsInsert where
type Rs CreativeAssetsInsert = CreativeAssetMetadata
type Scopes CreativeAssetsInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient CreativeAssetsInsert'{..}
= go _caiProFileId _caiAdvertiserId (Just AltJSON)
_caiPayload
dFAReportingService
where go :<|> _
= buildClient
(Proxy :: Proxy CreativeAssetsInsertResource)
mempty
instance GoogleRequest
(MediaUpload CreativeAssetsInsert) where
type Rs (MediaUpload CreativeAssetsInsert) =
CreativeAssetMetadata
type Scopes (MediaUpload CreativeAssetsInsert) =
Scopes CreativeAssetsInsert
requestClient
(MediaUpload CreativeAssetsInsert'{..} body)
= go _caiProFileId _caiAdvertiserId (Just AltJSON)
(Just Multipart)
_caiPayload
body
dFAReportingService
where _ :<|> go
= buildClient
(Proxy :: Proxy CreativeAssetsInsertResource)
mempty