{-# 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.AdExchangeSeller.Accounts.Reports.Generate
(
AccountsReportsGenerateResource
, accountsReportsGenerate
, AccountsReportsGenerate
, argDimension
, argLocale
, argEndDate
, argStartDate
, argAccountId
, argMetric
, argSort
, argFilter
, argStartIndex
, argMaxResults
) where
import Network.Google.AdExchangeSeller.Types
import Network.Google.Prelude
type AccountsReportsGenerateResource =
"adexchangeseller" :>
"v2.0" :>
"accounts" :>
Capture "accountId" Text :>
"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
:<|>
"adexchangeseller" :>
"v2.0" :>
"accounts" :>
Capture "accountId" Text :>
"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" AltMedia :>
Get '[OctetStream] Stream
data AccountsReportsGenerate = AccountsReportsGenerate'
{ _argDimension :: !(Maybe [Text])
, _argLocale :: !(Maybe Text)
, _argEndDate :: !Text
, _argStartDate :: !Text
, _argAccountId :: !Text
, _argMetric :: !(Maybe [Text])
, _argSort :: !(Maybe [Text])
, _argFilter :: !(Maybe [Text])
, _argStartIndex :: !(Maybe (Textual Word32))
, _argMaxResults :: !(Maybe (Textual Word32))
} 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
, _argSort = Nothing
, _argFilter = Nothing
, _argStartIndex = 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
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 Word32)
argStartIndex
= lens _argStartIndex
(\ s a -> s{_argStartIndex = a})
. mapping _Coerce
argMaxResults :: Lens' AccountsReportsGenerate (Maybe Word32)
argMaxResults
= lens _argMaxResults
(\ s a -> s{_argMaxResults = a})
. mapping _Coerce
instance GoogleRequest AccountsReportsGenerate where
type Rs AccountsReportsGenerate = Report
type Scopes AccountsReportsGenerate =
'["https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"]
requestClient AccountsReportsGenerate'{..}
= go _argAccountId (Just _argStartDate)
(Just _argEndDate)
(_argDimension ^. _Default)
_argLocale
(_argMetric ^. _Default)
(_argSort ^. _Default)
(_argFilter ^. _Default)
_argStartIndex
_argMaxResults
(Just AltJSON)
adExchangeSellerService
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)
(_argSort ^. _Default)
(_argFilter ^. _Default)
_argStartIndex
_argMaxResults
(Just AltMedia)
adExchangeSellerService
where _ :<|> go
= buildClient
(Proxy :: Proxy AccountsReportsGenerateResource)
mempty