Skip to content

selectors

Selector models: the one way batch operations address a set of resources.

A batch write names its subjects through a selector with exactly one addressing mode:

  • ids — an explicit, closed set (what you enumerated is what happens).
  • filter — a predicate the server resolves at acceptance time. A filter must carry at least one predicate: an empty filter never means "everything".
  • all — the literal whole scope (e.g. every study in the project), stated deliberately. This is a distinct claim, not an empty filter, so a near-empty request body can never escalate to a whole-project operation.

Destructive calls addressed at a live set (filter / all) must also state expected_count — the count the caller last resolved (the filtered list endpoints return it as total). The server re-resolves at acceptance and rejects on a mismatch, so a set that changed since the caller looked cannot be silently operated on.

The same filter vocabulary drives the read side: each filter field mirrors a query parameter on the corresponding list endpoint, so previewing what a filter resolves to is just the filtered listing.

AdminAnalysisFilter pydantic-model

Bases: _FilterBase

Predicate over every analysis on the platform; at least one field must be set.

Mirrors the admin analysis list endpoint's filter query parameters. The server applies it to live, not-yet-settled analyses only when the operation is a cancellation, so a filter can never address a finished run.

Fields:

Validators:

  • _at_least_one_predicate

status_any = None pydantic-field

Match analyses in at least one of these states.

user_id = None pydantic-field

Match analyses owned by this account.

AdminAnalysisSelector pydantic-model

Bases: _SelectorBase

Address a set of analyses across accounts: one of ids | filter | all.

all addresses every live analysis on the platform and, like every live-set mode, must state the count the caller resolved.

Fields:

Validators:

  • _exactly_one_mode

filter = None pydantic-field

Server-resolved predicate (live set).

AnalysisFilter pydantic-model

Bases: _FilterBase

Predicate over a project's analyses; at least one field must be set.

Fields:

Validators:

  • _at_least_one_predicate

analysis_config_id = None pydantic-field

Match analyses of this analysis configuration.

status_any = None pydantic-field

Match analyses in at least one of these states.

AnalysisSelector pydantic-model

Bases: _SelectorBase

Address a set of analyses: exactly one of ids | filter | all.

Fields:

Validators:

  • _exactly_one_mode

filter = None pydantic-field

Server-resolved predicate (live set).

BatchDeleteAccepted pydantic-model

Bases: BaseModel

The delete resolved and was enqueued (fire-and-return).

Deletion runs as a background cascade; list endpoints hide the affected rows for the run's duration. The ids were resolved at acceptance — rows created after this response are not part of the run.

Fields:

count pydantic-field

Rows resolved and scheduled for deletion.

DeleteAnalysesRequest pydantic-model

Bases: _DeleteBySelectorRequest

Delete the selected analyses (e.g. clear failed runs by status).

Fields:

Validators:

  • _guard

DeleteRecordingsRequest pydantic-model

Bases: _DeleteBySelectorRequest

Delete the selected recordings.

Fields:

Validators:

  • _guard

DeleteStudiesRequest pydantic-model

Bases: _DeleteBySelectorRequest

Delete the selected studies (cascade: recordings, analyses, events).

Fields:

Validators:

  • _guard

EditStudyTagsRequest pydantic-model

Bases: BaseModel

Edit tags across the selected studies.

Two forms, mutually exclusive: incremental (add/remove, applied where missing/present) or replace — set every selected study's tags to exactly this list. replace: [] is the deliberate clear-all form.

Fields:

Validators:

  • _guard

add pydantic-field

Tags to add where missing.

expected_count = None pydantic-field

Required for filter/all selectors: the resolved count the caller saw. The server re-resolves and rejects on a mismatch.

remove pydantic-field

Tags to remove where present.

replace = None pydantic-field

Set the selected studies' tags to exactly this list (an empty list clears all tags). Mutually exclusive with add/remove.

EditStudyTagsResponse pydantic-model

Bases: BaseModel

Outcome of a selector tag edit.

Fields:

count pydantic-field

Studies whose tags were updated.

RecordingSelector pydantic-model

Bases: _SelectorBase

Address a set of recordings: exactly one of ids | all.

Recordings carry no filterable attributes of their own yet, so this selector has no filter mode; it exists so every batch write speaks the same addressing language.

Fields:

  • ids (list[UUID] | None)
  • all (bool)

Validators:

  • _exactly_one_mode

StudyFilter pydantic-model

Bases: _FilterBase

Predicate over a project's studies; at least one field must be set.

Mirrors the study list endpoint's filter query parameters.

Fields:

Validators:

  • _at_least_one_predicate

missing_metadata_any = None pydantic-field

Match studies that do not record at least one of these subject values.

name_contains = None pydantic-field

Match studies whose name contains this text (case-insensitive).

subject_key = None pydantic-field

Match every study of one subject — the key is compared case- and whitespace-insensitively. Deleting by this filter is how a subject's data is erased: the studies are the subject.

tags_any = None pydantic-field

Match studies carrying at least one of these tags.

StudySelector pydantic-model

Bases: _SelectorBase

Address a set of studies: exactly one of ids | filter | all.

Fields:

Validators:

  • _exactly_one_mode

filter = None pydantic-field

Server-resolved predicate (live set).

require_expected_count(selector, expected_count)

Live-set operations must state the count the caller resolved.