{-# 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.AccountUserProFiles.Insert
(
AccountUserProFilesInsertResource
, accountUserProFilesInsert
, AccountUserProFilesInsert
, aupfiProFileId
, aupfiPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type AccountUserProFilesInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"accountUserProfiles" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] AccountUserProFile :>
Post '[JSON] AccountUserProFile
data AccountUserProFilesInsert = AccountUserProFilesInsert'
{ _aupfiProFileId :: !(Textual Int64)
, _aupfiPayload :: !AccountUserProFile
} deriving (Eq,Show,Data,Typeable,Generic)
accountUserProFilesInsert
:: Int64
-> AccountUserProFile
-> AccountUserProFilesInsert
accountUserProFilesInsert pAupfiProFileId_ pAupfiPayload_ =
AccountUserProFilesInsert'
{ _aupfiProFileId = _Coerce # pAupfiProFileId_
, _aupfiPayload = pAupfiPayload_
}
aupfiProFileId :: Lens' AccountUserProFilesInsert Int64
aupfiProFileId
= lens _aupfiProFileId
(\ s a -> s{_aupfiProFileId = a})
. _Coerce
aupfiPayload :: Lens' AccountUserProFilesInsert AccountUserProFile
aupfiPayload
= lens _aupfiPayload (\ s a -> s{_aupfiPayload = a})
instance GoogleRequest AccountUserProFilesInsert
where
type Rs AccountUserProFilesInsert =
AccountUserProFile
type Scopes AccountUserProFilesInsert =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient AccountUserProFilesInsert'{..}
= go _aupfiProFileId (Just AltJSON) _aupfiPayload
dFAReportingService
where go
= buildClient
(Proxy :: Proxy AccountUserProFilesInsertResource)
mempty