Skip to content

Commit 846bb01

Browse files
committed
update shchema
1 parent 5bc45ae commit 846bb01

File tree

5 files changed

+84
-13
lines changed

5 files changed

+84
-13
lines changed

taskbadger.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,14 @@ components:
729729
nullable: true
730730
description: Maximum time to allow between task updates before considering
731731
the task stale. (seconds)
732+
tags:
733+
type: object
734+
additionalProperties:
735+
type: string
736+
minLength: 2
737+
maxLength: 255
738+
description: Tags for the task represented as a mapping from 'namespace'
739+
to 'value'.
732740
StatusEnum:
733741
enum:
734742
- pending
@@ -839,9 +847,8 @@ components:
839847
type: object
840848
additionalProperties:
841849
type: string
842-
maxLength: 255
843850
minLength: 2
844-
readOnly: true
851+
maxLength: 255
845852
description: Tags for the task represented as a mapping from 'namespace'
846853
to 'value'.
847854
required:
@@ -851,7 +858,6 @@ components:
851858
- organization
852859
- project
853860
- public_url
854-
- tags
855861
- updated
856862
- url
857863
- value_percent
@@ -914,6 +920,14 @@ components:
914920
nullable: true
915921
description: Maximum time to allow between task updates before considering
916922
the task stale. (seconds)
923+
tags:
924+
type: object
925+
additionalProperties:
926+
type: string
927+
minLength: 2
928+
maxLength: 255
929+
description: Tags for the task represented as a mapping from 'namespace'
930+
to 'value'.
917931
required:
918932
- name
919933
securitySchemes:

taskbadger/internal/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
from .paginated_task_list import PaginatedTaskList
66
from .patched_action_request import PatchedActionRequest
77
from .patched_task_request import PatchedTaskRequest
8+
from .patched_task_request_tags import PatchedTaskRequestTags
89
from .status_enum import StatusEnum
910
from .task import Task
1011
from .task_request import TaskRequest
12+
from .task_request_tags import TaskRequestTags
1113
from .task_tags import TaskTags
1214

1315
__all__ = (
@@ -16,8 +18,10 @@
1618
"PaginatedTaskList",
1719
"PatchedActionRequest",
1820
"PatchedTaskRequest",
21+
"PatchedTaskRequestTags",
1922
"StatusEnum",
2023
"Task",
2124
"TaskRequest",
25+
"TaskRequestTags",
2226
"TaskTags",
2327
)

taskbadger/internal/models/patched_task_request.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import datetime
22
from collections.abc import Mapping
3-
from typing import Any, TypeVar, Union, cast
3+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
44

55
from attrs import define as _attrs_define
66
from attrs import field as _attrs_field
@@ -9,6 +9,10 @@
99
from ..models.status_enum import StatusEnum
1010
from ..types import UNSET, Unset
1111

12+
if TYPE_CHECKING:
13+
from ..models.patched_task_request_tags import PatchedTaskRequestTags
14+
15+
1216
T = TypeVar("T", bound="PatchedTaskRequest")
1317

1418

@@ -38,6 +42,8 @@ class PatchedTaskRequest:
3842
failed. (seconds)
3943
stale_timeout (Union[None, Unset, int]): Maximum time to allow between task updates before considering the task
4044
stale. (seconds)
45+
tags (Union[Unset, PatchedTaskRequestTags]): Tags for the task represented as a mapping from 'namespace' to
46+
'value'.
4147
"""
4248

4349
name: Union[Unset, str] = UNSET
@@ -50,6 +56,7 @@ class PatchedTaskRequest:
5056
time_to_start: Union[None, Unset, str] = UNSET
5157
max_runtime: Union[None, Unset, int] = UNSET
5258
stale_timeout: Union[None, Unset, int] = UNSET
59+
tags: Union[Unset, "PatchedTaskRequestTags"] = UNSET
5360
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
5461

5562
def to_dict(self) -> dict[str, Any]:
@@ -103,6 +110,10 @@ def to_dict(self) -> dict[str, Any]:
103110
else:
104111
stale_timeout = self.stale_timeout
105112

113+
tags: Union[Unset, dict[str, Any]] = UNSET
114+
if not isinstance(self.tags, Unset):
115+
tags = self.tags.to_dict()
116+
106117
field_dict: dict[str, Any] = {}
107118
field_dict.update(self.additional_properties)
108119
field_dict.update({})
@@ -126,11 +137,15 @@ def to_dict(self) -> dict[str, Any]:
126137
field_dict["max_runtime"] = max_runtime
127138
if stale_timeout is not UNSET:
128139
field_dict["stale_timeout"] = stale_timeout
140+
if tags is not UNSET:
141+
field_dict["tags"] = tags
129142

130143
return field_dict
131144

132145
@classmethod
133146
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
147+
from ..models.patched_task_request_tags import PatchedTaskRequestTags
148+
134149
d = dict(src_dict)
135150
name = d.pop("name", UNSET)
136151

@@ -215,6 +230,13 @@ def _parse_stale_timeout(data: object) -> Union[None, Unset, int]:
215230

216231
stale_timeout = _parse_stale_timeout(d.pop("stale_timeout", UNSET))
217232

233+
_tags = d.pop("tags", UNSET)
234+
tags: Union[Unset, PatchedTaskRequestTags]
235+
if isinstance(_tags, Unset):
236+
tags = UNSET
237+
else:
238+
tags = PatchedTaskRequestTags.from_dict(_tags)
239+
218240
patched_task_request = cls(
219241
name=name,
220242
status=status,
@@ -226,6 +248,7 @@ def _parse_stale_timeout(data: object) -> Union[None, Unset, int]:
226248
time_to_start=time_to_start,
227249
max_runtime=max_runtime,
228250
stale_timeout=stale_timeout,
251+
tags=tags,
229252
)
230253

231254
patched_task_request.additional_properties = d

taskbadger/internal/models/task.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class Task:
2929
updated (datetime.datetime):
3030
url (str):
3131
public_url (str):
32-
tags (TaskTags): Tags for the task represented as a mapping from 'namespace' to 'value'.
3332
status (Union[Unset, StatusEnum]): * `pending` - pending
3433
* `pre_processing` - pre_processing
3534
* `processing` - processing
@@ -51,6 +50,7 @@ class Task:
5150
failed. (seconds)
5251
stale_timeout (Union[None, Unset, int]): Maximum time to allow between task updates before considering the task
5352
stale. (seconds)
53+
tags (Union[Unset, TaskTags]): Tags for the task represented as a mapping from 'namespace' to 'value'.
5454
"""
5555

5656
id: str
@@ -62,7 +62,6 @@ class Task:
6262
updated: datetime.datetime
6363
url: str
6464
public_url: str
65-
tags: "TaskTags"
6665
status: Union[Unset, StatusEnum] = StatusEnum.PENDING
6766
value: Union[None, Unset, int] = UNSET
6867
value_max: Union[Unset, int] = UNSET
@@ -72,6 +71,7 @@ class Task:
7271
time_to_start: Union[None, Unset, str] = UNSET
7372
max_runtime: Union[None, Unset, int] = UNSET
7473
stale_timeout: Union[None, Unset, int] = UNSET
74+
tags: Union[Unset, "TaskTags"] = UNSET
7575
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
7676

7777
def to_dict(self) -> dict[str, Any]:
@@ -94,8 +94,6 @@ def to_dict(self) -> dict[str, Any]:
9494

9595
public_url = self.public_url
9696

97-
tags = self.tags.to_dict()
98-
9997
status: Union[Unset, str] = UNSET
10098
if not isinstance(self.status, Unset):
10199
status = self.status.value
@@ -144,6 +142,10 @@ def to_dict(self) -> dict[str, Any]:
144142
else:
145143
stale_timeout = self.stale_timeout
146144

145+
tags: Union[Unset, dict[str, Any]] = UNSET
146+
if not isinstance(self.tags, Unset):
147+
tags = self.tags.to_dict()
148+
147149
field_dict: dict[str, Any] = {}
148150
field_dict.update(self.additional_properties)
149151
field_dict.update(
@@ -157,7 +159,6 @@ def to_dict(self) -> dict[str, Any]:
157159
"updated": updated,
158160
"url": url,
159161
"public_url": public_url,
160-
"tags": tags,
161162
}
162163
)
163164
if status is not UNSET:
@@ -178,6 +179,8 @@ def to_dict(self) -> dict[str, Any]:
178179
field_dict["max_runtime"] = max_runtime
179180
if stale_timeout is not UNSET:
180181
field_dict["stale_timeout"] = stale_timeout
182+
if tags is not UNSET:
183+
field_dict["tags"] = tags
181184

182185
return field_dict
183186

@@ -209,8 +212,6 @@ def _parse_value_percent(data: object) -> Union[None, int]:
209212

210213
public_url = d.pop("public_url")
211214

212-
tags = TaskTags.from_dict(d.pop("tags"))
213-
214215
_status = d.pop("status", UNSET)
215216
status: Union[Unset, StatusEnum]
216217
if isinstance(_status, Unset):
@@ -292,6 +293,13 @@ def _parse_stale_timeout(data: object) -> Union[None, Unset, int]:
292293

293294
stale_timeout = _parse_stale_timeout(d.pop("stale_timeout", UNSET))
294295

296+
_tags = d.pop("tags", UNSET)
297+
tags: Union[Unset, TaskTags]
298+
if isinstance(_tags, Unset):
299+
tags = UNSET
300+
else:
301+
tags = TaskTags.from_dict(_tags)
302+
295303
task = cls(
296304
id=id,
297305
organization=organization,
@@ -302,7 +310,6 @@ def _parse_stale_timeout(data: object) -> Union[None, Unset, int]:
302310
updated=updated,
303311
url=url,
304312
public_url=public_url,
305-
tags=tags,
306313
status=status,
307314
value=value,
308315
value_max=value_max,
@@ -312,6 +319,7 @@ def _parse_stale_timeout(data: object) -> Union[None, Unset, int]:
312319
time_to_start=time_to_start,
313320
max_runtime=max_runtime,
314321
stale_timeout=stale_timeout,
322+
tags=tags,
315323
)
316324

317325
task.additional_properties = d

taskbadger/internal/models/task_request.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import datetime
22
from collections.abc import Mapping
3-
from typing import Any, TypeVar, Union, cast
3+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
44

55
from attrs import define as _attrs_define
66
from attrs import field as _attrs_field
@@ -9,6 +9,10 @@
99
from ..models.status_enum import StatusEnum
1010
from ..types import UNSET, Unset
1111

12+
if TYPE_CHECKING:
13+
from ..models.task_request_tags import TaskRequestTags
14+
15+
1216
T = TypeVar("T", bound="TaskRequest")
1317

1418

@@ -38,6 +42,7 @@ class TaskRequest:
3842
failed. (seconds)
3943
stale_timeout (Union[None, Unset, int]): Maximum time to allow between task updates before considering the task
4044
stale. (seconds)
45+
tags (Union[Unset, TaskRequestTags]): Tags for the task represented as a mapping from 'namespace' to 'value'.
4146
"""
4247

4348
name: str
@@ -50,6 +55,7 @@ class TaskRequest:
5055
time_to_start: Union[None, Unset, str] = UNSET
5156
max_runtime: Union[None, Unset, int] = UNSET
5257
stale_timeout: Union[None, Unset, int] = UNSET
58+
tags: Union[Unset, "TaskRequestTags"] = UNSET
5359
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
5460

5561
def to_dict(self) -> dict[str, Any]:
@@ -103,6 +109,10 @@ def to_dict(self) -> dict[str, Any]:
103109
else:
104110
stale_timeout = self.stale_timeout
105111

112+
tags: Union[Unset, dict[str, Any]] = UNSET
113+
if not isinstance(self.tags, Unset):
114+
tags = self.tags.to_dict()
115+
106116
field_dict: dict[str, Any] = {}
107117
field_dict.update(self.additional_properties)
108118
field_dict.update(
@@ -128,11 +138,15 @@ def to_dict(self) -> dict[str, Any]:
128138
field_dict["max_runtime"] = max_runtime
129139
if stale_timeout is not UNSET:
130140
field_dict["stale_timeout"] = stale_timeout
141+
if tags is not UNSET:
142+
field_dict["tags"] = tags
131143

132144
return field_dict
133145

134146
@classmethod
135147
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
148+
from ..models.task_request_tags import TaskRequestTags
149+
136150
d = dict(src_dict)
137151
name = d.pop("name")
138152

@@ -217,6 +231,13 @@ def _parse_stale_timeout(data: object) -> Union[None, Unset, int]:
217231

218232
stale_timeout = _parse_stale_timeout(d.pop("stale_timeout", UNSET))
219233

234+
_tags = d.pop("tags", UNSET)
235+
tags: Union[Unset, TaskRequestTags]
236+
if isinstance(_tags, Unset):
237+
tags = UNSET
238+
else:
239+
tags = TaskRequestTags.from_dict(_tags)
240+
220241
task_request = cls(
221242
name=name,
222243
status=status,
@@ -228,6 +249,7 @@ def _parse_stale_timeout(data: object) -> Union[None, Unset, int]:
228249
time_to_start=time_to_start,
229250
max_runtime=max_runtime,
230251
stale_timeout=stale_timeout,
252+
tags=tags,
231253
)
232254

233255
task_request.additional_properties = d

0 commit comments

Comments
 (0)