{-# 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.DFAReporting.SubAccounts.Insert
(
SubAccountsInsertResource
, subAccountsInsert
, SubAccountsInsert
, saiProFileId
, saiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type SubAccountsInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"subaccounts" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SubAccount :> Post '[JSON] SubAccount
data SubAccountsInsert = SubAccountsInsert'
{ _saiProFileId :: !(Textual Int64)
, _saiPayload :: !SubAccount
} deriving (Eq,Show,Data,Typeable,Generic)
subAccountsInsert
:: Int64
-> SubAccount
-> SubAccountsInsert
subAccountsInsert pSaiProFileId_ pSaiPayload_ =
SubAccountsInsert'
{ _saiProFileId = _Coerce # pSaiProFileId_
, _saiPayload = pSaiPayload_
}
saiProFileId :: Lens' SubAccountsInsert Int64
saiProFileId
= lens _saiProFileId (\ s a -> s{_saiProFileId = a})
. _Coerce
saiPayload :: Lens' SubAccountsInsert SubAccount
saiPayload
= lens _saiPayload (\ s a -> s{_saiPayload = a})
instance GoogleRequest SubAccountsInsert where
type Rs SubAccountsInsert = SubAccount
type Scopes SubAccountsInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient SubAccountsInsert'{..}
= go _saiProFileId (Just AltJSON) _saiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy SubAccountsInsertResource)
mempty