list method

Future<Accounts> list (
  1. {int max_results,
  2. int start_index,
  3. String $fields}

Lists all accounts to which the user has access.

Request parameters:

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

start_index - An index of the first account 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 Accounts.

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.


async.Future<Accounts> list(
    { max_results, 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 (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';

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