listAllOrganizationDomains method
List all organization domains
Retrieves a list of all organization domains within the current instance. This endpoint can be used to list all domains across all organizations or filter domains by organization, verification status, enrollment mode, or search query. The response includes pagination information and details about each domain including its verification status, enrollment mode, and associated counts.
Parameters:
-
String organizationId: The ID of the organization to filter domains by
-
String verified: Filter by verification status
-
List<String> enrollmentMode: Filter by enrollment mode
-
String query: Search domains by name or organization ID. If the query starts with "org_", it will search by exact organization ID match. Otherwise, it performs a case-insensitive partial match on the domain name. Note: An empty string or whitespace-only value is not allowed and will result in a validation error.
-
String orderBy: Allows to return organization domains in a particular order. At the moment, you can order the returned domains by their
nameorcreated_at. In order to specify the direction, you can use the+/-symbols prepended to the property to order by. For example, if you want domains to be returned in descending order according to theircreated_atproperty, you can use-created_at. If you don't use+or-, then+is implied. Defaults to-created_at. -
int offset: Skip the first
offsetresults when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction withlimit. -
int limit: Applies a limit to the number of results returned. Can be used for paginating the results together with
offset.
Implementation
Future<OrganizationDomains?> listAllOrganizationDomains({
String? organizationId,
String? verified,
List<String>? enrollmentMode,
String? query,
String? orderBy,
int? offset,
int? limit,
}) async {
final response = await listAllOrganizationDomainsWithHttpInfo(
organizationId: organizationId,
verified: verified,
enrollmentMode: enrollmentMode,
query: query,
orderBy: orderBy,
offset: offset,
limit: limit,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty &&
response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(
await _decodeBodyBytes(response),
'OrganizationDomains',
) as OrganizationDomains;
}
return null;
}