{-# 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
data AccountsAdUnitsInsert = AccountsAdUnitsInsert'
{ _aauiPayload :: !AdUnit
, _aauiAdClientId :: !Text
, _aauiAccountId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
accountsAdUnitsInsert
:: AdUnit
-> Text
-> Text
-> AccountsAdUnitsInsert
accountsAdUnitsInsert pAauiPayload_ pAauiAdClientId_ pAauiAccountId_ =
AccountsAdUnitsInsert'
{ _aauiPayload = pAauiPayload_
, _aauiAdClientId = pAauiAdClientId_
, _aauiAccountId = pAauiAccountId_
}
aauiPayload :: Lens' AccountsAdUnitsInsert AdUnit
aauiPayload
= lens _aauiPayload (\ s a -> s{_aauiPayload = a})
aauiAdClientId :: Lens' AccountsAdUnitsInsert Text
aauiAdClientId
= lens _aauiAdClientId
(\ s a -> s{_aauiAdClientId = a})
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