Skip to content

Commit c067717

Browse files
committed
chore: add overload hints
#31
1 parent 9e6dc7d commit c067717

File tree

1 file changed

+147
-1
lines changed

1 file changed

+147
-1
lines changed

yatracker/tracker/categories/issues.py

Lines changed: 147 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Any, TypeVar
3+
from typing import Any, TypeVar, overload
44

55
from yatracker.tracker.base import BaseTracker
66
from yatracker.types import (
@@ -16,6 +16,23 @@
1616

1717

1818
class Issues(BaseTracker):
19+
@overload
20+
async def get_issue(
21+
self,
22+
issue_id: str,
23+
expand: str | None = None,
24+
) -> FullIssue:
25+
...
26+
27+
@overload
28+
async def get_issue(
29+
self,
30+
issue_id: str,
31+
expand: str | None = None,
32+
_type: type[IssueT_co] = ...,
33+
) -> IssueT_co:
34+
...
35+
1936
async def get_issue(
2037
self,
2138
issue_id: str,
@@ -40,6 +57,25 @@ async def get_issue(
4057
)
4158
return self._decode(_type, data)
4259

60+
@overload
61+
async def edit_issue(
62+
self,
63+
issue_id: str,
64+
version: str | int | None = None,
65+
**kwargs,
66+
) -> FullIssue:
67+
...
68+
69+
@overload
70+
async def edit_issue(
71+
self,
72+
issue_id: str,
73+
version: str | int | None = None,
74+
_type: type[IssueT_co] = ...,
75+
**kwargs,
76+
) -> IssueT_co:
77+
...
78+
4379
async def edit_issue(
4480
self,
4581
issue_id: str,
@@ -63,6 +99,45 @@ async def edit_issue(
6399
)
64100
return self._decode(_type, data)
65101

102+
@overload
103+
async def create_issue(
104+
self,
105+
summary: str,
106+
queue: str | int | dict,
107+
*,
108+
parent: Issue | str | None = None,
109+
description: str | None = None,
110+
sprint: dict[str, str] | None = None,
111+
type_: IssueType | None = None,
112+
priority: int | str | Priority | None = None,
113+
followers: list[str] | None = None,
114+
assignee: list[str] | None = None,
115+
unique: str | None = None,
116+
attachment_ids: list[str] | None = None,
117+
_type: type[IssueT_co] = ...,
118+
**kwargs,
119+
) -> IssueT_co:
120+
...
121+
122+
@overload
123+
async def create_issue(
124+
self,
125+
summary: str,
126+
queue: str | int | dict,
127+
*,
128+
parent: Issue | str | None = None,
129+
description: str | None = None,
130+
sprint: dict[str, str] | None = None,
131+
type_: IssueType | None = None,
132+
priority: int | str | Priority | None = None,
133+
followers: list[str] | None = None,
134+
assignee: list[str] | None = None,
135+
unique: str | None = None,
136+
attachment_ids: list[str] | None = None,
137+
**kwargs,
138+
) -> FullIssue:
139+
...
140+
66141
# ruff: noqa: ARG002 PLR0913
67142
async def create_issue(
68143
self,
@@ -94,6 +169,37 @@ async def create_issue(
94169
)
95170
return self._decode(_type, data)
96171

172+
@overload
173+
async def move_issue(
174+
self,
175+
issue_id: str,
176+
queue_key: str,
177+
*,
178+
notify: bool = True,
179+
notify_author: bool = False,
180+
move_all_fields: bool = False,
181+
initial_status: bool = False,
182+
expand: str | None = None,
183+
_type: type[IssueT_co] = ...,
184+
**kwargs,
185+
) -> IssueT_co:
186+
...
187+
188+
@overload
189+
async def move_issue(
190+
self,
191+
issue_id: str,
192+
queue_key: str,
193+
*,
194+
notify: bool = True,
195+
notify_author: bool = False,
196+
move_all_fields: bool = False,
197+
initial_status: bool = False,
198+
expand: str | None = None,
199+
**kwargs,
200+
) -> FullIssue:
201+
...
202+
97203
async def move_issue(
98204
self,
99205
issue_id: str,
@@ -183,6 +289,31 @@ async def count_issues(
183289
)
184290
return self._decode(int, data)
185291

292+
@overload
293+
async def find_issues(
294+
self,
295+
filter_: dict[str, str] | None = None,
296+
query: str | None = None,
297+
order: str | None = None,
298+
expand: str | None = None,
299+
keys: str | None = None,
300+
queue: str | None = None,
301+
) -> list[FullIssue]:
302+
...
303+
304+
@overload
305+
async def find_issues(
306+
self,
307+
filter_: dict[str, str] | None = None,
308+
query: str | None = None,
309+
order: str | None = None,
310+
expand: str | None = None,
311+
keys: str | None = None,
312+
queue: str | None = None,
313+
_type: type[IssueT_co] = ...,
314+
) -> list[IssueT_co]:
315+
...
316+
186317
async def find_issues(
187318
self,
188319
filter_: dict[str, str] | None = None,
@@ -215,6 +346,21 @@ async def find_issues(
215346
)
216347
return self._decode(list[_type], data) # type: ignore[valid-type]
217348

349+
@overload
350+
async def get_issue_links(
351+
self,
352+
issue_id: str,
353+
) -> list[FullIssue]:
354+
...
355+
356+
@overload
357+
async def get_issue_links(
358+
self,
359+
issue_id: str,
360+
_type: type[IssueT_co | FullIssue] = ...,
361+
) -> list[IssueT_co]:
362+
...
363+
218364
async def get_issue_links(
219365
self,
220366
issue_id: str,

0 commit comments

Comments
 (0)