{-# 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.Orders.List
(
OrdersListResource
, ordersList
, OrdersList
, olSearchString
, olIds
, olProFileId
, olSortOrder
, olPageToken
, olProjectId
, olSortField
, olSiteId
, olMaxResults
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type OrdersListResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"projects" :>
Capture "projectId" (Textual Int64) :>
"orders" :>
QueryParam "searchString" Text :>
QueryParams "ids" (Textual Int64) :>
QueryParam "sortOrder" OrdersListSortOrder :>
QueryParam "pageToken" Text :>
QueryParam "sortField" OrdersListSortField :>
QueryParams "siteId" (Textual Int64) :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "alt" AltJSON :>
Get '[JSON] OrdersListResponse
data OrdersList = OrdersList'
{ _olSearchString :: !(Maybe Text)
, _olIds :: !(Maybe [Textual Int64])
, _olProFileId :: !(Textual Int64)
, _olSortOrder :: !OrdersListSortOrder
, _olPageToken :: !(Maybe Text)
, _olProjectId :: !(Textual Int64)
, _olSortField :: !OrdersListSortField
, _olSiteId :: !(Maybe [Textual Int64])
, _olMaxResults :: !(Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
ordersList
:: Int64
-> Int64
-> OrdersList
ordersList pOlProFileId_ pOlProjectId_ =
OrdersList'
{ _olSearchString = Nothing
, _olIds = Nothing
, _olProFileId = _Coerce # pOlProFileId_
, _olSortOrder = OLSOAscending
, _olPageToken = Nothing
, _olProjectId = _Coerce # pOlProjectId_
, _olSortField = OLSFID
, _olSiteId = Nothing
, _olMaxResults = 1000
}
olSearchString :: Lens' OrdersList (Maybe Text)
olSearchString
= lens _olSearchString
(\ s a -> s{_olSearchString = a})
olIds :: Lens' OrdersList [Int64]
olIds
= lens _olIds (\ s a -> s{_olIds = a}) . _Default .
_Coerce
olProFileId :: Lens' OrdersList Int64
olProFileId
= lens _olProFileId (\ s a -> s{_olProFileId = a}) .
_Coerce
olSortOrder :: Lens' OrdersList OrdersListSortOrder
olSortOrder
= lens _olSortOrder (\ s a -> s{_olSortOrder = a})
olPageToken :: Lens' OrdersList (Maybe Text)
olPageToken
= lens _olPageToken (\ s a -> s{_olPageToken = a})
olProjectId :: Lens' OrdersList Int64
olProjectId
= lens _olProjectId (\ s a -> s{_olProjectId = a}) .
_Coerce
olSortField :: Lens' OrdersList OrdersListSortField
olSortField
= lens _olSortField (\ s a -> s{_olSortField = a})
olSiteId :: Lens' OrdersList [Int64]
olSiteId
= lens _olSiteId (\ s a -> s{_olSiteId = a}) .
_Default
. _Coerce
olMaxResults :: Lens' OrdersList Int32
olMaxResults
= lens _olMaxResults (\ s a -> s{_olMaxResults = a})
. _Coerce
instance GoogleRequest OrdersList where
type Rs OrdersList = OrdersListResponse
type Scopes OrdersList =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient OrdersList'{..}
= go _olProFileId _olProjectId _olSearchString
(_olIds ^. _Default)
(Just _olSortOrder)
_olPageToken
(Just _olSortField)
(_olSiteId ^. _Default)
(Just _olMaxResults)
(Just AltJSON)
dFAReportingService
where go
= buildClient (Proxy :: Proxy OrdersListResource)
mempty