list method

Future<PlacementsListResponse> list(
  1. String profileId, {
  2. List<String>? activeStatus,
  3. List<String>? advertiserIds,
  4. List<String>? campaignIds,
  5. List<String>? compatibilities,
  6. List<String>? contentCategoryIds,
  7. List<String>? directorySiteIds,
  8. List<String>? groupIds,
  9. List<String>? ids,
  10. String? maxEndDate,
  11. int? maxResults,
  12. String? maxStartDate,
  13. String? minEndDate,
  14. String? minStartDate,
  15. String? pageToken,
  16. String? paymentSource,
  17. List<String>? placementStrategyIds,
  18. List<String>? pricingTypes,
  19. String? searchString,
  20. List<String>? siteIds,
  21. List<String>? sizeIds,
  22. String? sortField,
  23. String? sortOrder,
  24. String? $fields,
})

Retrieves a list of placements, possibly filtered.

This method supports paging.

Request parameters:

profileId - User profile ID associated with this request. Value must have pattern ^\[^/\]+$.

activeStatus - Select only placements with these active statuses.

advertiserIds - Select only placements that belong to these advertisers.

campaignIds - Select only placements that belong to these campaigns.

compatibilities - Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.

contentCategoryIds - Select only placements that are associated with these content categories.

directorySiteIds - Select only placements that are associated with these directory sites.

groupIds - Select only placements that belong to these placement groups.

ids - Select only placements with these IDs.

maxEndDate - Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd".

maxResults - Maximum number of results to return.

maxStartDate - Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd".

minEndDate - Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd".

minStartDate - Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd".

pageToken - Value of the nextPageToken from the previous result page.

paymentSource - Select only placements with this payment source. Possible string values are:

  • "PLACEMENT_AGENCY_PAID"
  • "PLACEMENT_PUBLISHER_PAID"

placementStrategyIds - Select only placements that are associated with these placement strategies.

pricingTypes - Select only placements with these pricing types.

searchString - Allows searching for placements by name or ID. Wildcards () are allowed. For example, "placement2015" will return placements with names like "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply "placement" .

siteIds - Select only placements that are associated with these sites.

sizeIds - Select only placements that are associated with these sizes.

sortField - Field by which to sort the list. Possible string values are:

  • "ID"
  • "NAME"

sortOrder - Order of sorted results. Possible string values are:

  • "ASCENDING" : Ascending order.
  • "DESCENDING" : Descending order.

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

Completes with a PlacementsListResponse.

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<PlacementsListResponse> list(
  core.String profileId, {
  core.List<core.String>? activeStatus,
  core.List<core.String>? advertiserIds,
  core.List<core.String>? campaignIds,
  core.List<core.String>? compatibilities,
  core.List<core.String>? contentCategoryIds,
  core.List<core.String>? directorySiteIds,
  core.List<core.String>? groupIds,
  core.List<core.String>? ids,
  core.String? maxEndDate,
  core.int? maxResults,
  core.String? maxStartDate,
  core.String? minEndDate,
  core.String? minStartDate,
  core.String? pageToken,
  core.String? paymentSource,
  core.List<core.String>? placementStrategyIds,
  core.List<core.String>? pricingTypes,
  core.String? searchString,
  core.List<core.String>? siteIds,
  core.List<core.String>? sizeIds,
  core.String? sortField,
  core.String? sortOrder,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (activeStatus != null) 'activeStatus': activeStatus,
    if (advertiserIds != null) 'advertiserIds': advertiserIds,
    if (campaignIds != null) 'campaignIds': campaignIds,
    if (compatibilities != null) 'compatibilities': compatibilities,
    if (contentCategoryIds != null) 'contentCategoryIds': contentCategoryIds,
    if (directorySiteIds != null) 'directorySiteIds': directorySiteIds,
    if (groupIds != null) 'groupIds': groupIds,
    if (ids != null) 'ids': ids,
    if (maxEndDate != null) 'maxEndDate': [maxEndDate],
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (maxStartDate != null) 'maxStartDate': [maxStartDate],
    if (minEndDate != null) 'minEndDate': [minEndDate],
    if (minStartDate != null) 'minStartDate': [minStartDate],
    if (pageToken != null) 'pageToken': [pageToken],
    if (paymentSource != null) 'paymentSource': [paymentSource],
    if (placementStrategyIds != null)
      'placementStrategyIds': placementStrategyIds,
    if (pricingTypes != null) 'pricingTypes': pricingTypes,
    if (searchString != null) 'searchString': [searchString],
    if (siteIds != null) 'siteIds': siteIds,
    if (sizeIds != null) 'sizeIds': sizeIds,
    if (sortField != null) 'sortField': [sortField],
    if (sortOrder != null) 'sortOrder': [sortOrder],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'userprofiles/' + core.Uri.encodeFull('$profileId') + '/placements';

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