{-# 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.SubAccounts.List
(
SubAccountsListResource
, subAccountsList
, SubAccountsList
, salSearchString
, salIds
, salProFileId
, salSortOrder
, salPageToken
, salSortField
, salMaxResults
) where
import Network.Google.DFAReporting.Types
import Network.Google.Prelude
type SubAccountsListResource =
"dfareporting" :>
"v3.2" :>
"userprofiles" :>
Capture "profileId" (Textual Int64) :>
"subaccounts" :>
QueryParam "searchString" Text :>
QueryParams "ids" (Textual Int64) :>
QueryParam "sortOrder" SubAccountsListSortOrder :>
QueryParam "pageToken" Text :>
QueryParam "sortField" SubAccountsListSortField :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "alt" AltJSON :>
Get '[JSON] SubAccountsListResponse
data SubAccountsList = SubAccountsList'
{ _salSearchString :: !(Maybe Text)
, _salIds :: !(Maybe [Textual Int64])
, _salProFileId :: !(Textual Int64)
, _salSortOrder :: !SubAccountsListSortOrder
, _salPageToken :: !(Maybe Text)
, _salSortField :: !SubAccountsListSortField
, _salMaxResults :: !(Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
subAccountsList
:: Int64
-> SubAccountsList
subAccountsList pSalProFileId_ =
SubAccountsList'
{ _salSearchString = Nothing
, _salIds = Nothing
, _salProFileId = _Coerce # pSalProFileId_
, _salSortOrder = SALSOAscending
, _salPageToken = Nothing
, _salSortField = SALSFID
, _salMaxResults = 1000
}
salSearchString :: Lens' SubAccountsList (Maybe Text)
salSearchString
= lens _salSearchString
(\ s a -> s{_salSearchString = a})
salIds :: Lens' SubAccountsList [Int64]
salIds
= lens _salIds (\ s a -> s{_salIds = a}) . _Default .
_Coerce
salProFileId :: Lens' SubAccountsList Int64
salProFileId
= lens _salProFileId (\ s a -> s{_salProFileId = a})
. _Coerce
salSortOrder :: Lens' SubAccountsList SubAccountsListSortOrder
salSortOrder
= lens _salSortOrder (\ s a -> s{_salSortOrder = a})
salPageToken :: Lens' SubAccountsList (Maybe Text)
salPageToken
= lens _salPageToken (\ s a -> s{_salPageToken = a})
salSortField :: Lens' SubAccountsList SubAccountsListSortField
salSortField
= lens _salSortField (\ s a -> s{_salSortField = a})
salMaxResults :: Lens' SubAccountsList Int32
salMaxResults
= lens _salMaxResults
(\ s a -> s{_salMaxResults = a})
. _Coerce
instance GoogleRequest SubAccountsList where
type Rs SubAccountsList = SubAccountsListResponse
type Scopes SubAccountsList =
'["https://www.googleapis.com/auth/dfatrafficking"]
requestClient SubAccountsList'{..}
= go _salProFileId _salSearchString
(_salIds ^. _Default)
(Just _salSortOrder)
_salPageToken
(Just _salSortField)
(Just _salMaxResults)
(Just AltJSON)
dFAReportingService
where go
= buildClient
(Proxy :: Proxy SubAccountsListResource)
mempty