{-# 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.YouTubeAnalytics.Reports.Query
(
ReportsQueryResource
, reportsQuery
, ReportsQuery
, rqXgafv
, rqMetrics
, rqUploadProtocol
, rqAccessToken
, rqEndDate
, rqIncludeHistoricalChannelData
, rqFilters
, rqUploadType
, rqIds
, rqStartDate
, rqCurrency
, rqSort
, rqDimensions
, rqStartIndex
, rqMaxResults
, rqCallback
) where
import Network.Google.Prelude
import Network.Google.YouTubeAnalytics.Types
type ReportsQueryResource =
"v2" :>
"reports" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "metrics" Text :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "endDate" Text :>
QueryParam "includeHistoricalChannelData" Bool :>
QueryParam "filters" Text :>
QueryParam "uploadType" Text :>
QueryParam "ids" Text :>
QueryParam "startDate" Text :>
QueryParam "currency" Text :>
QueryParam "sort" Text :>
QueryParam "dimensions" Text :>
QueryParam "startIndex" (Textual Int32) :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] QueryResponse
data ReportsQuery = ReportsQuery'
{ _rqXgafv :: !(Maybe Xgafv)
, _rqMetrics :: !(Maybe Text)
, _rqUploadProtocol :: !(Maybe Text)
, _rqAccessToken :: !(Maybe Text)
, _rqEndDate :: !(Maybe Text)
, _rqIncludeHistoricalChannelData :: !(Maybe Bool)
, _rqFilters :: !(Maybe Text)
, _rqUploadType :: !(Maybe Text)
, _rqIds :: !(Maybe Text)
, _rqStartDate :: !(Maybe Text)
, _rqCurrency :: !(Maybe Text)
, _rqSort :: !(Maybe Text)
, _rqDimensions :: !(Maybe Text)
, _rqStartIndex :: !(Maybe (Textual Int32))
, _rqMaxResults :: !(Maybe (Textual Int32))
, _rqCallback :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
reportsQuery
:: ReportsQuery
reportsQuery =
ReportsQuery'
{ _rqXgafv = Nothing
, _rqMetrics = Nothing
, _rqUploadProtocol = Nothing
, _rqAccessToken = Nothing
, _rqEndDate = Nothing
, _rqIncludeHistoricalChannelData = Nothing
, _rqFilters = Nothing
, _rqUploadType = Nothing
, _rqIds = Nothing
, _rqStartDate = Nothing
, _rqCurrency = Nothing
, _rqSort = Nothing
, _rqDimensions = Nothing
, _rqStartIndex = Nothing
, _rqMaxResults = Nothing
, _rqCallback = Nothing
}
rqXgafv :: Lens' ReportsQuery (Maybe Xgafv)
rqXgafv = lens _rqXgafv (\ s a -> s{_rqXgafv = a})
rqMetrics :: Lens' ReportsQuery (Maybe Text)
rqMetrics
= lens _rqMetrics (\ s a -> s{_rqMetrics = a})
rqUploadProtocol :: Lens' ReportsQuery (Maybe Text)
rqUploadProtocol
= lens _rqUploadProtocol
(\ s a -> s{_rqUploadProtocol = a})
rqAccessToken :: Lens' ReportsQuery (Maybe Text)
rqAccessToken
= lens _rqAccessToken
(\ s a -> s{_rqAccessToken = a})
rqEndDate :: Lens' ReportsQuery (Maybe Text)
rqEndDate
= lens _rqEndDate (\ s a -> s{_rqEndDate = a})
rqIncludeHistoricalChannelData :: Lens' ReportsQuery (Maybe Bool)
rqIncludeHistoricalChannelData
= lens _rqIncludeHistoricalChannelData
(\ s a -> s{_rqIncludeHistoricalChannelData = a})
rqFilters :: Lens' ReportsQuery (Maybe Text)
rqFilters
= lens _rqFilters (\ s a -> s{_rqFilters = a})
rqUploadType :: Lens' ReportsQuery (Maybe Text)
rqUploadType
= lens _rqUploadType (\ s a -> s{_rqUploadType = a})
rqIds :: Lens' ReportsQuery (Maybe Text)
rqIds = lens _rqIds (\ s a -> s{_rqIds = a})
rqStartDate :: Lens' ReportsQuery (Maybe Text)
rqStartDate
= lens _rqStartDate (\ s a -> s{_rqStartDate = a})
rqCurrency :: Lens' ReportsQuery (Maybe Text)
rqCurrency
= lens _rqCurrency (\ s a -> s{_rqCurrency = a})
rqSort :: Lens' ReportsQuery (Maybe Text)
rqSort = lens _rqSort (\ s a -> s{_rqSort = a})
rqDimensions :: Lens' ReportsQuery (Maybe Text)
rqDimensions
= lens _rqDimensions (\ s a -> s{_rqDimensions = a})
rqStartIndex :: Lens' ReportsQuery (Maybe Int32)
rqStartIndex
= lens _rqStartIndex (\ s a -> s{_rqStartIndex = a})
. mapping _Coerce
rqMaxResults :: Lens' ReportsQuery (Maybe Int32)
rqMaxResults
= lens _rqMaxResults (\ s a -> s{_rqMaxResults = a})
. mapping _Coerce
rqCallback :: Lens' ReportsQuery (Maybe Text)
rqCallback
= lens _rqCallback (\ s a -> s{_rqCallback = a})
instance GoogleRequest ReportsQuery where
type Rs ReportsQuery = QueryResponse
type Scopes ReportsQuery =
'["https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.readonly",
"https://www.googleapis.com/auth/youtubepartner",
"https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
"https://www.googleapis.com/auth/yt-analytics.readonly"]
requestClient ReportsQuery'{..}
= go _rqXgafv _rqMetrics _rqUploadProtocol
_rqAccessToken
_rqEndDate
_rqIncludeHistoricalChannelData
_rqFilters
_rqUploadType
_rqIds
_rqStartDate
_rqCurrency
_rqSort
_rqDimensions
_rqStartIndex
_rqMaxResults
_rqCallback
(Just AltJSON)
youTubeAnalyticsService
where go
= buildClient (Proxy :: Proxy ReportsQueryResource)
mempty