list method

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

List all creative-deal associations.

Request parameters:

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

creativeId - The creative ID to list the associations from. Specify "-" to list all creatives under the above account.

pageSize - Requested page size. Server may return fewer associations than requested. If unspecified, server will pick an appropriate default.

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

query - An optional query string to filter deal associations. If no filter is specified, all associations will be returned. Supported queries are: - accountId=account_id_string - creativeId=creative_id_string - dealsId=deals_id_string - dealsStatus:{approved, conditionally_approved, disapproved, not_checked} - openAuctionStatus:{approved, conditionally_approved, disapproved, not_checked} Example: 'dealsId=12345 AND dealsStatus:disapproved'

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

Completes with a ListDealAssociationsResponse.

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<ListDealAssociationsResponse> list(
  core.String accountId,
  core.String creativeId, {
  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/' +
      commons.escapeVariable('$creativeId') +
      '/dealAssociations';

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