getUsersCountWithHttpInfo method

Future<Response> getUsersCountWithHttpInfo({
  1. List<String>? emailAddress,
  2. List<String>? phoneNumber,
  3. List<String>? externalId,
  4. List<String>? username,
  5. List<String>? web3Wallet,
  6. List<String>? userId,
  7. List<String>? organizationId,
  8. String? query,
  9. String? emailAddressQuery,
  10. String? phoneNumberQuery,
  11. String? usernameQuery,
  12. String? nameQuery,
  13. bool? banned,
  14. int? lastActiveAtBefore,
  15. int? lastActiveAtAfter,
  16. int? lastActiveAtSince,
  17. int? createdAtBefore,
  18. int? createdAtAfter,
})

Count users

Returns a total count of all users that match the given filtering criteria.

Note: This method returns the HTTP Response.

Parameters:

  • List<String> emailAddress: Counts users with the specified email addresses. Accepts up to 100 email addresses. Any email addresses not found are ignored.

  • List<String> phoneNumber: Counts users with the specified phone numbers. Accepts up to 100 phone numbers. Any phone numbers not found are ignored.

  • List<String> externalId: Counts users with the specified external ids. Accepts up to 100 external ids. Any external ids not found are ignored.

  • List<String> username: Counts users with the specified usernames. Accepts up to 100 usernames. Any usernames not found are ignored.

  • List<String> web3Wallet: Counts users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addressed not found are ignored.

  • List<String> userId: Counts users with the user ids specified. Accepts up to 100 user ids. Any user ids not found are ignored.

  • List<String> organizationId: Returns users that have memberships to the given organizations. For each organization id, the + and - can be prepended to the id, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization ids.

  • String query: Counts users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn't need to match the exact value you are looking for, it is capable of partial matches as well.

  • String emailAddressQuery: Counts users with emails that match the given query, via case-insensitive partial match. For example, email_address_query=ello will match a user with the email HELLO@example.com, and will be included in the resulting count.

  • String phoneNumberQuery: Counts users with phone numbers that match the given query, via case-insensitive partial match. For example, phone_number_query=555 will match a user with the phone number +1555xxxxxxx, and will be included in the resulting count.

  • String usernameQuery: Counts users with usernames that match the given query, via case-insensitive partial match. For example, username_query=CoolUser will match a user with the username SomeCoolUser, and will be included in the resulting count.

  • String nameQuery: Returns users with names that match the given query, via case-insensitive partial match.

  • bool banned: Counts users which are either banned (banned=true) or not banned (banned=false).

  • int lastActiveAtBefore: Returns users whose last session activity was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23.

  • int lastActiveAtAfter: Returns users whose last session activity was after the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23.

  • int lastActiveAtSince: Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. Deprecated in favor of last_active_at_after.

  • int createdAtBefore: Returns users who have been created before the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created before 2024-10-29.

  • int createdAtAfter: Returns users who have been created after the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created after 2024-10-29.

Implementation

Future<http.Response> getUsersCountWithHttpInfo({
  List<String>? emailAddress,
  List<String>? phoneNumber,
  List<String>? externalId,
  List<String>? username,
  List<String>? web3Wallet,
  List<String>? userId,
  List<String>? organizationId,
  String? query,
  String? emailAddressQuery,
  String? phoneNumberQuery,
  String? usernameQuery,
  String? nameQuery,
  bool? banned,
  int? lastActiveAtBefore,
  int? lastActiveAtAfter,
  int? lastActiveAtSince,
  int? createdAtBefore,
  int? createdAtAfter,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/users/count';

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (emailAddress != null) {
    queryParams.addAll(_queryParams('multi', 'email_address', emailAddress));
  }
  if (phoneNumber != null) {
    queryParams.addAll(_queryParams('multi', 'phone_number', phoneNumber));
  }
  if (externalId != null) {
    queryParams.addAll(_queryParams('multi', 'external_id', externalId));
  }
  if (username != null) {
    queryParams.addAll(_queryParams('multi', 'username', username));
  }
  if (web3Wallet != null) {
    queryParams.addAll(_queryParams('multi', 'web3_wallet', web3Wallet));
  }
  if (userId != null) {
    queryParams.addAll(_queryParams('multi', 'user_id', userId));
  }
  if (organizationId != null) {
    queryParams
        .addAll(_queryParams('multi', 'organization_id', organizationId));
  }
  if (query != null) {
    queryParams.addAll(_queryParams('', 'query', query));
  }
  if (emailAddressQuery != null) {
    queryParams
        .addAll(_queryParams('', 'email_address_query', emailAddressQuery));
  }
  if (phoneNumberQuery != null) {
    queryParams
        .addAll(_queryParams('', 'phone_number_query', phoneNumberQuery));
  }
  if (usernameQuery != null) {
    queryParams.addAll(_queryParams('', 'username_query', usernameQuery));
  }
  if (nameQuery != null) {
    queryParams.addAll(_queryParams('', 'name_query', nameQuery));
  }
  if (banned != null) {
    queryParams.addAll(_queryParams('', 'banned', banned));
  }
  if (lastActiveAtBefore != null) {
    queryParams.addAll(
        _queryParams('', 'last_active_at_before', lastActiveAtBefore));
  }
  if (lastActiveAtAfter != null) {
    queryParams
        .addAll(_queryParams('', 'last_active_at_after', lastActiveAtAfter));
  }
  if (lastActiveAtSince != null) {
    queryParams
        .addAll(_queryParams('', 'last_active_at_since', lastActiveAtSince));
  }
  if (createdAtBefore != null) {
    queryParams
        .addAll(_queryParams('', 'created_at_before', createdAtBefore));
  }
  if (createdAtAfter != null) {
    queryParams.addAll(_queryParams('', 'created_at_after', createdAtAfter));
  }

  const contentTypes = <String>[];

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