{-# 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.ServiceControl.Services.Report
(
ServicesReportResource
, servicesReport
, ServicesReport
, srXgafv
, srUploadProtocol
, srAccessToken
, srUploadType
, srPayload
, srServiceName
, srCallback
) where
import Network.Google.Prelude
import Network.Google.ServiceControl.Types
type ServicesReportResource =
"v1" :>
"services" :>
CaptureMode "serviceName" "report" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] ReportRequest :>
Post '[JSON] ReportResponse
data ServicesReport = ServicesReport'
{ _srXgafv :: !(Maybe Xgafv)
, _srUploadProtocol :: !(Maybe Text)
, _srAccessToken :: !(Maybe Text)
, _srUploadType :: !(Maybe Text)
, _srPayload :: !ReportRequest
, _srServiceName :: !Text
, _srCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
servicesReport
:: ReportRequest
-> Text
-> ServicesReport
servicesReport pSrPayload_ pSrServiceName_ =
ServicesReport'
{ _srXgafv = Nothing
, _srUploadProtocol = Nothing
, _srAccessToken = Nothing
, _srUploadType = Nothing
, _srPayload = pSrPayload_
, _srServiceName = pSrServiceName_
, _srCallback = Nothing
}
srXgafv :: Lens' ServicesReport (Maybe Xgafv)
srXgafv = lens _srXgafv (\ s a -> s{_srXgafv = a})
srUploadProtocol :: Lens' ServicesReport (Maybe Text)
srUploadProtocol
= lens _srUploadProtocol
(\ s a -> s{_srUploadProtocol = a})
srAccessToken :: Lens' ServicesReport (Maybe Text)
srAccessToken
= lens _srAccessToken
(\ s a -> s{_srAccessToken = a})
srUploadType :: Lens' ServicesReport (Maybe Text)
srUploadType
= lens _srUploadType (\ s a -> s{_srUploadType = a})
srPayload :: Lens' ServicesReport ReportRequest
srPayload
= lens _srPayload (\ s a -> s{_srPayload = a})
srServiceName :: Lens' ServicesReport Text
srServiceName
= lens _srServiceName
(\ s a -> s{_srServiceName = a})
srCallback :: Lens' ServicesReport (Maybe Text)
srCallback
= lens _srCallback (\ s a -> s{_srCallback = a})
instance GoogleRequest ServicesReport where
type Rs ServicesReport = ReportResponse
type Scopes ServicesReport =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/servicecontrol"]
requestClient ServicesReport'{..}
= go _srServiceName _srXgafv _srUploadProtocol
_srAccessToken
_srUploadType
_srCallback
(Just AltJSON)
_srPayload
serviceControlService
where go
= buildClient (Proxy :: Proxy ServicesReportResource)
mempty