{-# 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.CreativeGroups.Insert
(
CreativeGroupsInsertResource
, creativeGroupsInsert
, CreativeGroupsInsert
, cgiProFileId
, cgiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type CreativeGroupsInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"creativeGroups" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CreativeGroup :>
Post '[JSON] CreativeGroup
data CreativeGroupsInsert = CreativeGroupsInsert'
{ _cgiProFileId :: !(Textual Int64)
, _cgiPayload :: !CreativeGroup
} deriving (Eq,Show,Data,Typeable,Generic)
creativeGroupsInsert
:: Int64
-> CreativeGroup
-> CreativeGroupsInsert
creativeGroupsInsert pCgiProFileId_ pCgiPayload_ =
CreativeGroupsInsert'
{ _cgiProFileId = _Coerce # pCgiProFileId_
, _cgiPayload = pCgiPayload_
}
cgiProFileId :: Lens' CreativeGroupsInsert Int64
cgiProFileId
= lens _cgiProFileId (\ s a -> s{_cgiProFileId = a})
. _Coerce
cgiPayload :: Lens' CreativeGroupsInsert CreativeGroup
cgiPayload
= lens _cgiPayload (\ s a -> s{_cgiPayload = a})
instance GoogleRequest CreativeGroupsInsert where
type Rs CreativeGroupsInsert = CreativeGroup
type Scopes CreativeGroupsInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient CreativeGroupsInsert'{..}
= go _cgiProFileId (Just AltJSON) _cgiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy CreativeGroupsInsertResource)
mempty