list method

Future<DirectorySitesListResponse> list(
  1. String profileId, {
  2. bool? acceptsInStreamVideoPlacements,
  3. bool? acceptsInterstitialPlacements,
  4. bool? acceptsPublisherPaidPlacements,
  5. bool? active,
  6. String? dfpNetworkCode,
  7. List<String>? ids,
  8. int? maxResults,
  9. String? pageToken,
  10. String? searchString,
  11. String? sortField,
  12. String? sortOrder,
  13. String? $fields,
})

Retrieves a list of directory 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 directory sites that accept publisher paid placements. This field can be left blank.

active - Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.

dfpNetworkCode - Select only directory sites with this Ad Manager network code.

ids - Select only directory 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 URL. Wildcards () are allowed. For example, "directory site2015" will return objects with names like "directory site June 2015", "directory site April 2015", or simply "directory 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 "directory site" will match objects with name "my directory site", "directory site 2015" or simply, "directory 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.

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

Completes with a DirectorySitesListResponse.

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<DirectorySitesListResponse> list(
  core.String profileId, {
  core.bool? acceptsInStreamVideoPlacements,
  core.bool? acceptsInterstitialPlacements,
  core.bool? acceptsPublisherPaidPlacements,
  core.bool? active,
  core.String? dfpNetworkCode,
  core.List<core.String>? ids,
  core.int? maxResults,
  core.String? pageToken,
  core.String? searchString,
  core.String? sortField,
  core.String? sortOrder,
  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 (active != null) 'active': ['${active}'],
    if (dfpNetworkCode != null) 'dfpNetworkCode': [dfpNetworkCode],
    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 ($fields != null) 'fields': [$fields],
  };

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

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