list method
- String profileId, {
- List<
String> ? advertiserGroupIds, - List<
String> ? advertiserIds, - bool? archived,
- bool? atLeastOneOptimizationActivity,
- List<
String> ? excludedIds, - List<
String> ? ids, - int? maxResults,
- String? overriddenEventTagId,
- String? pageToken,
- String? searchString,
- String? sortField,
- String? sortOrder,
- String? subaccountId,
- String? $fields,
Retrieves a list of campaigns, possibly filtered.
This method supports paging.
Request parameters:
profileId
- User profile ID associated with this request.
Value must have pattern ^\[^/\]+$
.
advertiserGroupIds
- Select only campaigns whose advertisers belong to
these advertiser groups.
advertiserIds
- Select only campaigns that belong to these advertisers.
archived
- Select only archived campaigns. Don't set this field to
select both archived and non-archived campaigns.
atLeastOneOptimizationActivity
- Select only campaigns that have at
least one optimization activity.
excludedIds
- Exclude campaigns with these IDs.
ids
- Select only campaigns with these IDs.
maxResults
- Maximum number of results to return.
overriddenEventTagId
- Select only campaigns that have overridden this
event tag ID.
pageToken
- Value of the nextPageToken from the previous result page.
searchString
- Allows searching for campaigns by name or ID. Wildcards
() are allowed. For example, "campaign2015" will return campaigns with
names like "campaign June 2015", "campaign April 2015", or simply
"campaign 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
"campaign" will match campaigns with name "my campaign", "campaign 2015",
or simply "campaign".
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.
subaccountId
- Select only campaigns that belong to this subaccount.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a CampaignsListResponse.
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<CampaignsListResponse> list(
core.String profileId, {
core.List<core.String>? advertiserGroupIds,
core.List<core.String>? advertiserIds,
core.bool? archived,
core.bool? atLeastOneOptimizationActivity,
core.List<core.String>? excludedIds,
core.List<core.String>? ids,
core.int? maxResults,
core.String? overriddenEventTagId,
core.String? pageToken,
core.String? searchString,
core.String? sortField,
core.String? sortOrder,
core.String? subaccountId,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (advertiserGroupIds != null) 'advertiserGroupIds': advertiserGroupIds,
if (advertiserIds != null) 'advertiserIds': advertiserIds,
if (archived != null) 'archived': ['${archived}'],
if (atLeastOneOptimizationActivity != null)
'atLeastOneOptimizationActivity': ['${atLeastOneOptimizationActivity}'],
if (excludedIds != null) 'excludedIds': excludedIds,
if (ids != null) 'ids': ids,
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (overriddenEventTagId != null)
'overriddenEventTagId': [overriddenEventTagId],
if (pageToken != null) 'pageToken': [pageToken],
if (searchString != null) 'searchString': [searchString],
if (sortField != null) 'sortField': [sortField],
if (sortOrder != null) 'sortOrder': [sortOrder],
if (subaccountId != null) 'subaccountId': [subaccountId],
if ($fields != null) 'fields': [$fields],
};
final url_ =
'userprofiles/' + core.Uri.encodeFull('$profileId') + '/campaigns';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return CampaignsListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}