list method

Future<SitesListResponse> list(
  1. String profileId, {
  2. bool? acceptsInStreamVideoPlacements,
  3. bool? acceptsInterstitialPlacements,
  4. bool? acceptsPublisherPaidPlacements,
  5. bool? adWordsSite,
  6. bool? approved,
  7. List<String>? campaignIds,
  8. List<String>? directorySiteIds,
  9. List<String>? ids,
  10. int? maxResults,
  11. String? pageToken,
  12. String? searchString,
  13. String? sortField,
  14. String? sortOrder,
  15. String? subaccountId,
  16. bool? unmappedSite,
  17. String? $fields,
})

Retrieves a list of sites, possibly filtered.

This method supports paging.

Request parameters:

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

acceptsInStreamVideoPlacements - This search filter is no longer supported and will have no effect on the results returned.

acceptsInterstitialPlacements - This search filter is no longer supported and will have no effect on the results returned.

acceptsPublisherPaidPlacements - Select only sites that accept publisher paid placements.

adWordsSite - Select only AdWords sites.

approved - Select only approved sites.

campaignIds - Select only sites with these campaign IDs.

directorySiteIds - Select only sites with these directory site IDs.

ids - Select only sites with these IDs.

maxResults - Maximum number of results to return.

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

searchString - Allows searching for objects by name, ID or keyName. Wildcards () are allowed. For example, "site2015" will return objects with names like "site June 2015", "site April 2015", or simply "site 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 "site" will match objects with name "my site", "site 2015", or simply "site".

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.

subaccountId - Select only sites with this subaccount ID.

unmappedSite - Select only sites that have not been mapped to a directory site.

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

Completes with a SitesListResponse.

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<SitesListResponse> list(
  core.String profileId, {
  core.bool? acceptsInStreamVideoPlacements,
  core.bool? acceptsInterstitialPlacements,
  core.bool? acceptsPublisherPaidPlacements,
  core.bool? adWordsSite,
  core.bool? approved,
  core.List<core.String>? campaignIds,
  core.List<core.String>? directorySiteIds,
  core.List<core.String>? ids,
  core.int? maxResults,
  core.String? pageToken,
  core.String? searchString,
  core.String? sortField,
  core.String? sortOrder,
  core.String? subaccountId,
  core.bool? unmappedSite,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (acceptsInStreamVideoPlacements != null)
      'acceptsInStreamVideoPlacements': ['${acceptsInStreamVideoPlacements}'],
    if (acceptsInterstitialPlacements != null)
      'acceptsInterstitialPlacements': ['${acceptsInterstitialPlacements}'],
    if (acceptsPublisherPaidPlacements != null)
      'acceptsPublisherPaidPlacements': ['${acceptsPublisherPaidPlacements}'],
    if (adWordsSite != null) 'adWordsSite': ['${adWordsSite}'],
    if (approved != null) 'approved': ['${approved}'],
    if (campaignIds != null) 'campaignIds': campaignIds,
    if (directorySiteIds != null) 'directorySiteIds': directorySiteIds,
    if (ids != null) 'ids': ids,
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (searchString != null) 'searchString': [searchString],
    if (sortField != null) 'sortField': [sortField],
    if (sortOrder != null) 'sortOrder': [sortOrder],
    if (subaccountId != null) 'subaccountId': [subaccountId],
    if (unmappedSite != null) 'unmappedSite': ['${unmappedSite}'],
    if ($fields != null) 'fields': [$fields],
  };

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

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