listUsersWithHttpInfo method

Future<Response> listUsersWithHttpInfo(
  1. String account, {
  2. Object? page,
  3. int? limit,
  4. String? status,
  5. bool? assigned,
  6. String? product,
  7. String? group,
  8. List<String>? roles,
  9. Object? metadata,
})

List all users

Returns a list of users. The users are returned sorted by creation date, with the most recent users appearing first. Resources are automatically scoped to the authenticated bearer e.g. when authenticated as a product, only users associated with the specific product, through a license, will be listed in the results.

Note: This method returns the HTTP Response.

Parameters:

  • String account (required): The identifier (UUID) or slug of your Keygen account.

  • Object page: Object containing page size and page number.

  • int limit:

  • String status: The status of the user to filter by.

  • bool assigned: Only show users assigned a license.

  • String product: The identifier (UUID) of the product to filter by.

  • String group: The identifier (UUID) of the group to filter by.

  • List<String> roles: Array containing role names to filter by.

  • Object metadata: The metadata object to filter by.

Implementation

Future<Response> listUsersWithHttpInfo(String account, { Object? page, int? limit, String? status, bool? assigned, String? product, String? group, List<String>? roles, Object? metadata, }) async {
  // ignore: prefer_const_declarations
  final path = r'/accounts/{account}/users'
    .replaceAll('{account}', account);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }
  if (status != null) {
    queryParams.addAll(_queryParams('', 'status', status));
  }
  if (assigned != null) {
    queryParams.addAll(_queryParams('', 'assigned', assigned));
  }
  if (product != null) {
    queryParams.addAll(_queryParams('', 'product', product));
  }
  if (group != null) {
    queryParams.addAll(_queryParams('', 'group', group));
  }
  if (roles != null) {
    queryParams.addAll(_queryParams('multi', 'roles', roles));
  }
  if (metadata != null) {
    queryParams.addAll(_queryParams('', 'metadata', metadata));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}