{-# 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.Analytics.Data.Realtime.Get
(
DataRealtimeGetResource
, dataRealtimeGet
, DataRealtimeGet
, drgMetrics
, drgFilters
, drgIds
, drgSort
, drgDimensions
, drgMaxResults
) where
import Network.Google.Analytics.Types
import Network.Google.Prelude
type DataRealtimeGetResource =
"analytics" :>
"v3" :>
"data" :>
"realtime" :>
QueryParam "ids" Text :>
QueryParam "metrics" Text :>
QueryParam "filters" Text :>
QueryParam "sort" Text :>
QueryParam "dimensions" Text :>
QueryParam "max-results" (Textual Int32) :>
QueryParam "alt" AltJSON :> Get '[JSON] RealtimeData
data DataRealtimeGet = DataRealtimeGet'
{ _drgMetrics :: !Text
, _drgFilters :: !(Maybe Text)
, _drgIds :: !Text
, _drgSort :: !(Maybe Text)
, _drgDimensions :: !(Maybe Text)
, _drgMaxResults :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
dataRealtimeGet
:: Text
-> Text
-> DataRealtimeGet
dataRealtimeGet pDrgMetrics_ pDrgIds_ =
DataRealtimeGet'
{ _drgMetrics = pDrgMetrics_
, _drgFilters = Nothing
, _drgIds = pDrgIds_
, _drgSort = Nothing
, _drgDimensions = Nothing
, _drgMaxResults = Nothing
}
drgMetrics :: Lens' DataRealtimeGet Text
drgMetrics
= lens _drgMetrics (\ s a -> s{_drgMetrics = a})
drgFilters :: Lens' DataRealtimeGet (Maybe Text)
drgFilters
= lens _drgFilters (\ s a -> s{_drgFilters = a})
drgIds :: Lens' DataRealtimeGet Text
drgIds = lens _drgIds (\ s a -> s{_drgIds = a})
drgSort :: Lens' DataRealtimeGet (Maybe Text)
drgSort = lens _drgSort (\ s a -> s{_drgSort = a})
drgDimensions :: Lens' DataRealtimeGet (Maybe Text)
drgDimensions
= lens _drgDimensions
(\ s a -> s{_drgDimensions = a})
drgMaxResults :: Lens' DataRealtimeGet (Maybe Int32)
drgMaxResults
= lens _drgMaxResults
(\ s a -> s{_drgMaxResults = a})
. mapping _Coerce
instance GoogleRequest DataRealtimeGet where
type Rs DataRealtimeGet = RealtimeData
type Scopes DataRealtimeGet =
'["https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"]
requestClient DataRealtimeGet'{..}
= go (Just _drgIds) (Just _drgMetrics) _drgFilters
_drgSort
_drgDimensions
_drgMaxResults
(Just AltJSON)
analyticsService
where go
= buildClient
(Proxy :: Proxy DataRealtimeGetResource)
mempty