{-# 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.AdSense.AdUnits.GetAdCode
(
AdUnitsGetAdCodeResource
, adUnitsGetAdCode
, AdUnitsGetAdCode
, augacAdUnitId
, augacAdClientId
) where
import Network.Google.AdSense.Types
import Network.Google.Prelude
type AdUnitsGetAdCodeResource =
"adsense" :>
"v1.4" :>
"adclients" :>
Capture "adClientId" Text :>
"adunits" :>
Capture "adUnitId" Text :>
"adcode" :>
QueryParam "alt" AltJSON :> Get '[JSON] AdCode
data AdUnitsGetAdCode = AdUnitsGetAdCode'
{ _augacAdUnitId :: !Text
, _augacAdClientId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
adUnitsGetAdCode
:: Text
-> Text
-> AdUnitsGetAdCode
adUnitsGetAdCode pAugacAdUnitId_ pAugacAdClientId_ =
AdUnitsGetAdCode'
{ _augacAdUnitId = pAugacAdUnitId_
, _augacAdClientId = pAugacAdClientId_
}
augacAdUnitId :: Lens' AdUnitsGetAdCode Text
augacAdUnitId
= lens _augacAdUnitId
(\ s a -> s{_augacAdUnitId = a})
augacAdClientId :: Lens' AdUnitsGetAdCode Text
augacAdClientId
= lens _augacAdClientId
(\ s a -> s{_augacAdClientId = a})
instance GoogleRequest AdUnitsGetAdCode where
type Rs AdUnitsGetAdCode = AdCode
type Scopes AdUnitsGetAdCode =
'["https://www.googleapis.com/auth/adsense",
"https://www.googleapis.com/auth/adsense.readonly"]
requestClient AdUnitsGetAdCode'{..}
= go _augacAdClientId _augacAdUnitId (Just AltJSON)
adSenseService
where go
= buildClient
(Proxy :: Proxy AdUnitsGetAdCodeResource)
mempty