list method

Future<CreativeGroupsListResponse> list(
  1. String profileId, {
  2. List<String>? advertiserIds,
  3. int? groupNumber,
  4. List<String>? ids,
  5. int? maxResults,
  6. String? pageToken,
  7. String? searchString,
  8. String? sortField,
  9. String? sortOrder,
  10. String? $fields,
})

Retrieves a list of creative groups, possibly filtered.

This method supports paging.

Request parameters:

profileId - User profile ID associated with this request. Value must have pattern ^\[^/\]+$.

advertiserIds - Select only creative groups that belong to these advertisers.

groupNumber - Select only creative groups that belong to this subgroup.

ids - Select only creative groups with these IDs.

maxResults - Maximum number of results to return.

pageToken - Value of the nextPageToken from the previous result page.

searchString - Allows searching for creative groups by name or ID. Wildcards () are allowed. For example, "creativegroup2015" will return creative groups with names like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", "creativegroup 2015", or simply "creativegroup".

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.

$fields - Selector specifying which fields to include in a partial response.

Completes with a CreativeGroupsListResponse.

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<CreativeGroupsListResponse> list(
  core.String profileId, {
  core.List<core.String>? advertiserIds,
  core.int? groupNumber,
  core.List<core.String>? ids,
  core.int? maxResults,
  core.String? pageToken,
  core.String? searchString,
  core.String? sortField,
  core.String? sortOrder,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (advertiserIds != null) 'advertiserIds': advertiserIds,
    if (groupNumber != null) 'groupNumber': ['${groupNumber}'],
    if (ids != null) 'ids': ids,
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (searchString != null) 'searchString': [searchString],
    if (sortField != null) 'sortField': [sortField],
    if (sortOrder != null) 'sortOrder': [sortOrder],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'userprofiles/' + core.Uri.encodeFull('$profileId') + '/creativeGroups';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return CreativeGroupsListResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}