listIdentities method

Future<Response<BuiltList<Identity>>> listIdentities({
  1. int? perPage = 250,
  2. int? page,
  3. int? pageSize = 250,
  4. String? pageToken = '1',
  5. String? consistency,
  6. BuiltList<String>? ids,
  7. String? credentialsIdentifier,
  8. String? previewCredentialsIdentifierSimilar,
  9. CancelToken? cancelToken,
  10. Map<String, dynamic>? headers,
  11. Map<String, dynamic>? extra,
  12. ValidateStatus? validateStatus,
  13. ProgressCallback? onSendProgress,
  14. ProgressCallback? onReceiveProgress,
})

List Identities Lists all identities in the system.

Parameters:

  • perPage - Deprecated Items per Page DEPRECATED: Please use page_token instead. This parameter will be removed in the future. This is the number of items per page.
  • page - Deprecated Pagination Page DEPRECATED: Please use page_token instead. This parameter will be removed in the future. This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. The first page can be retrieved by omitting this parameter. Following page pointers will be returned in the Link header.
  • pageSize - Page Size This is the number of items per page to return. For details on pagination please head over to the pagination documentation.
  • pageToken - Next Page Token The next page token. For details on pagination please head over to the pagination documentation.
  • consistency - Read Consistency Level (preview) The read consistency level determines the consistency guarantee for reads: strong (slow): The read is guaranteed to return the most recent data committed at the start of the read. eventual (very fast): The result will return data that is about 4.8 seconds old. The default consistency guarantee can be changed in the Ory Network Console or using the Ory CLI with ory patch project --replace '/previews/default_read_consistency_level=\"strong\"'. Setting the default consistency level to eventual may cause regressions in the future as we add consistency controls to more APIs. Currently, the following APIs will be affected by this setting: GET /admin/identities This feature is in preview and only available in Ory Network. ConsistencyLevelUnset ConsistencyLevelUnset is the unset / default consistency level. strong ConsistencyLevelStrong ConsistencyLevelStrong is the strong consistency level. eventual ConsistencyLevelEventual ConsistencyLevelEventual is the eventual consistency level using follower read timestamps.
  • ids - List of ids used to filter identities. If this list is empty, then no filter will be applied.
  • credentialsIdentifier - CredentialsIdentifier is the identifier (username, email) of the credentials to look up using exact match. Only one of CredentialsIdentifier and CredentialsIdentifierSimilar can be used.
  • previewCredentialsIdentifierSimilar - This is an EXPERIMENTAL parameter that WILL CHANGE. Do NOT rely on consistent, deterministic behavior. THIS PARAMETER WILL BE REMOVED IN AN UPCOMING RELEASE WITHOUT ANY MIGRATION PATH. CredentialsIdentifierSimilar is the (partial) identifier (username, email) of the credentials to look up using similarity search. Only one of CredentialsIdentifier and CredentialsIdentifierSimilar can be used.
  • cancelToken - A CancelToken that can be used to cancel the operation
  • headers - Can be used to add additional headers to the request
  • extras - Can be used to add flags to the request
  • validateStatus - A ValidateStatus callback that can be used to determine request success based on the HTTP status of the response
  • onSendProgress - A ProgressCallback that can be used to get the send progress
  • onReceiveProgress - A ProgressCallback that can be used to get the receive progress

Returns a Future containing a Response with a BuiltList<Identity> as data Throws DioError if API call or serialization fails

Implementation

Future<Response<BuiltList<Identity>>> listIdentities({
  int? perPage = 250,
  int? page,
  int? pageSize = 250,
  String? pageToken = '1',
  String? consistency,
  BuiltList<String>? ids,
  String? credentialsIdentifier,
  String? previewCredentialsIdentifierSimilar,
  CancelToken? cancelToken,
  Map<String, dynamic>? headers,
  Map<String, dynamic>? extra,
  ValidateStatus? validateStatus,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  final _path = r'/admin/identities';
  final _options = Options(
    method: r'GET',
    headers: <String, dynamic>{
      ...?headers,
    },
    extra: <String, dynamic>{
      'secure': <Map<String, String>>[
        {
          'type': 'apiKey',
          'name': 'oryAccessToken',
          'keyName': 'Authorization',
          'where': 'header',
        },
      ],
      ...?extra,
    },
    validateStatus: validateStatus,
  );

  final _queryParameters = <String, dynamic>{
    if (perPage != null) r'per_page': encodeQueryParameter(_serializers, perPage, const FullType(int)),
    if (page != null) r'page': encodeQueryParameter(_serializers, page, const FullType(int)),
    if (pageSize != null) r'page_size': encodeQueryParameter(_serializers, pageSize, const FullType(int)),
    if (pageToken != null) r'page_token': encodeQueryParameter(_serializers, pageToken, const FullType(String)),
    if (consistency != null) r'consistency': encodeQueryParameter(_serializers, consistency, const FullType(String)),
    if (ids != null) r'ids': encodeCollectionQueryParameter<String>(_serializers, ids, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,),
    if (credentialsIdentifier != null) r'credentials_identifier': encodeQueryParameter(_serializers, credentialsIdentifier, const FullType(String)),
    if (previewCredentialsIdentifierSimilar != null) r'preview_credentials_identifier_similar': encodeQueryParameter(_serializers, previewCredentialsIdentifierSimilar, const FullType(String)),
  };

  final _response = await _dio.request<Object>(
    _path,
    options: _options,
    queryParameters: _queryParameters,
    cancelToken: cancelToken,
    onSendProgress: onSendProgress,
    onReceiveProgress: onReceiveProgress,
  );

  BuiltList<Identity>? _responseData;

  try {
    final rawResponse = _response.data;
    _responseData = rawResponse == null ? null : _serializers.deserialize(
      rawResponse,
      specifiedType: const FullType(BuiltList, [FullType(Identity)]),
    ) as BuiltList<Identity>;

  } catch (error, stackTrace) {
    throw DioError(
      requestOptions: _response.requestOptions,
      response: _response,
      type: DioErrorType.unknown,
      error: error,
      stackTrace: stackTrace,
    );
  }

  return Response<BuiltList<Identity>>(
    data: _responseData,
    headers: _response.headers,
    isRedirect: _response.isRedirect,
    requestOptions: _response.requestOptions,
    redirects: _response.redirects,
    statusCode: _response.statusCode,
    statusMessage: _response.statusMessage,
    extra: _response.extra,
  );
}