Tasks API¶
The TasksAPI client exposes the single task-detail read endpoint added in v0.4.0.
Resource grouping¶
The endpoint is grouped under client.tasks (D-v0.4-1), even though a task belongs to a post.
This mirrors the M16 decision to give attachments their own resource group rather than folding
into PostsAPI.
Usage¶
from pynteracta.client import InteractaClient
with InteractaClient(base_url="https://tenant.example.com", credentials=...) as client:
task = client.tasks.get(7001)
print(task.id, task.title, task.state)
print(task.description_plain_text)
# Sub-tasks and reminders (typed via …1 siblings)
for st in task.sub_tasks:
print(st.id, st.description, st.state)
for r in task.reminders:
print(r.id, r.value, r.range)
# Capabilities
if task.capabilities and task.capabilities.can_modify:
print("task is editable")
# Rich-text delta and survey data — reachable only via .raw (D-v0.4-4)
print(task.raw.descriptionDelta)
print(task.raw.surveyData)
# occToken is carried on .raw for future write use
print(task.raw.occToken)
state vs currentWorkflowState¶
Task.state is an integer lifecycle code (open/closed etc.) — the recommended field to display
and filter on. Task.current_workflow_state is the post's workflow-state DTO
(PostWorkflowDefinitionStateDTO) and represents the post-level workflow, not the task lifecycle.
Both are exposed on the facade; the CLI default table shows state (Q-v0.4-3).
Description and survey data¶
Per D-v0.4-4, the facade surfaces description_plain_text (curated scalar). The Quill
rich-text JSON (descriptionDelta) and survey payloads (surveyData,
surveyDataCommentsInfo) are left on .raw — surveyData is an untyped object → object map
with no DTO, making .raw the only faithful surface.
API Reference¶
pynteracta.api.tasks.TasksAPI
¶
Bases: ResourceClient
Client for the tasks read endpoint.
Facade Reference¶
pynteracta.models.facade.tasks.Task
¶
Narrow facade over :class:~generated.GetTaskDetailResponseDTO.
Nested TaskCapabilitiesDTO, SubTaskDTO, and TaskReminderDTO are generated as
RootModel[Any] stubs; this facade re-validates them against their typed …1 siblings.
descriptionDelta (Quill rich-text JSON), surveyData, and surveyDataCommentsInfo
are left on .raw per D-v0.4-4.
Attributes:
| Name | Type | Description |
|---|---|---|
raw |
The underlying generated DTO; access additional fields via this escape hatch. |
Source code in src/pynteracta/models/facade/tasks.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
capabilities
property
¶
Typed capabilities facade.
reminders
property
¶
Re-validate each opaque TaskReminderDTO stub into :class:TaskReminder.
state
property
¶
Task lifecycle state (integer code). Use .raw.currentWorkflowState for the post
workflow state DTO.
sub_tasks
property
¶
Re-validate each opaque SubTaskDTO stub into :class:SubTask.
pynteracta.models.facade.tasks.TaskCapabilities
¶
Thin facade over :class:~generated.TaskCapabilitiesDTO1.
Attributes:
| Name | Type | Description |
|---|---|---|
raw |
The underlying typed DTO. |
Source code in src/pynteracta/models/facade/tasks.py
pynteracta.models.facade.tasks.SubTask
¶
Thin facade over :class:~generated.SubTaskDTO1.
Attributes:
| Name | Type | Description |
|---|---|---|
raw |
The underlying typed DTO. |
Source code in src/pynteracta/models/facade/tasks.py
pynteracta.models.facade.tasks.TaskReminder
¶
Thin facade over :class:~generated.TaskReminderDTO1.
Attributes:
| Name | Type | Description |
|---|---|---|
raw |
The underlying typed DTO. |