{-# 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.AdSense.Accounts.Reports.Generate
(
AccountsReportsGenerateResource
, accountsReportsGenerate
, AccountsReportsGenerate
, argDimension
, argLocale
, argEndDate
, argStartDate
, argAccountId
, argMetric
, argCurrency
, argSort
, argFilter
, argStartIndex
, argUseTimezoneReporting
, argMaxResults
) where
import Network.Google.AdSense.Types
import Network.Google.Prelude
type AccountsReportsGenerateResource =
"adsense" :>
"v1.4" :>
"accounts" :>
Capture "accountId" Text :>
"reports" :>
QueryParam "startDate" Text :>
QueryParam "endDate" Text :>
QueryParams "dimension" Text :>
QueryParam "locale" Text :>
QueryParams "metric" Text :>
QueryParam "currency" Text :>
QueryParams "sort" Text :>
QueryParams "filter" Text :>
QueryParam "startIndex" (Textual Int32) :>
QueryParam "useTimezoneReporting" Bool :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "alt" AltJSON :>
Get '[JSON]
AdsenseReportsGenerateResponse
:<|>
"adsense" :>
"v1.4" :>
"accounts" :>
Capture "accountId" Text :>
"reports" :>
QueryParam "startDate" Text :>
QueryParam "endDate" Text :>
QueryParams "dimension" Text :>
QueryParam "locale" Text :>
QueryParams "metric" Text :>
QueryParam "currency" Text :>
QueryParams "sort" Text :>
QueryParams "filter" Text :>
QueryParam "startIndex" (Textual Int32) :>
QueryParam "useTimezoneReporting" Bool :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "alt" AltMedia :>
Get '[OctetStream] Stream
data AccountsReportsGenerate = AccountsReportsGenerate'
{ _argDimension :: !(Maybe [Text])
, _argLocale :: !(Maybe Text)
, _argEndDate :: !Text
, _argStartDate :: !Text
, _argAccountId :: !Text
, _argMetric :: !(Maybe [Text])
, _argCurrency :: !(Maybe Text)
, _argSort :: !(Maybe [Text])
, _argFilter :: !(Maybe [Text])
, _argStartIndex :: !(Maybe (Textual Int32))
, _argUseTimezoneReporting :: !(Maybe Bool)
, _argMaxResults :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
accountsReportsGenerate
:: Text
-> Text
-> Text
-> AccountsReportsGenerate
accountsReportsGenerate pArgEndDate_ pArgStartDate_ pArgAccountId_ =
AccountsReportsGenerate'
{ _argDimension = Nothing
, _argLocale = Nothing
, _argEndDate = pArgEndDate_
, _argStartDate = pArgStartDate_
, _argAccountId = pArgAccountId_
, _argMetric = Nothing
, _argCurrency = Nothing
, _argSort = Nothing
, _argFilter = Nothing
, _argStartIndex = Nothing
, _argUseTimezoneReporting = Nothing
, _argMaxResults = Nothing
}
argDimension :: Lens' AccountsReportsGenerate [Text]
argDimension
= lens _argDimension (\ s a -> s{_argDimension = a})
. _Default
. _Coerce
argLocale :: Lens' AccountsReportsGenerate (Maybe Text)
argLocale
= lens _argLocale (\ s a -> s{_argLocale = a})
argEndDate :: Lens' AccountsReportsGenerate Text
argEndDate
= lens _argEndDate (\ s a -> s{_argEndDate = a})
argStartDate :: Lens' AccountsReportsGenerate Text
argStartDate
= lens _argStartDate (\ s a -> s{_argStartDate = a})
argAccountId :: Lens' AccountsReportsGenerate Text
argAccountId
= lens _argAccountId (\ s a -> s{_argAccountId = a})
argMetric :: Lens' AccountsReportsGenerate [Text]
argMetric
= lens _argMetric (\ s a -> s{_argMetric = a}) .
_Default
. _Coerce
argCurrency :: Lens' AccountsReportsGenerate (Maybe Text)
argCurrency
= lens _argCurrency (\ s a -> s{_argCurrency = a})
argSort :: Lens' AccountsReportsGenerate [Text]
argSort
= lens _argSort (\ s a -> s{_argSort = a}) . _Default
. _Coerce
argFilter :: Lens' AccountsReportsGenerate [Text]
argFilter
= lens _argFilter (\ s a -> s{_argFilter = a}) .
_Default
. _Coerce
argStartIndex :: Lens' AccountsReportsGenerate (Maybe Int32)
argStartIndex
= lens _argStartIndex
(\ s a -> s{_argStartIndex = a})
. mapping _Coerce
argUseTimezoneReporting :: Lens' AccountsReportsGenerate (Maybe Bool)
argUseTimezoneReporting
= lens _argUseTimezoneReporting
(\ s a -> s{_argUseTimezoneReporting = a})
argMaxResults :: Lens' AccountsReportsGenerate (Maybe Int32)
argMaxResults
= lens _argMaxResults
(\ s a -> s{_argMaxResults = a})
. mapping _Coerce
instance GoogleRequest AccountsReportsGenerate where
type Rs AccountsReportsGenerate =
AdsenseReportsGenerateResponse
type Scopes AccountsReportsGenerate =
'["https://www.googleapis.com/auth/adsense",
"https://www.googleapis.com/auth/adsense.readonly"]
requestClient AccountsReportsGenerate'{..}
= go _argAccountId (Just _argStartDate)
(Just _argEndDate)
(_argDimension ^. _Default)
_argLocale
(_argMetric ^. _Default)
_argCurrency
(_argSort ^. _Default)
(_argFilter ^. _Default)
_argStartIndex
_argUseTimezoneReporting
_argMaxResults
(Just AltJSON)
adSenseService
where go :<|> _
= buildClient
(Proxy :: Proxy AccountsReportsGenerateResource)
mempty
instance GoogleRequest
(MediaDownload AccountsReportsGenerate) where
type Rs (MediaDownload AccountsReportsGenerate) =
Stream
type Scopes (MediaDownload AccountsReportsGenerate) =
Scopes AccountsReportsGenerate
requestClient
(MediaDownload AccountsReportsGenerate'{..})
= go _argAccountId (Just _argStartDate)
(Just _argEndDate)
(_argDimension ^. _Default)
_argLocale
(_argMetric ^. _Default)
_argCurrency
(_argSort ^. _Default)
(_argFilter ^. _Default)
_argStartIndex
_argUseTimezoneReporting
_argMaxResults
(Just AltMedia)
adSenseService
where _ :<|> go
= buildClient
(Proxy :: Proxy AccountsReportsGenerateResource)
mempty