{-# 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.Campaigns.Insert
(
CampaignsInsertResource
, campaignsInsert
, CampaignsInsert
, camProFileId
, camPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type CampaignsInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"campaigns" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Campaign :> Post '[JSON] Campaign
data CampaignsInsert = CampaignsInsert'
{ _camProFileId :: !(Textual Int64)
, _camPayload :: !Campaign
} deriving (Eq,Show,Data,Typeable,Generic)
campaignsInsert
:: Int64
-> Campaign
-> CampaignsInsert
campaignsInsert pCamProFileId_ pCamPayload_ =
CampaignsInsert'
{ _camProFileId = _Coerce # pCamProFileId_
, _camPayload = pCamPayload_
}
camProFileId :: Lens' CampaignsInsert Int64
camProFileId
= lens _camProFileId (\ s a -> s{_camProFileId = a})
. _Coerce
camPayload :: Lens' CampaignsInsert Campaign
camPayload
= lens _camPayload (\ s a -> s{_camPayload = a})
instance GoogleRequest CampaignsInsert where
type Rs CampaignsInsert = Campaign
type Scopes CampaignsInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient CampaignsInsert'{..}
= go _camProFileId (Just AltJSON) _camPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy CampaignsInsertResource)
mempty