Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
### Fixed
- An issue where in some cases saved searches could not be retrieved.

### Deprecated
- Alert queries methods in the SDK, already deprecated, are more clearly marked.

## 2.5.0 - 2025-06-06

### Added
Expand Down
4 changes: 3 additions & 1 deletion docs/sdk/clients/alert_queries.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Alert Querying
# Alert Querying (Deprecated)

Alert queries are deprecated. Use [Sessions](sessions.md) instead.

Use the `AlertQuery` class to create a query for searching and filtering Incydr alerts. More details on how to use the `AlertQuery` class can be found in the [Query Building](#query-building) section below.

Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ nav:
- Actors: 'sdk/clients/actors.md'
- Agents: 'sdk/clients/agents.md'
- Alert Rules: 'sdk/clients/alert_rules.md'
- Alert Querying: 'sdk/clients/alert_queries.md'
- Audit Log: 'sdk/clients/audit_log.md'
- Cases: 'sdk/clients/cases.md'
- Customer: 'sdk/clients/customer.md'
Expand All @@ -61,6 +60,7 @@ nav:
- Users: 'sdk/clients/users.md'
- Watchlists: 'sdk/clients/watchlists.md'
- Alerts (Deprecated): 'sdk/clients/alerts.md'
- Alert Querying (Deprecated): 'sdk/clients/alert_queries.md'
- Devices (Deprecated): 'sdk/clients/devices.md'
- Risk Profiles (Deprecated): 'sdk/clients/risk_profiles.md'
- Enums: 'sdk/enums.md'
Expand Down
8 changes: 8 additions & 0 deletions src/_incydr_sdk/queries/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import List
from typing import Optional
from typing import Union
from warnings import warn

from pydantic import BaseModel
from pydantic import ConfigDict
Expand Down Expand Up @@ -66,6 +67,8 @@ class FilterGroup(BaseModel):

class AlertQuery(Model):
"""
This class is deprecated. Use the Sessions client instead.

Class to build an alert query. Use the class methods to attach additional filter operators.

Usage examples:
Expand Down Expand Up @@ -110,6 +113,11 @@ def __init__(
on: Union[date, datetime, int, float, str] = None,
**kwargs,
):
warn(
"Alerts are deprecated. Replaced by Sessions.",
DeprecationWarning,
stacklevel=2,
)
groups = kwargs.get("groups") or []
if on and any((start_date, end_date)):
raise ValueError(
Expand Down