{-# 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.AdSenseHost.Reports.Generate
(
ReportsGenerateResource
, reportsGenerate
, ReportsGenerate
, rgDimension
, rgLocale
, rgEndDate
, rgStartDate
, rgMetric
, rgSort
, rgFilter
, rgStartIndex
, rgMaxResults
) where
import Network.Google.AdSenseHost.Types
import Network.Google.Prelude
type ReportsGenerateResource =
"adsensehost" :>
"v4.1" :>
"reports" :>
QueryParam "startDate" Text :>
QueryParam "endDate" Text :>
QueryParams "dimension" Text :>
QueryParam "locale" Text :>
QueryParams "metric" Text :>
QueryParams "sort" Text :>
QueryParams "filter" Text :>
QueryParam "startIndex" (Textual Word32) :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "alt" AltJSON :> Get '[JSON] Report
data ReportsGenerate = ReportsGenerate'
{ _rgDimension :: !(Maybe [Text])
, _rgLocale :: !(Maybe Text)
, _rgEndDate :: !Text
, _rgStartDate :: !Text
, _rgMetric :: !(Maybe [Text])
, _rgSort :: !(Maybe [Text])
, _rgFilter :: !(Maybe [Text])
, _rgStartIndex :: !(Maybe (Textual Word32))
, _rgMaxResults :: !(Maybe (Textual Word32))
} deriving (Eq,Show,Data,Typeable,Generic)
reportsGenerate
:: Text
-> Text
-> ReportsGenerate
reportsGenerate pRgEndDate_ pRgStartDate_ =
ReportsGenerate'
{ _rgDimension = Nothing
, _rgLocale = Nothing
, _rgEndDate = pRgEndDate_
, _rgStartDate = pRgStartDate_
, _rgMetric = Nothing
, _rgSort = Nothing
, _rgFilter = Nothing
, _rgStartIndex = Nothing
, _rgMaxResults = Nothing
}
rgDimension :: Lens' ReportsGenerate [Text]
rgDimension
= lens _rgDimension (\ s a -> s{_rgDimension = a}) .
_Default
. _Coerce
rgLocale :: Lens' ReportsGenerate (Maybe Text)
rgLocale = lens _rgLocale (\ s a -> s{_rgLocale = a})
rgEndDate :: Lens' ReportsGenerate Text
rgEndDate
= lens _rgEndDate (\ s a -> s{_rgEndDate = a})
rgStartDate :: Lens' ReportsGenerate Text
rgStartDate
= lens _rgStartDate (\ s a -> s{_rgStartDate = a})
rgMetric :: Lens' ReportsGenerate [Text]
rgMetric
= lens _rgMetric (\ s a -> s{_rgMetric = a}) .
_Default
. _Coerce
rgSort :: Lens' ReportsGenerate [Text]
rgSort
= lens _rgSort (\ s a -> s{_rgSort = a}) . _Default .
_Coerce
rgFilter :: Lens' ReportsGenerate [Text]
rgFilter
= lens _rgFilter (\ s a -> s{_rgFilter = a}) .
_Default
. _Coerce
rgStartIndex :: Lens' ReportsGenerate (Maybe Word32)
rgStartIndex
= lens _rgStartIndex (\ s a -> s{_rgStartIndex = a})
. mapping _Coerce
rgMaxResults :: Lens' ReportsGenerate (Maybe Word32)
rgMaxResults
= lens _rgMaxResults (\ s a -> s{_rgMaxResults = a})
. mapping _Coerce
instance GoogleRequest ReportsGenerate where
type Rs ReportsGenerate = Report
type Scopes ReportsGenerate =
'["https://www.googleapis.com/auth/adsensehost"]
requestClient ReportsGenerate'{..}
= go (Just _rgStartDate) (Just _rgEndDate)
(_rgDimension ^. _Default)
_rgLocale
(_rgMetric ^. _Default)
(_rgSort ^. _Default)
(_rgFilter ^. _Default)
_rgStartIndex
_rgMaxResults
(Just AltJSON)
adSenseHostService
where go
= buildClient
(Proxy :: Proxy ReportsGenerateResource)
mempty