{-# 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.Accounts.AdUnits.GetAdCode
(
AccountsAdUnitsGetAdCodeResource
, accountsAdUnitsGetAdCode
, AccountsAdUnitsGetAdCode
, aaugacAdUnitId
, aaugacAdClientId
, aaugacAccountId
, aaugacHostCustomChannelId
) where
import Network.Google.AdSenseHost.Types
import Network.Google.Prelude
type AccountsAdUnitsGetAdCodeResource =
"adsensehost" :>
"v4.1" :>
"accounts" :>
Capture "accountId" Text :>
"adclients" :>
Capture "adClientId" Text :>
"adunits" :>
Capture "adUnitId" Text :>
"adcode" :>
QueryParams "hostCustomChannelId" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] AdCode
data AccountsAdUnitsGetAdCode = AccountsAdUnitsGetAdCode'
{ _aaugacAdUnitId :: !Text
, _aaugacAdClientId :: !Text
, _aaugacAccountId :: !Text
, _aaugacHostCustomChannelId :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
accountsAdUnitsGetAdCode
:: Text
-> Text
-> Text
-> AccountsAdUnitsGetAdCode
accountsAdUnitsGetAdCode pAaugacAdUnitId_ pAaugacAdClientId_ pAaugacAccountId_ =
AccountsAdUnitsGetAdCode'
{ _aaugacAdUnitId = pAaugacAdUnitId_
, _aaugacAdClientId = pAaugacAdClientId_
, _aaugacAccountId = pAaugacAccountId_
, _aaugacHostCustomChannelId = Nothing
}
aaugacAdUnitId :: Lens' AccountsAdUnitsGetAdCode Text
aaugacAdUnitId
= lens _aaugacAdUnitId
(\ s a -> s{_aaugacAdUnitId = a})
aaugacAdClientId :: Lens' AccountsAdUnitsGetAdCode Text
aaugacAdClientId
= lens _aaugacAdClientId
(\ s a -> s{_aaugacAdClientId = a})
aaugacAccountId :: Lens' AccountsAdUnitsGetAdCode Text
aaugacAccountId
= lens _aaugacAccountId
(\ s a -> s{_aaugacAccountId = a})
aaugacHostCustomChannelId :: Lens' AccountsAdUnitsGetAdCode [Text]
aaugacHostCustomChannelId
= lens _aaugacHostCustomChannelId
(\ s a -> s{_aaugacHostCustomChannelId = a})
. _Default
. _Coerce
instance GoogleRequest AccountsAdUnitsGetAdCode where
type Rs AccountsAdUnitsGetAdCode = AdCode
type Scopes AccountsAdUnitsGetAdCode =
'["https://www.googleapis.com/auth/adsensehost"]
requestClient AccountsAdUnitsGetAdCode'{..}
= go _aaugacAccountId _aaugacAdClientId
_aaugacAdUnitId
(_aaugacHostCustomChannelId ^. _Default)
(Just AltJSON)
adSenseHostService
where go
= buildClient
(Proxy :: Proxy AccountsAdUnitsGetAdCodeResource)
mempty