{-# 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.Reports.Insert
(
ReportsInsertResource
, reportsInsert
, ReportsInsert
, riProFileId
, riPayload
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type ReportsInsertResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"reports" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Report :> Post '[JSON] Report
data ReportsInsert = ReportsInsert'
{ _riProFileId :: !(Textual Int64)
, _riPayload :: !Report
} deriving (Eq,Show,Data,Typeable,Generic)
reportsInsert
:: Int64
-> Report
-> ReportsInsert
reportsInsert pRiProFileId_ pRiPayload_ =
ReportsInsert'
{ _riProFileId = _Coerce # pRiProFileId_
, _riPayload = pRiPayload_
}
riProFileId :: Lens' ReportsInsert Int64
riProFileId
= lens _riProFileId (\ s a -> s{_riProFileId = a}) .
_Coerce
riPayload :: Lens' ReportsInsert Report
riPayload
= lens _riPayload (\ s a -> s{_riPayload = a})
instance GoogleRequest ReportsInsert where
type Rs ReportsInsert = Report
type Scopes ReportsInsert =
'["https://www.googleapis.com/auth/dfareporting"]
requestClient ReportsInsert'{..}
= go _riProFileId (Just AltJSON) _riPayload
dFAReportingService
where go
= buildClient (Proxy :: Proxy ReportsInsertResource)
mempty