searchFiles method

Future<SearchFilesResponse?> searchFiles(
  1. String query, {
  2. String? accountId,
  3. String? provider,
  4. String? folderId,
  5. String? workspaceId,
  6. String? organizationId,
  7. int? limit,
  8. int? offset,
})

Substring-match search across the caller's files.

In-memory search — the platform lists up to ~500 files and filters locally on name (case-insensitive substring). Not suitable for global search across very large file libraries.

Parameters:

  • String query (required):

  • String accountId: Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with provider. If omitted on a list endpoint the call fans out across every connected account.

  • String provider: Provider id (e.g. native-notes, notion). Selects every connected account for the provider. Mutually exclusive with accountId.

  • String folderId: Filter to one folder. Omit for the account root.

  • String workspaceId:

  • String organizationId:

  • int limit:

  • int offset:

Implementation

Future<SearchFilesResponse?> searchFiles(String query, { String? accountId, String? provider, String? folderId, String? workspaceId, String? organizationId, int? limit, int? offset, }) async {
  final response = await searchFilesWithHttpInfo(query,  accountId: accountId, provider: provider, folderId: folderId, workspaceId: workspaceId, organizationId: organizationId, limit: limit, offset: offset, );
  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), 'SearchFilesResponse',) as SearchFilesResponse;

  }
  return null;
}