Skip to content

Commit 6abce9b

Browse files
committed
chore(resources.py): add missing return type hint
1 parent 2ace2e9 commit 6abce9b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

jira/resources.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def __getstate__(self) -> dict[str, Any]:
209209
"""Pickling the resource."""
210210
return vars(self)
211211

212-
def __setstate__(self, raw_pickled: dict[str, Any]):
212+
def __setstate__(self, raw_pickled: dict[str, Any]) -> None:
213213
"""Unpickling of the resource."""
214214
# https://stackoverflow.com/a/50888571/7724187
215215
vars(self).update(raw_pickled)
@@ -247,7 +247,7 @@ def find(
247247
self,
248248
id: tuple[str, ...] | int | str,
249249
params: dict[str, str] | None = None,
250-
):
250+
) -> None:
251251
"""Finds a resource based on the input parameters.
252252
253253
Args:
@@ -268,7 +268,7 @@ def _find_by_url(
268268
self,
269269
url: str,
270270
params: dict[str, str] | None = None,
271-
):
271+
) -> None:
272272
"""Finds a resource on the specified url.
273273
274274
The resource is loaded with the JSON data returned by doing a
@@ -318,7 +318,7 @@ def update(
318318
jira: JIRA | None = None,
319319
notify: bool = True,
320320
**kwargs: Any,
321-
):
321+
) -> None:
322322
"""Update this resource on the server.
323323
324324
Keyword arguments are marshalled into a dict before being sent. If this resource doesn't support ``PUT``, a :py:exc:`.JIRAError`
@@ -458,7 +458,7 @@ def _load(
458458
headers=CaseInsensitiveDict(),
459459
params: dict[str, str] | None = None,
460460
path: str | None = None,
461-
):
461+
) -> None:
462462
"""Load a resource.
463463
464464
Args:
@@ -480,7 +480,7 @@ def _load(
480480
j = j[path]
481481
self._parse_raw(j)
482482

483-
def _parse_raw(self, raw: dict[str, Any]):
483+
def _parse_raw(self, raw: dict[str, Any]) -> None:
484484
"""Parse a raw dictionary to create a resource.
485485
486486
Args:
@@ -513,7 +513,7 @@ def __init__(
513513
self._parse_raw(raw)
514514
self.raw: dict[str, Any] = cast(dict[str, Any], self.raw)
515515

516-
def get(self):
516+
def get(self) -> bytes | None:
517517
"""Return the file content as a string."""
518518
r = self._session.get(self.content, headers={"Accept": "*/*"})
519519
return r.content
@@ -538,7 +538,7 @@ def __init__(
538538
self._parse_raw(raw)
539539
self.raw: dict[str, Any] = cast(dict[str, Any], self.raw)
540540

541-
def delete(self, moveIssuesTo: str | None = None): # type: ignore[override]
541+
def delete(self, moveIssuesTo: str | None = None) -> None: # type: ignore[override]
542542
"""Delete this component from the server.
543543
544544
Args:
@@ -775,7 +775,7 @@ class _Worklog:
775775
def __init__(self) -> None:
776776
self.worklogs: list[Worklog] = []
777777

778-
def __init__(self):
778+
def __init__(self) -> None:
779779
self.assignee: UnknownResource | None = None
780780
self.attachment: list[Attachment] = []
781781
self.comment = self._Comment()
@@ -822,7 +822,7 @@ def update( # type: ignore[override] # incompatible supertype ignored
822822
jira: JIRA | None = None,
823823
notify: bool = True,
824824
**fieldargs,
825-
):
825+
) -> None:
826826
"""Update this issue on the server.
827827
828828
Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as
@@ -893,7 +893,7 @@ def get_field(self, field_name: str) -> Any:
893893
else:
894894
return getattr(self.fields, field_name)
895895

896-
def add_field_value(self, field: str, value: str):
896+
def add_field_value(self, field: str, value: str) -> None:
897897
"""Add a value to a field that supports multiple values, without resetting the existing values.
898898
899899
This should work with: labels, multiple checkbox lists, multiple select
@@ -904,15 +904,15 @@ def add_field_value(self, field: str, value: str):
904904
"""
905905
super().update(fields={"update": {field: [{"add": value}]}})
906906

907-
def delete(self, deleteSubtasks=False):
907+
def delete(self, deleteSubtasks=False) -> None:
908908
"""Delete this issue from the server.
909909
910910
Args:
911911
deleteSubtasks (bool): True to also delete subtasks. If any are present the Issue won't be deleted (Default: ``False``)
912912
"""
913913
super().delete(params={"deleteSubtasks": deleteSubtasks})
914914

915-
def permalink(self):
915+
def permalink(self) -> str:
916916
"""Get the URL of the issue, the browsable one not the REST one.
917917
918918
Returns:
@@ -947,7 +947,7 @@ def update( # type: ignore[override]
947947
visibility: dict[str, str] | None = None,
948948
is_internal: bool = False,
949949
notify: bool = True,
950-
):
950+
) -> None:
951951
"""Update a comment.
952952
953953
Keyword arguments are marshalled into a dict before being sent.
@@ -1012,7 +1012,7 @@ def update( # type: ignore[override]
10121012
globalId=None,
10131013
application=None,
10141014
relationship=None,
1015-
):
1015+
) -> None:
10161016
"""Update a RemoteLink. 'object' is required.
10171017
10181018
For definitions of the allowable fields for 'object' and the keyword arguments 'globalId', 'application' and 'relationship',
@@ -1170,7 +1170,7 @@ def __init__(
11701170

11711171
def delete( # type: ignore[override]
11721172
self, adjustEstimate: str | None = None, newEstimate=None, increaseBy=None
1173-
):
1173+
) -> None:
11741174
"""Delete this worklog entry from its associated issue.
11751175
11761176
Args:
@@ -1209,7 +1209,7 @@ def _find_by_url(
12091209
self,
12101210
url: str,
12111211
params: dict[str, str] | None = None,
1212-
):
1212+
) -> None:
12131213
super()._find_by_url(url, params)
12141214
# An IssueProperty never returns "self" identifier, set it
12151215
self.self = url
@@ -1308,7 +1308,7 @@ def update( # type: ignore[override]
13081308
self,
13091309
users: str | list | tuple | None = None,
13101310
groups: str | list | tuple | None = None,
1311-
):
1311+
) -> None:
13121312
"""Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified.
13131313
13141314
Args:
@@ -1334,7 +1334,7 @@ def add_user(
13341334
self,
13351335
users: str | list | tuple | None = None,
13361336
groups: str | list | tuple | None = None,
1337-
):
1337+
) -> None:
13381338
"""Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified.
13391339
13401340
Args:

0 commit comments

Comments
 (0)