Skip to content

case.py returns typed objects inconsistent with rest of SDK #210

Closed

Description

@PaperMtn

Problem

The case module returns Case and CaseList typed objects from several functions, which is inconsistent with every other SDK module (rule.py, alert.py, entity.py, etc.) that returns dict[str, Any] or a list directly from the API response.

Affected functions:

  • get_case() → Case
  • patch_case() → Case
  • get_cases_from_list() → CaseList

Unaffected functions in the same file return dict[str, Any] as expected (list_cases, get_cases, execute_bulk_*, merge_cases), creating inconsistency even within case.py itself.

Additional issue: fields lost during deserialization

Case.from_dict() only maps a subset of fields from the API response (id, displayName, stage, priority, status, soarPlatformInfo, alertIds). Any additional fields returned by the API are silently dropped, which can cause data loss for callers who need the full response.

Proposed fix

  • Remove the Case and CaseList classes from models.py
  • Update get_case(), patch_case(), and get_cases_from_list() to return dict[str, Any]
  • Update any CLI handlers and tests that depend on attribute access on Case/CaseList objects

This makes the case module consistent with the rest of the SDK and ensures no API response data is lost.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions