list method
- String profileId, {
- List<
String> ? advertiserGroupIds, - List<
String> ? floodlightConfigurationIds, - List<
String> ? ids, - bool? includeAdvertisersWithoutGroupsOnly,
- int? maxResults,
- bool? onlyParent,
- String? pageToken,
- String? searchString,
- String? sortField,
- String? sortOrder,
- String? status,
- String? subaccountId,
- String? $fields,
Retrieves a list of advertisers, possibly filtered.
This method supports paging.
Request parameters:
profileId
- User profile ID associated with this request.
Value must have pattern ^\[^/\]+$
.
advertiserGroupIds
- Select only advertisers with these advertiser group
IDs.
floodlightConfigurationIds
- Select only advertisers with these
floodlight configuration IDs.
ids
- Select only advertisers with these IDs.
includeAdvertisersWithoutGroupsOnly
- Select only advertisers which do
not belong to any advertiser group.
maxResults
- Maximum number of results to return.
onlyParent
- Select only advertisers which use another advertiser's
floodlight configuration.
pageToken
- Value of the nextPageToken from the previous result page.
searchString
- Allows searching for objects by name or ID. Wildcards ()
are allowed. For example, "advertiser2015" will return objects with names
like "advertiser June 2015", "advertiser April 2015", or simply
"advertiser 2015". Most of the searches also add wildcards implicitly at
the start and the end of the search string. For example, a search string
of "advertiser" will match objects with name "my advertiser", "advertiser
2015", or simply "advertiser" .
sortField
- Field by which to sort the list.
Possible string values are:
- "ID"
- "NAME"
sortOrder
- Order of sorted results.
Possible string values are:
- "ASCENDING" : Ascending order.
- "DESCENDING" : Descending order.
status
- Select only advertisers with the specified status.
Possible string values are:
- "APPROVED" : Approved (ads can deliver)
- "ON_HOLD" : On-hold (all ads are stopped)
subaccountId
- Select only advertisers with these subaccount IDs.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a AdvertisersListResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<AdvertisersListResponse> list(
core.String profileId, {
core.List<core.String>? advertiserGroupIds,
core.List<core.String>? floodlightConfigurationIds,
core.List<core.String>? ids,
core.bool? includeAdvertisersWithoutGroupsOnly,
core.int? maxResults,
core.bool? onlyParent,
core.String? pageToken,
core.String? searchString,
core.String? sortField,
core.String? sortOrder,
core.String? status,
core.String? subaccountId,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (advertiserGroupIds != null) 'advertiserGroupIds': advertiserGroupIds,
if (floodlightConfigurationIds != null)
'floodlightConfigurationIds': floodlightConfigurationIds,
if (ids != null) 'ids': ids,
if (includeAdvertisersWithoutGroupsOnly != null)
'includeAdvertisersWithoutGroupsOnly': [
'${includeAdvertisersWithoutGroupsOnly}'
],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (onlyParent != null) 'onlyParent': ['${onlyParent}'],
if (pageToken != null) 'pageToken': [pageToken],
if (searchString != null) 'searchString': [searchString],
if (sortField != null) 'sortField': [sortField],
if (sortOrder != null) 'sortOrder': [sortOrder],
if (status != null) 'status': [status],
if (subaccountId != null) 'subaccountId': [subaccountId],
if ($fields != null) 'fields': [$fields],
};
final url_ =
'userprofiles/' + core.Uri.encodeFull('$profileId') + '/advertisers';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return AdvertisersListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}