dart-tools 0.7.3__py3-none-any.whl → 0.7.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dart-tools might be problematic. Click here for more details.

dart/dart.py CHANGED
@@ -36,6 +36,7 @@ from .generated.models import (
36
36
  Doc,
37
37
  DocCreate,
38
38
  DocUpdate,
39
+ PaginatedCommentList,
39
40
  PaginatedConciseDocList,
40
41
  PaginatedConciseTaskList,
41
42
  Priority,
@@ -334,6 +335,11 @@ class Dart:
334
335
  response = api.create_comment.sync_detailed(client=self._public_api, body=body)
335
336
  return _get_response_parsed(response)
336
337
 
338
+ @_handle_request_errors
339
+ def list_comments(self, **kwargs) -> PaginatedCommentList:
340
+ response = api.list_comments.sync_detailed(client=self._public_api, **kwargs)
341
+ return _get_response_parsed(response)
342
+
337
343
  @_handle_request_errors
338
344
  def create_doc(self, body: WrappedDocCreate) -> WrappedDoc:
339
345
  response = api.create_doc.sync_detailed(client=self._public_api, body=body)
@@ -1,6 +1,6 @@
1
1
  """Contains methods for accessing the API"""
2
2
 
3
- from .comment import create_comment
3
+ from .comment import create_comment, list_comments
4
4
  from .config import get_config
5
5
  from .dartboard import retrieve_dartboard
6
6
  from .doc import create_doc, delete_doc, list_docs, retrieve_doc, update_doc
@@ -0,0 +1,351 @@
1
+ import datetime
2
+ from http import HTTPStatus
3
+ from typing import Any, Optional, Union
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.list_comments_o_item import ListCommentsOItem
10
+ from ...models.paginated_comment_list import PaginatedCommentList
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ author: Union[Unset, str] = UNSET,
17
+ author_id: Union[Unset, str] = UNSET,
18
+ ids: Union[Unset, str] = UNSET,
19
+ limit: Union[Unset, int] = UNSET,
20
+ o: Union[Unset, list[ListCommentsOItem]] = UNSET,
21
+ offset: Union[Unset, int] = UNSET,
22
+ parent_id: Union[None, Unset, str] = UNSET,
23
+ published_at_after: Union[Unset, datetime.datetime] = UNSET,
24
+ published_at_before: Union[Unset, datetime.datetime] = UNSET,
25
+ task: Union[Unset, str] = UNSET,
26
+ task_id: str,
27
+ text: Union[Unset, str] = UNSET,
28
+ ) -> dict[str, Any]:
29
+ params: dict[str, Any] = {}
30
+
31
+ params["author"] = author
32
+
33
+ params["author_id"] = author_id
34
+
35
+ params["ids"] = ids
36
+
37
+ params["limit"] = limit
38
+
39
+ json_o: Union[Unset, list[str]] = UNSET
40
+ if not isinstance(o, Unset):
41
+ json_o = []
42
+ for o_item_data in o:
43
+ o_item = o_item_data.value
44
+ json_o.append(o_item)
45
+
46
+ params["o"] = json_o
47
+
48
+ params["offset"] = offset
49
+
50
+ json_parent_id: Union[None, Unset, str]
51
+ if isinstance(parent_id, Unset):
52
+ json_parent_id = UNSET
53
+ else:
54
+ json_parent_id = parent_id
55
+ params["parent_id"] = json_parent_id
56
+
57
+ json_published_at_after: Union[Unset, str] = UNSET
58
+ if not isinstance(published_at_after, Unset):
59
+ json_published_at_after = published_at_after.isoformat()
60
+ params["published_at_after"] = json_published_at_after
61
+
62
+ json_published_at_before: Union[Unset, str] = UNSET
63
+ if not isinstance(published_at_before, Unset):
64
+ json_published_at_before = published_at_before.isoformat()
65
+ params["published_at_before"] = json_published_at_before
66
+
67
+ params["task"] = task
68
+
69
+ params["task_id"] = task_id
70
+
71
+ params["text"] = text
72
+
73
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
74
+
75
+ _kwargs: dict[str, Any] = {
76
+ "method": "get",
77
+ "url": "/comments/list",
78
+ "params": params,
79
+ }
80
+
81
+ return _kwargs
82
+
83
+
84
+ def _parse_response(
85
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
86
+ ) -> Optional[PaginatedCommentList]:
87
+ if response.status_code == 200:
88
+ response_200 = PaginatedCommentList.from_dict(response.json())
89
+
90
+ return response_200
91
+ if client.raise_on_unexpected_status:
92
+ raise errors.UnexpectedStatus(response.status_code, response.content)
93
+ else:
94
+ return None
95
+
96
+
97
+ def _build_response(
98
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
99
+ ) -> Response[PaginatedCommentList]:
100
+ return Response(
101
+ status_code=HTTPStatus(response.status_code),
102
+ content=response.content,
103
+ headers=response.headers,
104
+ parsed=_parse_response(client=client, response=response),
105
+ )
106
+
107
+
108
+ def sync_detailed(
109
+ *,
110
+ client: Union[AuthenticatedClient, Client],
111
+ author: Union[Unset, str] = UNSET,
112
+ author_id: Union[Unset, str] = UNSET,
113
+ ids: Union[Unset, str] = UNSET,
114
+ limit: Union[Unset, int] = UNSET,
115
+ o: Union[Unset, list[ListCommentsOItem]] = UNSET,
116
+ offset: Union[Unset, int] = UNSET,
117
+ parent_id: Union[None, Unset, str] = UNSET,
118
+ published_at_after: Union[Unset, datetime.datetime] = UNSET,
119
+ published_at_before: Union[Unset, datetime.datetime] = UNSET,
120
+ task: Union[Unset, str] = UNSET,
121
+ task_id: str,
122
+ text: Union[Unset, str] = UNSET,
123
+ ) -> Response[PaginatedCommentList]:
124
+ """List all comments that the user has access to. This will return a list of comments, including the
125
+ text, associated task ID, and others. Comments are ordered by thread and then by when they were
126
+ written.
127
+
128
+ Args:
129
+ author (Union[Unset, str]):
130
+ author_id (Union[Unset, str]):
131
+ ids (Union[Unset, str]):
132
+ limit (Union[Unset, int]):
133
+ o (Union[Unset, list[ListCommentsOItem]]):
134
+ offset (Union[Unset, int]):
135
+ parent_id (Union[None, Unset, str]):
136
+ published_at_after (Union[Unset, datetime.datetime]):
137
+ published_at_before (Union[Unset, datetime.datetime]):
138
+ task (Union[Unset, str]):
139
+ task_id (str):
140
+ text (Union[Unset, str]):
141
+
142
+ Raises:
143
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
144
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
145
+
146
+ Returns:
147
+ Response[PaginatedCommentList]
148
+ """
149
+
150
+ kwargs = _get_kwargs(
151
+ author=author,
152
+ author_id=author_id,
153
+ ids=ids,
154
+ limit=limit,
155
+ o=o,
156
+ offset=offset,
157
+ parent_id=parent_id,
158
+ published_at_after=published_at_after,
159
+ published_at_before=published_at_before,
160
+ task=task,
161
+ task_id=task_id,
162
+ text=text,
163
+ )
164
+
165
+ response = client.get_httpx_client().request(
166
+ **kwargs,
167
+ )
168
+
169
+ return _build_response(client=client, response=response)
170
+
171
+
172
+ def sync(
173
+ *,
174
+ client: Union[AuthenticatedClient, Client],
175
+ author: Union[Unset, str] = UNSET,
176
+ author_id: Union[Unset, str] = UNSET,
177
+ ids: Union[Unset, str] = UNSET,
178
+ limit: Union[Unset, int] = UNSET,
179
+ o: Union[Unset, list[ListCommentsOItem]] = UNSET,
180
+ offset: Union[Unset, int] = UNSET,
181
+ parent_id: Union[None, Unset, str] = UNSET,
182
+ published_at_after: Union[Unset, datetime.datetime] = UNSET,
183
+ published_at_before: Union[Unset, datetime.datetime] = UNSET,
184
+ task: Union[Unset, str] = UNSET,
185
+ task_id: str,
186
+ text: Union[Unset, str] = UNSET,
187
+ ) -> Optional[PaginatedCommentList]:
188
+ """List all comments that the user has access to. This will return a list of comments, including the
189
+ text, associated task ID, and others. Comments are ordered by thread and then by when they were
190
+ written.
191
+
192
+ Args:
193
+ author (Union[Unset, str]):
194
+ author_id (Union[Unset, str]):
195
+ ids (Union[Unset, str]):
196
+ limit (Union[Unset, int]):
197
+ o (Union[Unset, list[ListCommentsOItem]]):
198
+ offset (Union[Unset, int]):
199
+ parent_id (Union[None, Unset, str]):
200
+ published_at_after (Union[Unset, datetime.datetime]):
201
+ published_at_before (Union[Unset, datetime.datetime]):
202
+ task (Union[Unset, str]):
203
+ task_id (str):
204
+ text (Union[Unset, str]):
205
+
206
+ Raises:
207
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
208
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
209
+
210
+ Returns:
211
+ PaginatedCommentList
212
+ """
213
+
214
+ return sync_detailed(
215
+ client=client,
216
+ author=author,
217
+ author_id=author_id,
218
+ ids=ids,
219
+ limit=limit,
220
+ o=o,
221
+ offset=offset,
222
+ parent_id=parent_id,
223
+ published_at_after=published_at_after,
224
+ published_at_before=published_at_before,
225
+ task=task,
226
+ task_id=task_id,
227
+ text=text,
228
+ ).parsed
229
+
230
+
231
+ async def asyncio_detailed(
232
+ *,
233
+ client: Union[AuthenticatedClient, Client],
234
+ author: Union[Unset, str] = UNSET,
235
+ author_id: Union[Unset, str] = UNSET,
236
+ ids: Union[Unset, str] = UNSET,
237
+ limit: Union[Unset, int] = UNSET,
238
+ o: Union[Unset, list[ListCommentsOItem]] = UNSET,
239
+ offset: Union[Unset, int] = UNSET,
240
+ parent_id: Union[None, Unset, str] = UNSET,
241
+ published_at_after: Union[Unset, datetime.datetime] = UNSET,
242
+ published_at_before: Union[Unset, datetime.datetime] = UNSET,
243
+ task: Union[Unset, str] = UNSET,
244
+ task_id: str,
245
+ text: Union[Unset, str] = UNSET,
246
+ ) -> Response[PaginatedCommentList]:
247
+ """List all comments that the user has access to. This will return a list of comments, including the
248
+ text, associated task ID, and others. Comments are ordered by thread and then by when they were
249
+ written.
250
+
251
+ Args:
252
+ author (Union[Unset, str]):
253
+ author_id (Union[Unset, str]):
254
+ ids (Union[Unset, str]):
255
+ limit (Union[Unset, int]):
256
+ o (Union[Unset, list[ListCommentsOItem]]):
257
+ offset (Union[Unset, int]):
258
+ parent_id (Union[None, Unset, str]):
259
+ published_at_after (Union[Unset, datetime.datetime]):
260
+ published_at_before (Union[Unset, datetime.datetime]):
261
+ task (Union[Unset, str]):
262
+ task_id (str):
263
+ text (Union[Unset, str]):
264
+
265
+ Raises:
266
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
267
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
268
+
269
+ Returns:
270
+ Response[PaginatedCommentList]
271
+ """
272
+
273
+ kwargs = _get_kwargs(
274
+ author=author,
275
+ author_id=author_id,
276
+ ids=ids,
277
+ limit=limit,
278
+ o=o,
279
+ offset=offset,
280
+ parent_id=parent_id,
281
+ published_at_after=published_at_after,
282
+ published_at_before=published_at_before,
283
+ task=task,
284
+ task_id=task_id,
285
+ text=text,
286
+ )
287
+
288
+ response = await client.get_async_httpx_client().request(**kwargs)
289
+
290
+ return _build_response(client=client, response=response)
291
+
292
+
293
+ async def asyncio(
294
+ *,
295
+ client: Union[AuthenticatedClient, Client],
296
+ author: Union[Unset, str] = UNSET,
297
+ author_id: Union[Unset, str] = UNSET,
298
+ ids: Union[Unset, str] = UNSET,
299
+ limit: Union[Unset, int] = UNSET,
300
+ o: Union[Unset, list[ListCommentsOItem]] = UNSET,
301
+ offset: Union[Unset, int] = UNSET,
302
+ parent_id: Union[None, Unset, str] = UNSET,
303
+ published_at_after: Union[Unset, datetime.datetime] = UNSET,
304
+ published_at_before: Union[Unset, datetime.datetime] = UNSET,
305
+ task: Union[Unset, str] = UNSET,
306
+ task_id: str,
307
+ text: Union[Unset, str] = UNSET,
308
+ ) -> Optional[PaginatedCommentList]:
309
+ """List all comments that the user has access to. This will return a list of comments, including the
310
+ text, associated task ID, and others. Comments are ordered by thread and then by when they were
311
+ written.
312
+
313
+ Args:
314
+ author (Union[Unset, str]):
315
+ author_id (Union[Unset, str]):
316
+ ids (Union[Unset, str]):
317
+ limit (Union[Unset, int]):
318
+ o (Union[Unset, list[ListCommentsOItem]]):
319
+ offset (Union[Unset, int]):
320
+ parent_id (Union[None, Unset, str]):
321
+ published_at_after (Union[Unset, datetime.datetime]):
322
+ published_at_before (Union[Unset, datetime.datetime]):
323
+ task (Union[Unset, str]):
324
+ task_id (str):
325
+ text (Union[Unset, str]):
326
+
327
+ Raises:
328
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
329
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
330
+
331
+ Returns:
332
+ PaginatedCommentList
333
+ """
334
+
335
+ return (
336
+ await asyncio_detailed(
337
+ client=client,
338
+ author=author,
339
+ author_id=author_id,
340
+ ids=ids,
341
+ limit=limit,
342
+ o=o,
343
+ offset=offset,
344
+ parent_id=parent_id,
345
+ published_at_after=published_at_after,
346
+ published_at_before=published_at_before,
347
+ task=task,
348
+ task_id=task_id,
349
+ text=text,
350
+ )
351
+ ).parsed
@@ -24,6 +24,7 @@ def _get_kwargs(
24
24
  is_completed: Union[Unset, bool] = UNSET,
25
25
  limit: Union[Unset, int] = UNSET,
26
26
  offset: Union[Unset, int] = UNSET,
27
+ parent_id: Union[Unset, str] = UNSET,
27
28
  priority: Union[Unset, str] = UNSET,
28
29
  size: Union[Unset, int] = UNSET,
29
30
  start_at_after: Union[Unset, datetime.date] = UNSET,
@@ -68,6 +69,8 @@ def _get_kwargs(
68
69
 
69
70
  params["offset"] = offset
70
71
 
72
+ params["parent_id"] = parent_id
73
+
71
74
  params["priority"] = priority
72
75
 
73
76
  params["size"] = size
@@ -146,6 +149,7 @@ def sync_detailed(
146
149
  is_completed: Union[Unset, bool] = UNSET,
147
150
  limit: Union[Unset, int] = UNSET,
148
151
  offset: Union[Unset, int] = UNSET,
152
+ parent_id: Union[Unset, str] = UNSET,
149
153
  priority: Union[Unset, str] = UNSET,
150
154
  size: Union[Unset, int] = UNSET,
151
155
  start_at_after: Union[Unset, datetime.date] = UNSET,
@@ -174,6 +178,7 @@ def sync_detailed(
174
178
  is_completed (Union[Unset, bool]):
175
179
  limit (Union[Unset, int]):
176
180
  offset (Union[Unset, int]):
181
+ parent_id (Union[Unset, str]):
177
182
  priority (Union[Unset, str]):
178
183
  size (Union[Unset, int]):
179
184
  start_at_after (Union[Unset, datetime.date]):
@@ -207,6 +212,7 @@ def sync_detailed(
207
212
  is_completed=is_completed,
208
213
  limit=limit,
209
214
  offset=offset,
215
+ parent_id=parent_id,
210
216
  priority=priority,
211
217
  size=size,
212
218
  start_at_after=start_at_after,
@@ -242,6 +248,7 @@ def sync(
242
248
  is_completed: Union[Unset, bool] = UNSET,
243
249
  limit: Union[Unset, int] = UNSET,
244
250
  offset: Union[Unset, int] = UNSET,
251
+ parent_id: Union[Unset, str] = UNSET,
245
252
  priority: Union[Unset, str] = UNSET,
246
253
  size: Union[Unset, int] = UNSET,
247
254
  start_at_after: Union[Unset, datetime.date] = UNSET,
@@ -270,6 +277,7 @@ def sync(
270
277
  is_completed (Union[Unset, bool]):
271
278
  limit (Union[Unset, int]):
272
279
  offset (Union[Unset, int]):
280
+ parent_id (Union[Unset, str]):
273
281
  priority (Union[Unset, str]):
274
282
  size (Union[Unset, int]):
275
283
  start_at_after (Union[Unset, datetime.date]):
@@ -304,6 +312,7 @@ def sync(
304
312
  is_completed=is_completed,
305
313
  limit=limit,
306
314
  offset=offset,
315
+ parent_id=parent_id,
307
316
  priority=priority,
308
317
  size=size,
309
318
  start_at_after=start_at_after,
@@ -333,6 +342,7 @@ async def asyncio_detailed(
333
342
  is_completed: Union[Unset, bool] = UNSET,
334
343
  limit: Union[Unset, int] = UNSET,
335
344
  offset: Union[Unset, int] = UNSET,
345
+ parent_id: Union[Unset, str] = UNSET,
336
346
  priority: Union[Unset, str] = UNSET,
337
347
  size: Union[Unset, int] = UNSET,
338
348
  start_at_after: Union[Unset, datetime.date] = UNSET,
@@ -361,6 +371,7 @@ async def asyncio_detailed(
361
371
  is_completed (Union[Unset, bool]):
362
372
  limit (Union[Unset, int]):
363
373
  offset (Union[Unset, int]):
374
+ parent_id (Union[Unset, str]):
364
375
  priority (Union[Unset, str]):
365
376
  size (Union[Unset, int]):
366
377
  start_at_after (Union[Unset, datetime.date]):
@@ -394,6 +405,7 @@ async def asyncio_detailed(
394
405
  is_completed=is_completed,
395
406
  limit=limit,
396
407
  offset=offset,
408
+ parent_id=parent_id,
397
409
  priority=priority,
398
410
  size=size,
399
411
  start_at_after=start_at_after,
@@ -427,6 +439,7 @@ async def asyncio(
427
439
  is_completed: Union[Unset, bool] = UNSET,
428
440
  limit: Union[Unset, int] = UNSET,
429
441
  offset: Union[Unset, int] = UNSET,
442
+ parent_id: Union[Unset, str] = UNSET,
430
443
  priority: Union[Unset, str] = UNSET,
431
444
  size: Union[Unset, int] = UNSET,
432
445
  start_at_after: Union[Unset, datetime.date] = UNSET,
@@ -455,6 +468,7 @@ async def asyncio(
455
468
  is_completed (Union[Unset, bool]):
456
469
  limit (Union[Unset, int]):
457
470
  offset (Union[Unset, int]):
471
+ parent_id (Union[Unset, str]):
458
472
  priority (Union[Unset, str]):
459
473
  size (Union[Unset, int]):
460
474
  start_at_after (Union[Unset, datetime.date]):
@@ -490,6 +504,7 @@ async def asyncio(
490
504
  is_completed=is_completed,
491
505
  limit=limit,
492
506
  offset=offset,
507
+ parent_id=parent_id,
493
508
  priority=priority,
494
509
  size=size,
495
510
  start_at_after=start_at_after,
@@ -10,7 +10,9 @@ from .doc import Doc
10
10
  from .doc_create import DocCreate
11
11
  from .doc_update import DocUpdate
12
12
  from .folder import Folder
13
+ from .list_comments_o_item import ListCommentsOItem
13
14
  from .list_docs_o_item import ListDocsOItem
15
+ from .paginated_comment_list import PaginatedCommentList
14
16
  from .paginated_concise_doc_list import PaginatedConciseDocList
15
17
  from .paginated_concise_task_list import PaginatedConciseTaskList
16
18
  from .priority import Priority
@@ -73,7 +75,9 @@ __all__ = (
73
75
  "DocCreate",
74
76
  "DocUpdate",
75
77
  "Folder",
78
+ "ListCommentsOItem",
76
79
  "ListDocsOItem",
80
+ "PaginatedCommentList",
77
81
  "PaginatedConciseDocList",
78
82
  "PaginatedConciseTaskList",
79
83
  "Priority",
@@ -1,9 +1,11 @@
1
1
  from collections.abc import Mapping
2
- from typing import Any, TypeVar
2
+ from typing import Any, TypeVar, Union
3
3
 
4
4
  from attrs import define as _attrs_define
5
5
  from attrs import field as _attrs_field
6
6
 
7
+ from ..types import UNSET, Unset
8
+
7
9
  T = TypeVar("T", bound="Comment")
8
10
 
9
11
 
@@ -13,16 +15,18 @@ class Comment:
13
15
  Attributes:
14
16
  id (str): The universal, unique ID of the comment.
15
17
  html_url (str): The URL that can be used to open the comment in the Dart web UI.
16
- task_id (str): The universal, unique ID of the task that the comment is associated with.
17
18
  author (str): The name or email of the user that authored the comment.
19
+ task_id (str): The universal, unique ID of the task that the comment is associated with.
18
20
  text (str): The full content of the comment, which can include markdown formatting.
21
+ parent_id (Union[Unset, str]): The universal, unique ID of the parent comment, if any.
19
22
  """
20
23
 
21
24
  id: str
22
25
  html_url: str
23
- task_id: str
24
26
  author: str
27
+ task_id: str
25
28
  text: str
29
+ parent_id: Union[Unset, str] = UNSET
26
30
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
27
31
 
28
32
  def to_dict(self) -> dict[str, Any]:
@@ -30,23 +34,27 @@ class Comment:
30
34
 
31
35
  html_url = self.html_url
32
36
 
33
- task_id = self.task_id
34
-
35
37
  author = self.author
36
38
 
39
+ task_id = self.task_id
40
+
37
41
  text = self.text
38
42
 
43
+ parent_id = self.parent_id
44
+
39
45
  field_dict: dict[str, Any] = {}
40
46
  field_dict.update(self.additional_properties)
41
47
  field_dict.update(
42
48
  {
43
49
  "id": id,
44
50
  "htmlUrl": html_url,
45
- "taskId": task_id,
46
51
  "author": author,
52
+ "taskId": task_id,
47
53
  "text": text,
48
54
  }
49
55
  )
56
+ if parent_id is not UNSET:
57
+ field_dict["parentId"] = parent_id
50
58
 
51
59
  return field_dict
52
60
 
@@ -57,18 +65,21 @@ class Comment:
57
65
 
58
66
  html_url = d.pop("htmlUrl")
59
67
 
60
- task_id = d.pop("taskId")
61
-
62
68
  author = d.pop("author")
63
69
 
70
+ task_id = d.pop("taskId")
71
+
64
72
  text = d.pop("text")
65
73
 
74
+ parent_id = d.pop("parentId", UNSET)
75
+
66
76
  comment = cls(
67
77
  id=id,
68
78
  html_url=html_url,
69
- task_id=task_id,
70
79
  author=author,
80
+ task_id=task_id,
71
81
  text=text,
82
+ parent_id=parent_id,
72
83
  )
73
84
 
74
85
  comment.additional_properties = d
@@ -1,9 +1,11 @@
1
1
  from collections.abc import Mapping
2
- from typing import Any, TypeVar
2
+ from typing import Any, TypeVar, Union
3
3
 
4
4
  from attrs import define as _attrs_define
5
5
  from attrs import field as _attrs_field
6
6
 
7
+ from ..types import UNSET, Unset
8
+
7
9
  T = TypeVar("T", bound="CommentCreate")
8
10
 
9
11
 
@@ -13,10 +15,12 @@ class CommentCreate:
13
15
  Attributes:
14
16
  task_id (str): The universal, unique ID of the task that the comment is associated with.
15
17
  text (str): The full content of the comment, which can include markdown formatting.
18
+ parent_id (Union[Unset, str]): The universal, unique ID of the parent comment, if any.
16
19
  """
17
20
 
18
21
  task_id: str
19
22
  text: str
23
+ parent_id: Union[Unset, str] = UNSET
20
24
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
21
25
 
22
26
  def to_dict(self) -> dict[str, Any]:
@@ -24,6 +28,8 @@ class CommentCreate:
24
28
 
25
29
  text = self.text
26
30
 
31
+ parent_id = self.parent_id
32
+
27
33
  field_dict: dict[str, Any] = {}
28
34
  field_dict.update(self.additional_properties)
29
35
  field_dict.update(
@@ -32,6 +38,8 @@ class CommentCreate:
32
38
  "text": text,
33
39
  }
34
40
  )
41
+ if parent_id is not UNSET:
42
+ field_dict["parentId"] = parent_id
35
43
 
36
44
  return field_dict
37
45
 
@@ -42,9 +50,12 @@ class CommentCreate:
42
50
 
43
51
  text = d.pop("text")
44
52
 
53
+ parent_id = d.pop("parentId", UNSET)
54
+
45
55
  comment_create = cls(
46
56
  task_id=task_id,
47
57
  text=text,
58
+ parent_id=parent_id,
48
59
  )
49
60
 
50
61
  comment_create.additional_properties = d
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ListCommentsOItem(str, Enum):
5
+ HIERARCHICAL = "hierarchical"
6
+ PUBLISHED_AT = "published_at"
7
+ PUBLISHED_AT_DESC = "-published_at"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -0,0 +1,123 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.comment import Comment
11
+
12
+
13
+ T = TypeVar("T", bound="PaginatedCommentList")
14
+
15
+
16
+ @_attrs_define
17
+ class PaginatedCommentList:
18
+ """
19
+ Attributes:
20
+ count (int): Example: 123.
21
+ results (list['Comment']):
22
+ next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100.
23
+ previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100.
24
+ """
25
+
26
+ count: int
27
+ results: list["Comment"]
28
+ next_: Union[None, Unset, str] = UNSET
29
+ previous: Union[None, Unset, str] = UNSET
30
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
31
+
32
+ def to_dict(self) -> dict[str, Any]:
33
+ count = self.count
34
+
35
+ results = []
36
+ for results_item_data in self.results:
37
+ results_item = results_item_data.to_dict()
38
+ results.append(results_item)
39
+
40
+ next_: Union[None, Unset, str]
41
+ if isinstance(self.next_, Unset):
42
+ next_ = UNSET
43
+ else:
44
+ next_ = self.next_
45
+
46
+ previous: Union[None, Unset, str]
47
+ if isinstance(self.previous, Unset):
48
+ previous = UNSET
49
+ else:
50
+ previous = self.previous
51
+
52
+ field_dict: dict[str, Any] = {}
53
+ field_dict.update(self.additional_properties)
54
+ field_dict.update(
55
+ {
56
+ "count": count,
57
+ "results": results,
58
+ }
59
+ )
60
+ if next_ is not UNSET:
61
+ field_dict["next"] = next_
62
+ if previous is not UNSET:
63
+ field_dict["previous"] = previous
64
+
65
+ return field_dict
66
+
67
+ @classmethod
68
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
69
+ from ..models.comment import Comment
70
+
71
+ d = dict(src_dict)
72
+ count = d.pop("count")
73
+
74
+ results = []
75
+ _results = d.pop("results")
76
+ for results_item_data in _results:
77
+ results_item = Comment.from_dict(results_item_data)
78
+
79
+ results.append(results_item)
80
+
81
+ def _parse_next_(data: object) -> Union[None, Unset, str]:
82
+ if data is None:
83
+ return data
84
+ if isinstance(data, Unset):
85
+ return data
86
+ return cast(Union[None, Unset, str], data)
87
+
88
+ next_ = _parse_next_(d.pop("next", UNSET))
89
+
90
+ def _parse_previous(data: object) -> Union[None, Unset, str]:
91
+ if data is None:
92
+ return data
93
+ if isinstance(data, Unset):
94
+ return data
95
+ return cast(Union[None, Unset, str], data)
96
+
97
+ previous = _parse_previous(d.pop("previous", UNSET))
98
+
99
+ paginated_comment_list = cls(
100
+ count=count,
101
+ results=results,
102
+ next_=next_,
103
+ previous=previous,
104
+ )
105
+
106
+ paginated_comment_list.additional_properties = d
107
+ return paginated_comment_list
108
+
109
+ @property
110
+ def additional_keys(self) -> list[str]:
111
+ return list(self.additional_properties.keys())
112
+
113
+ def __getitem__(self, key: str) -> Any:
114
+ return self.additional_properties[key]
115
+
116
+ def __setitem__(self, key: str, value: Any) -> None:
117
+ self.additional_properties[key] = value
118
+
119
+ def __delitem__(self, key: str) -> None:
120
+ del self.additional_properties[key]
121
+
122
+ def __contains__(self, key: str) -> bool:
123
+ return key in self.additional_properties
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dart-tools
3
- Version: 0.7.3
3
+ Version: 0.7.5
4
4
  Summary: The Dart CLI and Python Library
5
5
  Author-email: Dart <software@itsdart.com>
6
6
  License: MIT License
@@ -1,5 +1,5 @@
1
1
  dart/__init__.py,sha256=M4oDY_DtfE7s50jXziRxVuL95hE1EKEaWOEmWxy8_Ig,523
2
- dart/dart.py,sha256=x56OpbcSPTybUnLsyul6MW9qOAG2oOKJBWywqABdP6U,26765
2
+ dart/dart.py,sha256=JhEM9wnoe_GhnOWqB9KIquNWWs92lNgIJBPixJkzXno,27015
3
3
  dart/exception.py,sha256=evN1SFV7Bal5dQIIOnhYA0cRu6jSa0cOCiG7AkHZD5A,85
4
4
  dart/old.py,sha256=LqwFKYDpNwHlp_0NT9UACmAsx8PwYLyogLmY7YcuzVg,7053
5
5
  dart/order_manager.py,sha256=WI8YEjdOuEFDNcRCm30INAA5lY8016ttt0yXElGIeUU,1882
@@ -8,9 +8,10 @@ dart/generated/__init__.py,sha256=8fO-FKZzuZzOUUaqtlgw7k08MUwNLf8Ll-cAt7BgmAU,15
8
8
  dart/generated/client.py,sha256=o_mdLqyBCQstu5tS1WZFwqIEbGwkvWQ7eQjuCJw_5VY,12419
9
9
  dart/generated/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
10
10
  dart/generated/types.py,sha256=E1hhDh_zXfsSQ0NCt9-uw90_Mr5iIlsdfnfvxv5HarU,1005
11
- dart/generated/api/__init__.py,sha256=LmRMQNOJjUSyQhrOaV7YNBf0HDM0BHQ_O5TVEaG9aqc,383
11
+ dart/generated/api/__init__.py,sha256=g9MEi__ZevU-eY9vjBZFzC2pVVocTexVgIFghWPU304,398
12
12
  dart/generated/api/comment/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
13
13
  dart/generated/api/comment/create_comment.py,sha256=G9kpQ60IrMC4cxXP--wsPvVtYPMmByy-t55wV4WkvbI,4757
14
+ dart/generated/api/comment/list_comments.py,sha256=dYmzqR6uQNAq_BFwCvurx3fb-ehXsZ2pO0kviCYCraM,11401
14
15
  dart/generated/api/config/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
15
16
  dart/generated/api/config/get_config.py,sha256=C9Pw-IhVpxCaIv_rbL85kKBsHze9rJ0O1FTXyFbSw9I,3913
16
17
  dart/generated/api/dartboard/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
@@ -26,14 +27,14 @@ dart/generated/api/folder/retrieve_folder.py,sha256=Mag6KvIYh8gORQafuNKDnJL59sqP
26
27
  dart/generated/api/task/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
27
28
  dart/generated/api/task/create_task.py,sha256=0qLps0cHZE6LqA9cUQEExEpnhT4k83AHrz8nm1TzS0Q,5057
28
29
  dart/generated/api/task/delete_task.py,sha256=3cpKEcUTKTPkvEW1s7fEXGDVUcNIbAx8AV21R2H2Dxw,4381
29
- dart/generated/api/task/list_tasks.py,sha256=8-GKMX3XXq3BGkSmJfvnuZDV5uKFNjU9fpfQXm4jMqE,16884
30
+ dart/generated/api/task/list_tasks.py,sha256=q4jDwu1D-KH8Pd0wn7LffBTM0ChrTNo6-bZAvv3nBrE,17407
30
31
  dart/generated/api/task/retrieve_task.py,sha256=Cmf0FPrbGxzIEO22BrcsixDs_HCEqw07L_MZn8bPXUc,4442
31
32
  dart/generated/api/task/update_task.py,sha256=5f8wbMwQqRHya7D-iMFOcSL2VF1-flBUIIOYRJ1PjOA,5183
32
33
  dart/generated/api/view/__init__.py,sha256=5vd9uJWAjRqa9xzxzYkLD1yoZ12Ld_bAaNB5WX4fbE8,56
33
34
  dart/generated/api/view/retrieve_view.py,sha256=hQUpYzihR6u9m6Zy02RyHT5UDgPTa8ZvTlyYf-Znm0Y,4454
34
- dart/generated/models/__init__.py,sha256=uaBYAne8YIOIKz2Kf3GBpYTf7lHap69LEwOF_dikn70,3940
35
- dart/generated/models/comment.py,sha256=xxjnssdNxXO3iO8cHH5TYDEmsL9ItvH9OM-F0TeljjQ,2361
36
- dart/generated/models/comment_create.py,sha256=n_Q3riMI0U17rzpp7SKvhnA3YhtyJxXMuXumtVRgZpw,1764
35
+ dart/generated/models/__init__.py,sha256=MESRD5ZqxBOBx19wekgCwXUY8XVi3syeN8Gp-l-jsjU,4102
36
+ dart/generated/models/comment.py,sha256=kLh7iDCW9uTq4kHxi_MSys4uTBpaZj2k5lIKUTkpSUY,2735
37
+ dart/generated/models/comment_create.py,sha256=GVC_LWi0_afdJkN0-qZsYFt9RCmU2DjRmKOwTsmAWTo,2138
37
38
  dart/generated/models/concise_doc.py,sha256=xrJIJr4rm_iG0DlmpemBtzDaOxroHC2NgsG-V9CNsX8,2200
38
39
  dart/generated/models/concise_task.py,sha256=aME0txheSEfVzFnIF2kKo5gNrOeAxCFrqxwQCG4etV4,11675
39
40
  dart/generated/models/custom_properties.py,sha256=NmBTVtlzJbhZn_DURZLREdw_rVeK_isTQ9LT9CEYDVg,5172
@@ -42,7 +43,9 @@ dart/generated/models/doc.py,sha256=f_1aVMo7aCQTGOhH19IjrkucIbINj7n_OkbaZnbJ9tc,
42
43
  dart/generated/models/doc_create.py,sha256=HOpiuuDg7fNEkwoUvXqceXKI59cDVBS5PzTR08iYE7E,2134
43
44
  dart/generated/models/doc_update.py,sha256=Wv565KyrxMWxUCvqDJjcfzk2lalOj987o69RgBYF8wc,2376
44
45
  dart/generated/models/folder.py,sha256=G0uGZqOgnj6ehkEsIMDjU5EGeDzIMp6H4KDreg6PfsI,2729
46
+ dart/generated/models/list_comments_o_item.py,sha256=N4zhK9euG0-r0nvT961QEQ0RLzFYqJ3J6HzTjNKntr8,230
45
47
  dart/generated/models/list_docs_o_item.py,sha256=owGxTljNQTi1KAHkfTknrSTMEome1x75vUbHRVO12JM,320
48
+ dart/generated/models/paginated_comment_list.py,sha256=EHuFqkBMa1xPagKGq6p6qBktb7IgNPkdSbO5aij7M6k,3624
46
49
  dart/generated/models/paginated_concise_doc_list.py,sha256=Y7YbOwd7TaHm7b9rHJvVKEynHEp-xgCyN0Kw5gEZ4i8,3665
47
50
  dart/generated/models/paginated_concise_task_list.py,sha256=Yu-r-WvWBH3LfMWGm3YNQ30w1-B0mdxjx5jykKFFQlY,3677
48
51
  dart/generated/models/priority.py,sha256=eupjzXQndyaia8svwVmylisIGwl6OQ_0g8pgcsm8118,195
@@ -73,9 +76,9 @@ dart/generated/models/wrapped_task.py,sha256=TRlVMxIGhDwSaJlXdMH6q7Vx2hpz7EdiGns
73
76
  dart/generated/models/wrapped_task_create.py,sha256=Oxdot2EwfEuC3l4uo0fAvmyjRNVkXALmWCvfgHI7BcI,1654
74
77
  dart/generated/models/wrapped_task_update.py,sha256=_erGSSR_k6ahF_RFjgLKdyitx5TDQiFw_Ml77zHQdJM,1654
75
78
  dart/generated/models/wrapped_view.py,sha256=zflJxA4UnITM8w-0EObw4AF54yS-c_e5UL6vaikXyG8,1577
76
- dart_tools-0.7.3.dist-info/licenses/LICENSE,sha256=aD_0TnuylEaAHWNURgifNek_ODn5Pg36o9gFdspgHtg,1061
77
- dart_tools-0.7.3.dist-info/METADATA,sha256=zXInY4dN73VebGn21Enf4BDpthBXpsUzMiXx16jVudw,9008
78
- dart_tools-0.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
79
- dart_tools-0.7.3.dist-info/entry_points.txt,sha256=KOVAnDWJbSKn9HoXWQ7x6NfACYzSMGHBBaBxonHEv6w,34
80
- dart_tools-0.7.3.dist-info/top_level.txt,sha256=ZwUQ6QjCyi1i32BJOAkbOA7UfgitLmIwToJGJwZXPrg,5
81
- dart_tools-0.7.3.dist-info/RECORD,,
79
+ dart_tools-0.7.5.dist-info/licenses/LICENSE,sha256=aD_0TnuylEaAHWNURgifNek_ODn5Pg36o9gFdspgHtg,1061
80
+ dart_tools-0.7.5.dist-info/METADATA,sha256=LbnJ4aqKTOskBvjPTyYDCU8wCiJ-GswI127uH6wXSLQ,9008
81
+ dart_tools-0.7.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
82
+ dart_tools-0.7.5.dist-info/entry_points.txt,sha256=KOVAnDWJbSKn9HoXWQ7x6NfACYzSMGHBBaBxonHEv6w,34
83
+ dart_tools-0.7.5.dist-info/top_level.txt,sha256=ZwUQ6QjCyi1i32BJOAkbOA7UfgitLmIwToJGJwZXPrg,5
84
+ dart_tools-0.7.5.dist-info/RECORD,,