list method
- String profileId, {
- bool? active,
- String? advertiserId,
- bool? archived,
- List<
String> ? audienceSegmentIds, - List<
String> ? campaignIds, - String? compatibility,
- List<
String> ? creativeIds, - List<
String> ? creativeOptimizationConfigurationIds, - bool? dynamicClickTracker,
- List<
String> ? ids, - List<
String> ? landingPageIds, - int? maxResults,
- String? overriddenEventTagId,
- String? pageToken,
- List<
String> ? placementIds, - List<
String> ? remarketingListIds, - String? searchString,
- List<
String> ? sizeIds, - String? sortField,
- String? sortOrder,
- bool? sslCompliant,
- bool? sslRequired,
- List<
String> ? type, - String? $fields,
Retrieves a list of ads, possibly filtered.
This method supports paging.
Request parameters:
profileId
- User profile ID associated with this request.
Value must have pattern ^\[^/\]+$
.
active
- Select only active ads.
advertiserId
- Select only ads with this advertiser ID.
archived
- Select only archived ads.
audienceSegmentIds
- Select only ads with these audience segment IDs.
campaignIds
- Select only ads with these campaign IDs.
compatibility
- Select default ads with the specified compatibility.
Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and
DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile
devices for regular or interstitial ads, respectively. APP and
APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers
to rendering an in-stream video ads developed with the VAST standard.
Possible string values are:
- "DISPLAY"
- "DISPLAY_INTERSTITIAL"
- "APP" : Deprecated enum value. No longer supported.
- "APP_INTERSTITIAL" : Deprecated enum value. No longer supported.
- "IN_STREAM_VIDEO"
- "IN_STREAM_AUDIO"
creativeIds
- Select only ads with these creative IDs assigned.
creativeOptimizationConfigurationIds
- Select only ads with these
creative optimization configuration IDs.
dynamicClickTracker
- Select only dynamic click trackers. Applicable
when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
trackers. If false, select static click trackers. Leave unset to select
both.
ids
- Select only ads with these IDs.
landingPageIds
- Select only ads with these landing page IDs.
maxResults
- Maximum number of results to return.
overriddenEventTagId
- Select only ads with this event tag override ID.
pageToken
- Value of the nextPageToken from the previous result page.
placementIds
- Select only ads with these placement IDs assigned.
remarketingListIds
- Select only ads whose list targeting expression use
these remarketing list IDs.
searchString
- Allows searching for objects by name or ID. Wildcards ()
are allowed. For example, "ad2015" will return objects with names like
"ad June 2015", "ad April 2015", or simply "ad 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 "ad" will match objects with name
"my ad", "ad 2015", or simply "ad".
sizeIds
- Select only ads with these size IDs.
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.
sslCompliant
- Select only ads that are SSL-compliant.
sslRequired
- Select only ads that require SSL.
type
- Select only ads with these types.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a AdsListResponse.
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<AdsListResponse> list(
core.String profileId, {
core.bool? active,
core.String? advertiserId,
core.bool? archived,
core.List<core.String>? audienceSegmentIds,
core.List<core.String>? campaignIds,
core.String? compatibility,
core.List<core.String>? creativeIds,
core.List<core.String>? creativeOptimizationConfigurationIds,
core.bool? dynamicClickTracker,
core.List<core.String>? ids,
core.List<core.String>? landingPageIds,
core.int? maxResults,
core.String? overriddenEventTagId,
core.String? pageToken,
core.List<core.String>? placementIds,
core.List<core.String>? remarketingListIds,
core.String? searchString,
core.List<core.String>? sizeIds,
core.String? sortField,
core.String? sortOrder,
core.bool? sslCompliant,
core.bool? sslRequired,
core.List<core.String>? type,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (active != null) 'active': ['${active}'],
if (advertiserId != null) 'advertiserId': [advertiserId],
if (archived != null) 'archived': ['${archived}'],
if (audienceSegmentIds != null) 'audienceSegmentIds': audienceSegmentIds,
if (campaignIds != null) 'campaignIds': campaignIds,
if (compatibility != null) 'compatibility': [compatibility],
if (creativeIds != null) 'creativeIds': creativeIds,
if (creativeOptimizationConfigurationIds != null)
'creativeOptimizationConfigurationIds':
creativeOptimizationConfigurationIds,
if (dynamicClickTracker != null)
'dynamicClickTracker': ['${dynamicClickTracker}'],
if (ids != null) 'ids': ids,
if (landingPageIds != null) 'landingPageIds': landingPageIds,
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (overriddenEventTagId != null)
'overriddenEventTagId': [overriddenEventTagId],
if (pageToken != null) 'pageToken': [pageToken],
if (placementIds != null) 'placementIds': placementIds,
if (remarketingListIds != null) 'remarketingListIds': remarketingListIds,
if (searchString != null) 'searchString': [searchString],
if (sizeIds != null) 'sizeIds': sizeIds,
if (sortField != null) 'sortField': [sortField],
if (sortOrder != null) 'sortOrder': [sortOrder],
if (sslCompliant != null) 'sslCompliant': ['${sslCompliant}'],
if (sslRequired != null) 'sslRequired': ['${sslRequired}'],
if (type != null) 'type': type,
if ($fields != null) 'fields': [$fields],
};
final url_ = 'userprofiles/' + core.Uri.encodeFull('$profileId') + '/ads';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return AdsListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}