getUser method

Future<User> getUser({
  1. String? accountId,
  2. String? username,
  3. String? key,
  4. String? expand,
})

Returns a user.

Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that the user's email address is hidden. See the Profile visibility overview for more details.

Permissions required: Browse users and groups global permission.

Implementation

Future<User> getUser(
    {String? accountId,
    String? username,
    String? key,
    String? expand}) async {
  return User.fromJson(await _client.send(
    'get',
    'rest/api/3/user',
    queryParameters: {
      if (accountId != null) 'accountId': accountId,
      if (username != null) 'username': username,
      if (key != null) 'key': key,
      if (expand != null) 'expand': expand,
    },
  ));
}