{-# 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.URLChannels.Insert
(
URLChannelsInsertResource
, urlChannelsInsert
, URLChannelsInsert
, uciPayload
, uciAdClientId
) where
import Network.Google.AdSenseHost.Types
import Network.Google.Prelude
type URLChannelsInsertResource =
"adsensehost" :>
"v4.1" :>
"adclients" :>
Capture "adClientId" Text :>
"urlchannels" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] URLChannel :> Post '[JSON] URLChannel
data URLChannelsInsert = URLChannelsInsert'
{ _uciPayload :: !URLChannel
, _uciAdClientId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
urlChannelsInsert
:: URLChannel
-> Text
-> URLChannelsInsert
urlChannelsInsert pUciPayload_ pUciAdClientId_ =
URLChannelsInsert'
{ _uciPayload = pUciPayload_
, _uciAdClientId = pUciAdClientId_
}
uciPayload :: Lens' URLChannelsInsert URLChannel
uciPayload
= lens _uciPayload (\ s a -> s{_uciPayload = a})
uciAdClientId :: Lens' URLChannelsInsert Text
uciAdClientId
= lens _uciAdClientId
(\ s a -> s{_uciAdClientId = a})
instance GoogleRequest URLChannelsInsert where
type Rs URLChannelsInsert = URLChannel
type Scopes URLChannelsInsert =
'["https://www.googleapis.com/auth/adsensehost"]
requestClient URLChannelsInsert'{..}
= go _uciAdClientId (Just AltJSON) _uciPayload
adSenseHostService
where go
= buildClient
(Proxy :: Proxy URLChannelsInsertResource)
mempty