list method

Future<AccountUserProfilesListResponse> list(
  1. String profileId, {
  2. bool? active,
  3. List<String>? ids,
  4. int? maxResults,
  5. String? pageToken,
  6. String? searchString,
  7. String? sortField,
  8. String? sortOrder,
  9. String? subaccountId,
  10. String? userRoleId,
  11. String? $fields,
})

Retrieves a list of account user profiles, possibly filtered.

This method supports paging.

Request parameters:

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

active - Select only active user profiles.

ids - Select only user profiles 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 email. Wildcards () are allowed. For example, "user profile2015" will return objects with names like "user profile June 2015", "user profile April 2015", or simply "user profile 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 "user profile" will match objects with name "my user profile", "user profile 2015", or simply "user profile".

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 user profiles with the specified subaccount ID.

userRoleId - Select only user profiles with the specified user role ID.

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

Completes with a AccountUserProfilesListResponse.

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<AccountUserProfilesListResponse> list(
  core.String profileId, {
  core.bool? active,
  core.List<core.String>? ids,
  core.int? maxResults,
  core.String? pageToken,
  core.String? searchString,
  core.String? sortField,
  core.String? sortOrder,
  core.String? subaccountId,
  core.String? userRoleId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (active != null) 'active': ['${active}'],
    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 (userRoleId != null) 'userRoleId': [userRoleId],
    if ($fields != null) 'fields': [$fields],
  };

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

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