{-# 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.UserUsageReport.Get
(
UserUsageReportGetResource
, userUsageReportGet
, UserUsageReportGet
, uurgFilters
, uurgCustomerId
, uurgDate
, uurgParameters
, uurgPageToken
, uurgUserKey
, uurgMaxResults
, uurgOrgUnitId
) where
import Network.Google.Prelude
import Network.Google.Reports.Types
type UserUsageReportGetResource =
"admin" :>
"reports" :>
"v1" :>
"usage" :>
"users" :>
Capture "userKey" Text :>
"dates" :>
Capture "date" Text :>
QueryParam "filters" Text :>
QueryParam "customerId" Text :>
QueryParam "parameters" Text :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "orgUnitID" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] UsageReports
data UserUsageReportGet = UserUsageReportGet'
{ _uurgFilters :: !(Maybe Text)
, _uurgCustomerId :: !(Maybe Text)
, _uurgDate :: !Text
, _uurgParameters :: !(Maybe Text)
, _uurgPageToken :: !(Maybe Text)
, _uurgUserKey :: !Text
, _uurgMaxResults :: !(Maybe (Textual Word32))
, _uurgOrgUnitId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
userUsageReportGet
:: Text
-> Text
-> UserUsageReportGet
userUsageReportGet pUurgDate_ pUurgUserKey_ =
UserUsageReportGet'
{ _uurgFilters = Nothing
, _uurgCustomerId = Nothing
, _uurgDate = pUurgDate_
, _uurgParameters = Nothing
, _uurgPageToken = Nothing
, _uurgUserKey = pUurgUserKey_
, _uurgMaxResults = Nothing
, _uurgOrgUnitId = ""
}
uurgFilters :: Lens' UserUsageReportGet (Maybe Text)
uurgFilters
= lens _uurgFilters (\ s a -> s{_uurgFilters = a})
uurgCustomerId :: Lens' UserUsageReportGet (Maybe Text)
uurgCustomerId
= lens _uurgCustomerId
(\ s a -> s{_uurgCustomerId = a})
uurgDate :: Lens' UserUsageReportGet Text
uurgDate = lens _uurgDate (\ s a -> s{_uurgDate = a})
uurgParameters :: Lens' UserUsageReportGet (Maybe Text)
uurgParameters
= lens _uurgParameters
(\ s a -> s{_uurgParameters = a})
uurgPageToken :: Lens' UserUsageReportGet (Maybe Text)
uurgPageToken
= lens _uurgPageToken
(\ s a -> s{_uurgPageToken = a})
uurgUserKey :: Lens' UserUsageReportGet Text
uurgUserKey
= lens _uurgUserKey (\ s a -> s{_uurgUserKey = a})
uurgMaxResults :: Lens' UserUsageReportGet (Maybe Word32)
uurgMaxResults
= lens _uurgMaxResults
(\ s a -> s{_uurgMaxResults = a})
. mapping _Coerce
uurgOrgUnitId :: Lens' UserUsageReportGet Text
uurgOrgUnitId
= lens _uurgOrgUnitId
(\ s a -> s{_uurgOrgUnitId = a})
instance GoogleRequest UserUsageReportGet where
type Rs UserUsageReportGet = UsageReports
type Scopes UserUsageReportGet =
'["https://www.googleapis.com/auth/admin.reports.usage.readonly"]
requestClient UserUsageReportGet'{..}
= go _uurgUserKey _uurgDate _uurgFilters
_uurgCustomerId
_uurgParameters
_uurgPageToken
_uurgMaxResults
(Just _uurgOrgUnitId)
(Just AltJSON)
reportsService
where go
= buildClient
(Proxy :: Proxy UserUsageReportGetResource)
mempty