{-# 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.Accounts.List
(
AccountsListResource
, accountsList
, AccountsList
, accSearchString
, accIds
, accProFileId
, accSortOrder
, accActive
, accPageToken
, accSortField
, accMaxResults
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type AccountsListResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"accounts" :>
QueryParam "searchString" Text :>
QueryParams "ids" (Textual Int64) :>
QueryParam "sortOrder" AccountsListSortOrder :>
QueryParam "active" Bool :>
QueryParam "pageToken" Text :>
QueryParam "sortField" AccountsListSortField :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "alt" AltJSON :>
Get '[JSON] AccountsListResponse
data AccountsList = AccountsList'
{ _accSearchString :: !(Maybe Text)
, _accIds :: !(Maybe [Textual Int64])
, _accProFileId :: !(Textual Int64)
, _accSortOrder :: !AccountsListSortOrder
, _accActive :: !(Maybe Bool)
, _accPageToken :: !(Maybe Text)
, _accSortField :: !AccountsListSortField
, _accMaxResults :: !(Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
accountsList
:: Int64
-> AccountsList
accountsList pAccProFileId_ =
AccountsList'
{ _accSearchString = Nothing
, _accIds = Nothing
, _accProFileId = _Coerce # pAccProFileId_
, _accSortOrder = AAscending
, _accActive = Nothing
, _accPageToken = Nothing
, _accSortField = AID
, _accMaxResults = 1000
}
accSearchString :: Lens' AccountsList (Maybe Text)
accSearchString
= lens _accSearchString
(\ s a -> s{_accSearchString = a})
accIds :: Lens' AccountsList [Int64]
accIds
= lens _accIds (\ s a -> s{_accIds = a}) . _Default .
_Coerce
accProFileId :: Lens' AccountsList Int64
accProFileId
= lens _accProFileId (\ s a -> s{_accProFileId = a})
. _Coerce
accSortOrder :: Lens' AccountsList AccountsListSortOrder
accSortOrder
= lens _accSortOrder (\ s a -> s{_accSortOrder = a})
accActive :: Lens' AccountsList (Maybe Bool)
accActive
= lens _accActive (\ s a -> s{_accActive = a})
accPageToken :: Lens' AccountsList (Maybe Text)
accPageToken
= lens _accPageToken (\ s a -> s{_accPageToken = a})
accSortField :: Lens' AccountsList AccountsListSortField
accSortField
= lens _accSortField (\ s a -> s{_accSortField = a})
accMaxResults :: Lens' AccountsList Int32
accMaxResults
= lens _accMaxResults
(\ s a -> s{_accMaxResults = a})
. _Coerce
instance GoogleRequest AccountsList where
type Rs AccountsList = AccountsListResponse
type Scopes AccountsList =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient AccountsList'{..}
= go _accProFileId _accSearchString
(_accIds ^. _Default)
(Just _accSortOrder)
_accActive
_accPageToken
(Just _accSortField)
(Just _accMaxResults)
(Just AltJSON)
dFAReportingService
where go
= buildClient (Proxy :: Proxy AccountsListResource)
mempty