{-# 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.CloudErrorReporting.Projects.Events.Report
(
ProjectsEventsReportResource
, projectsEventsReport
, ProjectsEventsReport
, perXgafv
, perUploadProtocol
, perAccessToken
, perUploadType
, perPayload
, perProjectName
, perCallback
) where
import Network.Google.CloudErrorReporting.Types
import Network.Google.Prelude
type ProjectsEventsReportResource =
"v1beta1" :>
Capture "projectName" Text :>
"events:report" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ReportedErrorEvent :>
Post '[JSON] ReportErrorEventResponse
data ProjectsEventsReport = ProjectsEventsReport'
{ _perXgafv :: !(Maybe Xgafv)
, _perUploadProtocol :: !(Maybe Text)
, _perAccessToken :: !(Maybe Text)
, _perUploadType :: !(Maybe Text)
, _perPayload :: !ReportedErrorEvent
, _perProjectName :: !Text
, _perCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsEventsReport
:: ReportedErrorEvent
-> Text
-> ProjectsEventsReport
projectsEventsReport pPerPayload_ pPerProjectName_ =
ProjectsEventsReport'
{ _perXgafv = Nothing
, _perUploadProtocol = Nothing
, _perAccessToken = Nothing
, _perUploadType = Nothing
, _perPayload = pPerPayload_
, _perProjectName = pPerProjectName_
, _perCallback = Nothing
}
perXgafv :: Lens' ProjectsEventsReport (Maybe Xgafv)
perXgafv = lens _perXgafv (\ s a -> s{_perXgafv = a})
perUploadProtocol :: Lens' ProjectsEventsReport (Maybe Text)
perUploadProtocol
= lens _perUploadProtocol
(\ s a -> s{_perUploadProtocol = a})
perAccessToken :: Lens' ProjectsEventsReport (Maybe Text)
perAccessToken
= lens _perAccessToken
(\ s a -> s{_perAccessToken = a})
perUploadType :: Lens' ProjectsEventsReport (Maybe Text)
perUploadType
= lens _perUploadType
(\ s a -> s{_perUploadType = a})
perPayload :: Lens' ProjectsEventsReport ReportedErrorEvent
perPayload
= lens _perPayload (\ s a -> s{_perPayload = a})
perProjectName :: Lens' ProjectsEventsReport Text
perProjectName
= lens _perProjectName
(\ s a -> s{_perProjectName = a})
perCallback :: Lens' ProjectsEventsReport (Maybe Text)
perCallback
= lens _perCallback (\ s a -> s{_perCallback = a})
instance GoogleRequest ProjectsEventsReport where
type Rs ProjectsEventsReport =
ReportErrorEventResponse
type Scopes ProjectsEventsReport =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient ProjectsEventsReport'{..}
= go _perProjectName _perXgafv _perUploadProtocol
_perAccessToken
_perUploadType
_perCallback
(Just AltJSON)
_perPayload
cloudErrorReportingService
where go
= buildClient
(Proxy :: Proxy ProjectsEventsReportResource)
mempty