# Models: Q

> API models starting with Q.

## `QueueRule`

One version of a queue rule; the latest live one applies.

- `rule_id: str` (`ruleId` on the wire)
- `project_id: str` (`projectId` on the wire)
- `version: int`
- `name: str`
- `when: kindgi.client.QueueRuleWhen`
- `sample: float`
- `max_open: int | None` (`maxOpen` on the wire) (optional)
- `corrector_group_id: str | None` (`correctorGroupId` on the wire) (optional)
- `enabled: bool`
- `created_by: str | None` (`createdBy` on the wire) (optional)
- `created_at: AwareDatetime` (`createdAt` on the wire)
- `unregistered_at: AwareDatetime | None` (`unregisteredAt` on the wire) (optional)

## `QueueRuleGroupResult`

- `corrector_group_id: str | None` (`correctorGroupId` on the wire)
- `corrections: int`
- `yes: int`

## `QueueRulePage`

- `data: list[kindgi.client.QueueRule]`
- `has_more: bool` (`hasMore` on the wire)
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)

## `QueueRulePatch`

The fields to change; `when` is replaced whole.

- `name: str | None` (optional)
- `when: kindgi.client.QueueRuleWhen | None` (optional)
- `sample: float | None` (optional)
- `max_open: int | None` (`maxOpen` on the wire) (optional)
- `corrector_group_id: str | None` (`correctorGroupId` on the wire) (optional)
- `enabled: bool | None` (optional)

## `QueueRulePreview`

- `considered: int`
- `matched: int`

## `QueueRuleResultGroup`

One rule version's runs of one agent version. `added` = `open` + `corrected` + `dismissed` + `erased`.

- `rule_version: int` (`ruleVersion` on the wire)
- `agent_version: str | None` (`agentVersion` on the wire)
- `added: int`
- `open: int`
- `corrected: int`
- `dismissed: int`
- `erased: int`
- `skipped_by_cap: int` (`skippedByCap` on the wire)
- `corrections: int`
- `runs_with_corrections: int | None` (`runsWithCorrections` on the wire) (optional)
- `yes_share: float | None` (`yesShare` on the wire)
- `by_group: list[kindgi.client.QueueRuleGroupResult]` (`byGroup` on the wire)

## `QueueRuleResults`

- `rule_id: str` (`ruleId` on the wire)
- `since: AwareDatetime | None` (optional)
- `groups: list[kindgi.client.QueueRuleResultGroup]`

## `QueueRuleSpec`

A queue rule as written. It only lists runs: nothing here starts a model.

- `name: str`
- `when: kindgi.client.QueueRuleWhen`
- `sample: float | None` (optional)
- `max_open: int | None` (`maxOpen` on the wire) (optional)
- `corrector_group_id: str | None` (`correctorGroupId` on the wire) (optional)
- `enabled: bool | None` (optional)

## `QueueRuleUnregisterResult`

- `rule_id: str` (`ruleId` on the wire)
- `unregistered: bool`

## `QueueRuleWhen`

Which of a project's runs a rule matches as they end. Every field narrows; absent fields don't. `agentIds` or `flowIds`, not both. Top-level runs only (an agent's own runs, not its turns as a flow's step); replays never match.

- `agent_ids: list[str] | None` (`agentIds` on the wire) (optional)
- `flow_ids: list[str] | None` (`flowIds` on the wire) (optional)
- `versions: list[str] | None` (optional)
- `status: list[Annotated[Union[Literal['completed', 'failed', 'cancelled'], str], <kindgi.client._open.OpenEnum object at 0x1073beed0>]] | None` (optional)
- `include_dry_runs: bool | None` (`includeDryRuns` on the wire) (optional)
