{-# 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.Reports.CustomerUsageReports.Get
(
CustomerUsageReportsGetResource
, customerUsageReportsGet
, CustomerUsageReportsGet
, curgCustomerId
, curgDate
, curgParameters
, curgPageToken
) where
import Network.Google.Prelude
import Network.Google.Reports.Types
type CustomerUsageReportsGetResource =
"admin" :>
"reports" :>
"v1" :>
"usage" :>
"dates" :>
Capture "date" Text :>
QueryParam "customerId" Text :>
QueryParam "parameters" Text :>
QueryParam "pageToken" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] UsageReports
data CustomerUsageReportsGet = CustomerUsageReportsGet'
{ _curgCustomerId :: !(Maybe Text)
, _curgDate :: !Text
, _curgParameters :: !(Maybe Text)
, _curgPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
customerUsageReportsGet
:: Text
-> CustomerUsageReportsGet
customerUsageReportsGet pCurgDate_ =
CustomerUsageReportsGet'
{ _curgCustomerId = Nothing
, _curgDate = pCurgDate_
, _curgParameters = Nothing
, _curgPageToken = Nothing
}
curgCustomerId :: Lens' CustomerUsageReportsGet (Maybe Text)
curgCustomerId
= lens _curgCustomerId
(\ s a -> s{_curgCustomerId = a})
curgDate :: Lens' CustomerUsageReportsGet Text
curgDate = lens _curgDate (\ s a -> s{_curgDate = a})
curgParameters :: Lens' CustomerUsageReportsGet (Maybe Text)
curgParameters
= lens _curgParameters
(\ s a -> s{_curgParameters = a})
curgPageToken :: Lens' CustomerUsageReportsGet (Maybe Text)
curgPageToken
= lens _curgPageToken
(\ s a -> s{_curgPageToken = a})
instance GoogleRequest CustomerUsageReportsGet where
type Rs CustomerUsageReportsGet = UsageReports
type Scopes CustomerUsageReportsGet =
'["https://www.googleapis.com/auth/admin.reports.usage.readonly"]
requestClient CustomerUsageReportsGet'{..}
= go _curgDate _curgCustomerId _curgParameters
_curgPageToken
(Just AltJSON)
reportsService
where go
= buildClient
(Proxy :: Proxy CustomerUsageReportsGetResource)
mempty