list method

Future<ListCreativesResponse> list(
  1. String accountId, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? query,
  5. String? $fields,
})

Lists creatives.

Request parameters:

accountId - The account to list the creatives from. Specify "-" to list all creatives the current user has access to.

pageSize - Requested page size. The server may return fewer creatives than requested (due to timeout constraint) even if more are available via another call. If unspecified, server will pick an appropriate default. Acceptable values are 1 to 1000, inclusive.

pageToken - A token identifying a page of results the server should return. Typically, this is the value of ListCreativesResponse.next_page_token returned from the previous call to 'ListCreatives' method.

query - An optional query string to filter creatives. If no filter is specified, all active creatives will be returned. Supported queries are: - accountId=account_id_string - creativeId=creative_id_string - dealsStatus: {approved, conditionally_approved, disapproved, not_checked}

  • openAuctionStatus: {approved, conditionally_approved, disapproved, not_checked} - attribute: {a numeric attribute from the list of attributes} - disapprovalReason: {a reason from DisapprovalReason} Example: 'accountId=12345 AND (dealsStatus:disapproved AND disapprovalReason:unacceptable_content) OR attribute:47'

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

Completes with a ListCreativesResponse.

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<ListCreativesResponse> list(
  core.String accountId, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? query,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (query != null) 'query': [query],
    if ($fields != null) 'fields': [$fields],
  };

  final _url = 'v2beta1/accounts/' +
      commons.escapeVariable('$accountId') +
      '/creatives';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return ListCreativesResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}