{-# 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.Accounts.Get
(
AccountsGetResource
, accountsGet
, AccountsGet
, agTree
, agAccountId
) where
import Network.Google.AdSense.Types
import Network.Google.Prelude
type AccountsGetResource =
"adsense" :>
"v1.4" :>
"accounts" :>
Capture "accountId" Text :>
QueryParam "tree" Bool :>
QueryParam "alt" AltJSON :> Get '[JSON] Account
-- | Get information about the selected AdSense account.
--
-- /See:/ 'accountsGet' smart constructor.
data AccountsGet = AccountsGet'
{ _agTree :: !(Maybe Bool)
, _agAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'AccountsGet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'agTree'
--
-- * 'agAccountId'
accountsGet
:: Text -- ^ 'agAccountId'
-> AccountsGet
accountsGet pAgAccountId_ =
AccountsGet'
{ _agTree = Nothing
, _agAccountId = pAgAccountId_
}
-- | Whether the tree of sub accounts should be returned.
agTree :: Lens' AccountsGet (Maybe Bool)
agTree = lens _agTree (\ s a -> s{_agTree = a})
-- | Account to get information about.
agAccountId :: Lens' AccountsGet Text
agAccountId
= lens _agAccountId (\ s a -> s{_agAccountId = a})
instance GoogleRequest AccountsGet where
type Rs AccountsGet = Account
type Scopes AccountsGet =
'["https://www.googleapis.com/auth/adsense",
"https://www.googleapis.com/auth/adsense.readonly"]
requestClient AccountsGet'{..}
= go _agAccountId _agTree (Just AltJSON)
adSenseService
where go
= buildClient (Proxy :: Proxy AccountsGetResource)
mempty