list method
- String profileId, {
- bool? active,
- String? advertiserId,
- bool? archived,
- String? campaignId,
- List<
String> ? companionCreativeIds, - List<
String> ? creativeFieldIds, - List<
String> ? ids, - int? maxResults,
- String? pageToken,
- List<
String> ? renderingIds, - String? searchString,
- List<
String> ? sizeIds, - String? sortField,
- String? sortOrder,
- String? studioCreativeId,
- List<
String> ? types, - String? $fields,
Retrieves a list of creatives, possibly filtered.
This method supports paging.
Request parameters:
profileId
- User profile ID associated with this request.
Value must have pattern ^\[^/\]+$
.
active
- Select only active creatives. Leave blank to select active and
inactive creatives.
advertiserId
- Select only creatives with this advertiser ID.
archived
- Select only archived creatives. Leave blank to select
archived and unarchived creatives.
campaignId
- Select only creatives with this campaign ID.
companionCreativeIds
- Select only in-stream video creatives with these
companion IDs.
creativeFieldIds
- Select only creatives with these creative field IDs.
ids
- Select only creatives with these IDs.
maxResults
- Maximum number of results to return.
pageToken
- Value of the nextPageToken from the previous result page.
renderingIds
- Select only creatives with these rendering IDs.
searchString
- Allows searching for objects by name or ID. Wildcards ()
are allowed. For example, "creative2015" will return objects with names
like "creative June 2015", "creative April 2015", or simply "creative
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 "creative"
will match objects with name "my creative", "creative 2015", or simply
"creative".
sizeIds
- Select only creatives 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.
studioCreativeId
- Select only creatives corresponding to this Studio
creative ID.
types
- Select only creatives with these creative types.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a CreativesListResponse.
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<CreativesListResponse> list(
core.String profileId, {
core.bool? active,
core.String? advertiserId,
core.bool? archived,
core.String? campaignId,
core.List<core.String>? companionCreativeIds,
core.List<core.String>? creativeFieldIds,
core.List<core.String>? ids,
core.int? maxResults,
core.String? pageToken,
core.List<core.String>? renderingIds,
core.String? searchString,
core.List<core.String>? sizeIds,
core.String? sortField,
core.String? sortOrder,
core.String? studioCreativeId,
core.List<core.String>? types,
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 (campaignId != null) 'campaignId': [campaignId],
if (companionCreativeIds != null)
'companionCreativeIds': companionCreativeIds,
if (creativeFieldIds != null) 'creativeFieldIds': creativeFieldIds,
if (ids != null) 'ids': ids,
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if (renderingIds != null) 'renderingIds': renderingIds,
if (searchString != null) 'searchString': [searchString],
if (sizeIds != null) 'sizeIds': sizeIds,
if (sortField != null) 'sortField': [sortField],
if (sortOrder != null) 'sortOrder': [sortOrder],
if (studioCreativeId != null) 'studioCreativeId': [studioCreativeId],
if (types != null) 'types': types,
if ($fields != null) 'fields': [$fields],
};
final url_ =
'userprofiles/' + core.Uri.encodeFull('$profileId') + '/creatives';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return CreativesListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}