{-# 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.Get
(
AdUnitsGetResource
, adUnitsGet
, AdUnitsGet
, augAdUnitId
, augAdClientId
) where
import Network.Google.AdSense.Types
import Network.Google.Prelude
type AdUnitsGetResource =
"adsense" :>
"v1.4" :>
"adclients" :>
Capture "adClientId" Text :>
"adunits" :>
Capture "adUnitId" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] AdUnit
-- | Gets the specified ad unit in the specified ad client.
--
-- /See:/ 'adUnitsGet' smart constructor.
data AdUnitsGet = AdUnitsGet'
{ _augAdUnitId :: !Text
, _augAdClientId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'AdUnitsGet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'augAdUnitId'
--
-- * 'augAdClientId'
adUnitsGet
:: Text -- ^ 'augAdUnitId'
-> Text -- ^ 'augAdClientId'
-> AdUnitsGet
adUnitsGet pAugAdUnitId_ pAugAdClientId_ =
AdUnitsGet'
{ _augAdUnitId = pAugAdUnitId_
, _augAdClientId = pAugAdClientId_
}
-- | Ad unit to retrieve.
augAdUnitId :: Lens' AdUnitsGet Text
augAdUnitId
= lens _augAdUnitId (\ s a -> s{_augAdUnitId = a})
-- | Ad client for which to get the ad unit.
augAdClientId :: Lens' AdUnitsGet Text
augAdClientId
= lens _augAdClientId
(\ s a -> s{_augAdClientId = a})
instance GoogleRequest AdUnitsGet where
type Rs AdUnitsGet = AdUnit
type Scopes AdUnitsGet =
'["https://www.googleapis.com/auth/adsense",
"https://www.googleapis.com/auth/adsense.readonly"]
requestClient AdUnitsGet'{..}
= go _augAdClientId _augAdUnitId (Just AltJSON)
adSenseService
where go
= buildClient (Proxy :: Proxy AdUnitsGetResource)
mempty