{-# 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.DFAReporting.Projects.List
(
ProjectsListResource
, projectsList
, ProjectsList
, plSearchString
, plIds
, plProFileId
, plSortOrder
, plPageToken
, plSortField
, plAdvertiserIds
, plMaxResults
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type ProjectsListResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"projects" :>
QueryParam "searchString" Text :>
QueryParams "ids" (Textual Int64) :>
QueryParam "sortOrder" ProjectsListSortOrder :>
QueryParam "pageToken" Text :>
QueryParam "sortField" ProjectsListSortField :>
QueryParams "advertiserIds" (Textual Int64) :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "alt" AltJSON :>
Get '[JSON] ProjectsListResponse
data ProjectsList = ProjectsList'
{ _plSearchString :: !(Maybe Text)
, _plIds :: !(Maybe [Textual Int64])
, _plProFileId :: !(Textual Int64)
, _plSortOrder :: !ProjectsListSortOrder
, _plPageToken :: !(Maybe Text)
, _plSortField :: !ProjectsListSortField
, _plAdvertiserIds :: !(Maybe [Textual Int64])
, _plMaxResults :: !(Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
projectsList
:: Int64
-> ProjectsList
projectsList pPlProFileId_ =
ProjectsList'
{ _plSearchString = Nothing
, _plIds = Nothing
, _plProFileId = _Coerce # pPlProFileId_
, _plSortOrder = PLSOAscending
, _plPageToken = Nothing
, _plSortField = PID
, _plAdvertiserIds = Nothing
, _plMaxResults = 1000
}
plSearchString :: Lens' ProjectsList (Maybe Text)
plSearchString
= lens _plSearchString
(\ s a -> s{_plSearchString = a})
plIds :: Lens' ProjectsList [Int64]
plIds
= lens _plIds (\ s a -> s{_plIds = a}) . _Default .
_Coerce
plProFileId :: Lens' ProjectsList Int64
plProFileId
= lens _plProFileId (\ s a -> s{_plProFileId = a}) .
_Coerce
plSortOrder :: Lens' ProjectsList ProjectsListSortOrder
plSortOrder
= lens _plSortOrder (\ s a -> s{_plSortOrder = a})
plPageToken :: Lens' ProjectsList (Maybe Text)
plPageToken
= lens _plPageToken (\ s a -> s{_plPageToken = a})
plSortField :: Lens' ProjectsList ProjectsListSortField
plSortField
= lens _plSortField (\ s a -> s{_plSortField = a})
plAdvertiserIds :: Lens' ProjectsList [Int64]
plAdvertiserIds
= lens _plAdvertiserIds
(\ s a -> s{_plAdvertiserIds = a})
. _Default
. _Coerce
plMaxResults :: Lens' ProjectsList Int32
plMaxResults
= lens _plMaxResults (\ s a -> s{_plMaxResults = a})
. _Coerce
instance GoogleRequest ProjectsList where
type Rs ProjectsList = ProjectsListResponse
type Scopes ProjectsList =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient ProjectsList'{..}
= go _plProFileId _plSearchString
(_plIds ^. _Default)
(Just _plSortOrder)
_plPageToken
(Just _plSortField)
(_plAdvertiserIds ^. _Default)
(Just _plMaxResults)
(Just AltJSON)
dFAReportingService
where go
= buildClient (Proxy :: Proxy ProjectsListResource)
mempty