list method

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

Lists ad assets under an advertiser ID.

Only supports the retrieval of assets of AdAssetType AD_ASSET_TYPE_YOUTUBE_VIDEO.

Request parameters:

advertiserId - Required. The ID of the advertiser the ad assets belong to. Value must have pattern ^\[^/\]+$.

filter - Optional. Allows filtering of the results by ad asset fields. Supported syntax: * A restriction has the form of {field} {operator} {value}. * All fields must use the EQUALS (=) operator. Supported fields: * youtubeVideoAsset.youtubeVideoId * entityStatus Examples: * All active YouTube video ad assets under an advertiser: entityStatus=ENTITY_STATUS_ACTIVE

orderBy - Optional. Field by which to sort the list. Acceptable values are: * entityStatus * youtubeVideoAsset.youtubeVideoId * adAssetId (default) The default sorting order is ascending. To specify descending order for a field, a suffix "desc" should be added to the field name. Example: adAssetId desc.

pageSize - Optional. Requested page size. Must be between 1 and 5000. If unspecified will default to 5000. Returns error code INVALID_ARGUMENT if an invalid value is specified.

pageToken - Optional. A token identifying a page of results the server should return. Typically, this is the value of next_page_token returned from the previous call to ListAdAssets method. If not specified, the first page of results will be returned.

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

Completes with a ListAdAssetsResponse.

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

  final url_ =
      'v4/advertisers/' + core.Uri.encodeFull('$advertiserId') + '/adAssets';

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