{-# 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.Insert
(
AccountsAdUnitsInsertResource
, accountsAdUnitsInsert
, AccountsAdUnitsInsert
, aauiPayload
, aauiAdClientId
, aauiAccountId
) where
import Network.Google.AdSenseHost.Types
import Network.Google.Prelude
type AccountsAdUnitsInsertResource =
"adsensehost" :>
"v4.1" :>
"accounts" :>
Capture "accountId" Text :>
"adclients" :>
Capture "adClientId" Text :>
"adunits" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AdUnit :> Post '[JSON] AdUnit
-- | Insert the supplied ad unit into the specified publisher AdSense
-- account.
--
-- /See:/ 'accountsAdUnitsInsert' smart constructor.
data AccountsAdUnitsInsert = AccountsAdUnitsInsert'
{ _aauiPayload :: !AdUnit
, _aauiAdClientId :: !Text
, _aauiAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'AccountsAdUnitsInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'aauiPayload'
--
-- * 'aauiAdClientId'
--
-- * 'aauiAccountId'
accountsAdUnitsInsert
:: AdUnit -- ^ 'aauiPayload'
-> Text -- ^ 'aauiAdClientId'
-> Text -- ^ 'aauiAccountId'
-> AccountsAdUnitsInsert
accountsAdUnitsInsert pAauiPayload_ pAauiAdClientId_ pAauiAccountId_ =
AccountsAdUnitsInsert'
{ _aauiPayload = pAauiPayload_
, _aauiAdClientId = pAauiAdClientId_
, _aauiAccountId = pAauiAccountId_
}
-- | Multipart request metadata.
aauiPayload :: Lens' AccountsAdUnitsInsert AdUnit
aauiPayload
= lens _aauiPayload (\ s a -> s{_aauiPayload = a})
-- | Ad client into which to insert the ad unit.
aauiAdClientId :: Lens' AccountsAdUnitsInsert Text
aauiAdClientId
= lens _aauiAdClientId
(\ s a -> s{_aauiAdClientId = a})
-- | Account which will contain the ad unit.
aauiAccountId :: Lens' AccountsAdUnitsInsert Text
aauiAccountId
= lens _aauiAccountId
(\ s a -> s{_aauiAccountId = a})
instance GoogleRequest AccountsAdUnitsInsert where
type Rs AccountsAdUnitsInsert = AdUnit
type Scopes AccountsAdUnitsInsert =
'["https://www.googleapis.com/auth/adsensehost"]
requestClient AccountsAdUnitsInsert'{..}
= go _aauiAccountId _aauiAdClientId (Just AltJSON)
_aauiPayload
adSenseHostService
where go
= buildClient
(Proxy :: Proxy AccountsAdUnitsInsertResource)
mempty