list method

Future<Experiments> list (String accountId, { String webPropertyId, { String profileId, { int max_results, int start_index, String $fields })

Lists experiments to which the user has access.

Request parameters:

accountId - Account ID to retrieve experiments for. Value must have pattern "\d+".

webPropertyId - Web property ID to retrieve experiments for. Value must have pattern "UA-(\d+)-(\d+)".

profileId - View (Profile) ID to retrieve experiments for. Value must have pattern "\d+".

max_results - The maximum number of experiments to include in this response.

start_index - An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.

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

Completes with a Experiments.

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<Experiments> list(
    core.String accountId, core.String webPropertyId, core.String profileId,
    {core.int max_results, core.int start_index, core.String $fields}) {
  var _url;
  var _queryParams = new core.Map<core.String, core.List<core.String>>();
  var _uploadMedia;
  var _uploadOptions;
  var _downloadOptions = commons.DownloadOptions.Metadata;
  var _body;

  if (accountId == null) {
    throw new core.ArgumentError("Parameter accountId is required.");
  }
  if (webPropertyId == null) {
    throw new core.ArgumentError("Parameter webPropertyId is required.");
  }
  if (profileId == null) {
    throw new core.ArgumentError("Parameter profileId is required.");
  }
  if (max_results != null) {
    _queryParams["max-results"] = ["${max_results}"];
  }
  if (start_index != null) {
    _queryParams["start-index"] = ["${start_index}"];
  }
  if ($fields != null) {
    _queryParams["fields"] = [$fields];
  }

  _url = 'management/accounts/' +
      commons.Escaper.ecapeVariable('$accountId') +
      '/webproperties/' +
      commons.Escaper.ecapeVariable('$webPropertyId') +
      '/profiles/' +
      commons.Escaper.ecapeVariable('$profileId') +
      '/experiments';

  var _response = _requester.request(_url, "GET",
      body: _body,
      queryParams: _queryParams,
      uploadOptions: _uploadOptions,
      uploadMedia: _uploadMedia,
      downloadOptions: _downloadOptions);
  return _response.then((data) => new Experiments.fromJson(data));
}