list method

Future<ListCreativesResponse> list(
  1. String parent, {
  2. String? filter,
  3. int? pageSize,
  4. String? pageToken,
  5. String? view,
  6. String? $fields,
})

Lists creatives as they are at the time of the initial request.

This call may take multiple hours to complete. For large, paginated requests, this method returns a snapshot of creatives at the time of request for the first page. lastStatusUpdate and creativeServingDecision may be outdated for creatives on sequential pages. We recommend [Google Cloud Pub/Sub](//cloud.google.com/pubsub/docs/overview) to view the latest status.

Request parameters:

parent - Required. Name of the parent buyer that owns the creatives. The pattern for this resource is either buyers/{buyerAccountId} or bidders/{bidderAccountId}. For buyers/{buyerAccountId}, the buyerAccountId can be one of the following: 1. The ID of the buyer that is accessing their own creatives. 2. The ID of the child seat buyer under a bidder account. So for listing creatives pertaining to the child seat buyer (456) under bidder account (123), you would use the pattern: buyers/456. 3. The ID of the bidder itself. So for listing creatives pertaining to bidder (123), you would use buyers/123. If you want to access all creatives pertaining to both the bidder and all of its child seat accounts, you would use bidders/{bidderAccountId}, for example, for all creatives pertaining to bidder (123), use bidders/123. Value must have pattern ^bidders/\[^/\]+$.

filter - Query string to filter creatives. If no filter is specified, all active creatives will be returned. Example: 'accountId=12345 AND (dealsStatus:DISAPPROVED AND disapprovalReason:UNACCEPTABLE_CONTENT) OR declaredAttributes:IS_COOKIE_TARGETED'

pageSize - Requested page size. The server may return fewer creatives than requested (due to timeout constraint) even if more are available through 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.nextPageToken returned from the previous call to the 'ListCreatives' method. Page tokens for continued pages are valid for up to five hours, counting from the call to 'ListCreatives' for the first page.

view - Controls the amount of information included in the response. By default only creativeServingDecision is included. To retrieve the entire creative resource (including the declared fields and the creative content) specify the view as "FULL". Possible string values are:

  • "CREATIVE_VIEW_UNSPECIFIED" : Not specified, equivalent to SERVING_DECISION_ONLY.
  • "SERVING_DECISION_ONLY" : Only creativeServingDecision is included in the response.
  • "FULL" : The entire creative resource (including the declared fields and the creative content) is included in the response.

$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 parent, {
  core.String? filter,
  core.int? pageSize,
  core.String? pageToken,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (filter != null) 'filter': [filter],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/creatives';

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