{-# 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.AdSenseHost.CustomChannels.Insert
(
CustomChannelsInsertResource
, customChannelsInsert
, CustomChannelsInsert
, cciPayload
, cciAdClientId
) where
import Network.Google.AdSenseHost.Types
import Network.Google.Prelude
type CustomChannelsInsertResource =
"adsensehost" :>
"v4.1" :>
"adclients" :>
Capture "adClientId" Text :>
"customchannels" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] CustomChannel :>
Post '[JSON] CustomChannel
data CustomChannelsInsert = CustomChannelsInsert'
{ _cciPayload :: !CustomChannel
, _cciAdClientId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
customChannelsInsert
:: CustomChannel
-> Text
-> CustomChannelsInsert
customChannelsInsert pCciPayload_ pCciAdClientId_ =
CustomChannelsInsert'
{ _cciPayload = pCciPayload_
, _cciAdClientId = pCciAdClientId_
}
cciPayload :: Lens' CustomChannelsInsert CustomChannel
cciPayload
= lens _cciPayload (\ s a -> s{_cciPayload = a})
cciAdClientId :: Lens' CustomChannelsInsert Text
cciAdClientId
= lens _cciAdClientId
(\ s a -> s{_cciAdClientId = a})
instance GoogleRequest CustomChannelsInsert where
type Rs CustomChannelsInsert = CustomChannel
type Scopes CustomChannelsInsert =
'["https://www.googleapis.com/auth/adsensehost"]
requestClient CustomChannelsInsert'{..}
= go _cciAdClientId (Just AltJSON) _cciPayload
adSenseHostService
where go
= buildClient
(Proxy :: Proxy CustomChannelsInsertResource)
mempty