list method

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

Lists targeting options of a given type.

Request parameters:

targetingType - Required. The type of targeting option to be listed. Accepted values are: * TARGETING_TYPE_APP_CATEGORY * TARGETING_TYPE_AGE_RANGE * TARGETING_TYPE_GENDER * TARGETING_TYPE_VIDEO_PLAYER_SIZE * TARGETING_TYPE_USER_REWARDED_CONTENT * TARGETING_TYPE_PARENTAL_STATUS

  • TARGETING_TYPE_CONTENT_INSTREAM_POSITION * TARGETING_TYPE_CONTENT_OUTSTREAM_POSITION * TARGETING_TYPE_DEVICE_TYPE
  • TARGETING_TYPE_BROWSER * TARGETING_TYPE_HOUSEHOLD_INCOME * TARGETING_TYPE_ON_SCREEN_POSITION * TARGETING_TYPE_CARRIER_AND_ISP * TARGETING_TYPE_OPERATING_SYSTEM * TARGETING_TYPE_DEVICE_MAKE_MODEL * TARGETING_TYPE_ENVIRONMENT * TARGETING_TYPE_CATEGORY * TARGETING_TYPE_VIEWABILITY * TARGETING_TYPE_AUTHORIZED_SELLER_STATUS * TARGETING_TYPE_LANGUAGE * TARGETING_TYPE_GEO_REGION * TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION * TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION * TARGETING_TYPE_EXCHANGE
  • TARGETING_TYPE_SUB_EXCHANGE * TARGETING_TYPE_NATIVE_CONTENT_POSITION
  • TARGETING_TYPE_OMID Value must have pattern ^\[^/\]+$. Possible string values are:
  • "TARGETING_TYPE_UNSPECIFIED" : Default value when type is not specified or is unknown in this version.
  • "TARGETING_TYPE_CHANNEL" : Target a channel (a custom group of related websites or apps).
  • "TARGETING_TYPE_APP_CATEGORY" : Target an app category (for example, education or puzzle games).
  • "TARGETING_TYPE_APP" : Target a specific app (for example, Angry Birds).
  • "TARGETING_TYPE_URL" : Target a specific url (for example, quora.com).
  • "TARGETING_TYPE_DAY_AND_TIME" : Target ads during a chosen time period on a specific day.
  • "TARGETING_TYPE_AGE_RANGE" : Target ads to a specific age range (for example, 18-24).
  • "TARGETING_TYPE_REGIONAL_LOCATION_LIST" : Target ads to the specified regions on a regional location list.
  • "TARGETING_TYPE_PROXIMITY_LOCATION_LIST" : Target ads to the specified points of interest on a proximity location list.
  • "TARGETING_TYPE_GENDER" : Target ads to a specific gender (for example, female or male).
  • "TARGETING_TYPE_VIDEO_PLAYER_SIZE" : Target a specific video player size for video ads.
  • "TARGETING_TYPE_USER_REWARDED_CONTENT" : Target user rewarded content for video ads.
  • "TARGETING_TYPE_PARENTAL_STATUS" : Target ads to a specific parental status (for example, parent or not a parent).
  • "TARGETING_TYPE_CONTENT_INSTREAM_POSITION" : Target video or audio ads in a specific content instream position (for example, pre-roll, mid-roll, or post-roll).
  • "TARGETING_TYPE_CONTENT_OUTSTREAM_POSITION" : Target ads in a specific content outstream position.
  • "TARGETING_TYPE_DEVICE_TYPE" : Target ads to a specific device type (for example, tablet or connected TV).
  • "TARGETING_TYPE_AUDIENCE_GROUP" : Target ads to an audience or groups of audiences. Singleton field, at most one can exist on a single Lineitem at a time.
  • "TARGETING_TYPE_BROWSER" : Target ads to specific web browsers (for example, Chrome).
  • "TARGETING_TYPE_HOUSEHOLD_INCOME" : Target ads to a specific household income range (for example, top 10%).
  • "TARGETING_TYPE_ON_SCREEN_POSITION" : Target ads in a specific on screen position.
  • "TARGETING_TYPE_THIRD_PARTY_VERIFIER" : Filter web sites through third party verification (for example, IAS or DoubleVerify).
  • "TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION" : Filter web sites by specific digital content label ratings (for example, DL-MA: suitable only for mature audiences).
  • "TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION" : Filter website content by sensitive categories (for example, adult).
  • "TARGETING_TYPE_ENVIRONMENT" : Target ads to a specific environment (for example, web or app).
  • "TARGETING_TYPE_CARRIER_AND_ISP" : Target ads to a specific network carrier or internet service provider (ISP) (for example, Comcast or Orange).
  • "TARGETING_TYPE_OPERATING_SYSTEM" : Target ads to a specific operating system (for example, macOS).
  • "TARGETING_TYPE_DEVICE_MAKE_MODEL" : Target ads to a specific device make or model (for example, Roku or Samsung).
  • "TARGETING_TYPE_KEYWORD" : Target ads to a specific keyword (for example, dog or retriever).
  • "TARGETING_TYPE_NEGATIVE_KEYWORD_LIST" : Target ads to a specific negative keyword list.
  • "TARGETING_TYPE_VIEWABILITY" : Target ads to a specific viewability (for example, 80% viewable).
  • "TARGETING_TYPE_CATEGORY" : Target ads to a specific content category (for example, arts & entertainment).
  • "TARGETING_TYPE_INVENTORY_SOURCE" : Purchase impressions from specific deals and auction packages.
  • "TARGETING_TYPE_LANGUAGE" : Target ads to a specific language (for example, English or Japanese).
  • "TARGETING_TYPE_AUTHORIZED_SELLER_STATUS" : Target ads to ads.txt authorized sellers. If no targeting option of this type is assigned, the resource uses the "Authorized Direct Sellers and Resellers" option by default.
  • "TARGETING_TYPE_GEO_REGION" : Target ads to a specific regional location (for example, a city or state).
  • "TARGETING_TYPE_INVENTORY_SOURCE_GROUP" : Purchase impressions from a group of deals and auction packages.
  • "TARGETING_TYPE_EXCHANGE" : Purchase impressions from specific exchanges.
  • "TARGETING_TYPE_SUB_EXCHANGE" : Purchase impressions from specific sub-exchanges.
  • "TARGETING_TYPE_POI" : Target ads around a specific point of interest, such as a notable building, a street address, or latitude/longitude coordinates.
  • "TARGETING_TYPE_BUSINESS_CHAIN" : Target ads around locations of a business chain within a specific geo region.
  • "TARGETING_TYPE_CONTENT_DURATION" : Target ads to a specific video content duration.
  • "TARGETING_TYPE_CONTENT_STREAM_TYPE" : Target ads to a specific video content stream type.
  • "TARGETING_TYPE_NATIVE_CONTENT_POSITION" : Target ads to a specific native content position.
  • "TARGETING_TYPE_OMID" : Target ads in an Open Measurement enabled inventory.
  • "TARGETING_TYPE_AUDIO_CONTENT_TYPE" : Target ads to a specific audio content type.
  • "TARGETING_TYPE_CONTENT_GENRE" : Target ads to a specific content genre.
  • "TARGETING_TYPE_YOUTUBE_VIDEO" : Target ads to a specific YouTube video. Targeting of this type cannot be created or updated using the API. Although this targeting is inherited by child resources, inherited targeting of this type will not be retrieveable.
  • "TARGETING_TYPE_YOUTUBE_CHANNEL" : Target ads to a specific YouTube channel. Targeting of this type cannot be created or updated using the API. Although this targeting is inherited by child resources, inherited targeting of this type will not be retrieveable.
  • "TARGETING_TYPE_SESSION_POSITION" : Target ads to a serve it in a certain position of a session. Only supported for Ad Group resources under YouTube Programmatic Reservation line items. Targeting of this type cannot be created or updated using the API.

advertiserId - Required. The Advertiser this request is being made in the context of.

filter - Allows filtering by targeting option fields. Supported syntax:

  • Filter expressions are made up of one or more restrictions. * Restrictions can be combined by OR logical operators. * A restriction has the form of {field} {operator} {value}. * All fields must use the EQUALS (=) operator. Supported fields: * carrierAndIspDetails.type * geoRegionDetails.geoRegionType * targetingOptionId Examples: * All GEO REGION targeting options that belong to sub type GEO_REGION_TYPE_COUNTRY or GEO_REGION_TYPE_STATE: geoRegionDetails.geoRegionType="GEO_REGION_TYPE_COUNTRY" OR geoRegionDetails.geoRegionType="GEO_REGION_TYPE_STATE" * All CARRIER AND ISP targeting options that belong to sub type CARRIER_AND_ISP_TYPE_CARRIER: carrierAndIspDetails.type="CARRIER_AND_ISP_TYPE_CARRIER" The length of this field should be no more than 500 characters. Reference our [filter LIST requests](/display-video/api/guides/how-tos/filters) guide for more information.

orderBy - Field by which to sort the list. Acceptable values are: * targetingOptionId (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: targetingOptionId desc.

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

pageToken - 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 ListTargetingOptions 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 ListTargetingOptionsResponse.

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<ListTargetingOptionsResponse> list(
  core.String targetingType, {
  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>>{
    if (advertiserId != null) 'advertiserId': [advertiserId],
    if (filter != null) 'filter': [filter],
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/targetingTypes/' +
      core.Uri.encodeFull('$targetingType') +
      '/targetingOptions';

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