Skip to content

Commit 7dd1494

Browse files
committed
chore(resources.py): add missing return type hint
1 parent 9900396 commit 7dd1494

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
@@ -208,7 +208,7 @@ def __getstate__(self) -> dict[str, Any]:
208208
"""Pickling the resource."""
209209
return vars(self)
210210

211-
def __setstate__(self, raw_pickled: dict[str, Any]):
211+
def __setstate__(self, raw_pickled: dict[str, Any]) -> None:
212212
"""Unpickling of the resource."""
213213
# https://stackoverflow.com/a/50888571/7724187
214214
vars(self).update(raw_pickled)
@@ -246,7 +246,7 @@ def find(
246246
self,
247247
id: tuple[str, ...] | int | str,
248248
params: dict[str, str] | None = None,
249-
):
249+
) -> None:
250250
"""Finds a resource based on the input parameters.
251251
252252
Args:
@@ -267,7 +267,7 @@ def _find_by_url(
267267
self,
268268
url: str,
269269
params: dict[str, str] | None = None,
270-
):
270+
) -> None:
271271
"""Finds a resource on the specified url.
272272
273273
The resource is loaded with the JSON data returned by doing a
@@ -299,7 +299,7 @@ def update(
299299
jira: JIRA | None = None,
300300
notify: bool = True,
301301
**kwargs: Any,
302-
):
302+
) -> None:
303303
"""Update this resource on the server.
304304
305305
Keyword arguments are marshalled into a dict before being sent. If this resource doesn't support ``PUT``, a :py:exc:`.JIRAError`
@@ -437,7 +437,7 @@ def _load(
437437
headers=CaseInsensitiveDict(),
438438
params: dict[str, str] | None = None,
439439
path: str | None = None,
440-
):
440+
) -> None:
441441
"""Load a resource.
442442
443443
Args:
@@ -459,7 +459,7 @@ def _load(
459459
j = j[path]
460460
self._parse_raw(j)
461461

462-
def _parse_raw(self, raw: dict[str, Any]):
462+
def _parse_raw(self, raw: dict[str, Any]) -> None:
463463
"""Parse a raw dictionary to create a resource.
464464
465465
Args:
@@ -492,7 +492,7 @@ def __init__(
492492
self._parse_raw(raw)
493493
self.raw: dict[str, Any] = cast(dict[str, Any], self.raw)
494494

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

520-
def delete(self, moveIssuesTo: str | None = None): # type: ignore[override]
520+
def delete(self, moveIssuesTo: str | None = None) -> None: # type: ignore[override]
521521
"""Delete this component from the server.
522522
523523
Args:
@@ -754,7 +754,7 @@ class _Worklog:
754754
def __init__(self) -> None:
755755
self.worklogs: list[Worklog] = []
756756

757-
def __init__(self):
757+
def __init__(self) -> None:
758758
self.assignee: UnknownResource | None = None
759759
self.attachment: list[Attachment] = []
760760
self.comment = self._Comment()
@@ -801,7 +801,7 @@ def update( # type: ignore[override] # incompatible supertype ignored
801801
jira: JIRA | None = None,
802802
notify: bool = True,
803803
**fieldargs,
804-
):
804+
) -> None:
805805
"""Update this issue on the server.
806806
807807
Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as
@@ -872,7 +872,7 @@ def get_field(self, field_name: str) -> Any:
872872
else:
873873
return getattr(self.fields, field_name)
874874

875-
def add_field_value(self, field: str, value: str):
875+
def add_field_value(self, field: str, value: str) -> None:
876876
"""Add a value to a field that supports multiple values, without resetting the existing values.
877877
878878
This should work with: labels, multiple checkbox lists, multiple select
@@ -883,15 +883,15 @@ def add_field_value(self, field: str, value: str):
883883
"""
884884
super().update(fields={"update": {field: [{"add": value}]}})
885885

886-
def delete(self, deleteSubtasks=False):
886+
def delete(self, deleteSubtasks=False) -> None:
887887
"""Delete this issue from the server.
888888
889889
Args:
890890
deleteSubtasks (bool): True to also delete subtasks. If any are present the Issue won't be deleted (Default: ``True``)
891891
"""
892892
super().delete(params={"deleteSubtasks": deleteSubtasks})
893893

894-
def permalink(self):
894+
def permalink(self) -> str:
895895
"""Get the URL of the issue, the browsable one not the REST one.
896896
897897
Returns:
@@ -926,7 +926,7 @@ def update( # type: ignore[override]
926926
visibility: dict[str, str] | None = None,
927927
is_internal: bool = False,
928928
notify: bool = True,
929-
):
929+
) -> None:
930930
"""Update a comment.
931931
932932
Keyword arguments are marshalled into a dict before being sent.
@@ -991,7 +991,7 @@ def update( # type: ignore[override]
991991
globalId=None,
992992
application=None,
993993
relationship=None,
994-
):
994+
) -> None:
995995
"""Update a RemoteLink. 'object' is required.
996996
997997
For definitions of the allowable fields for 'object' and the keyword arguments 'globalId', 'application' and 'relationship',
@@ -1149,7 +1149,7 @@ def __init__(
11491149

11501150
def delete( # type: ignore[override]
11511151
self, adjustEstimate: str | None = None, newEstimate=None, increaseBy=None
1152-
):
1152+
) -> None:
11531153
"""Delete this worklog entry from its associated issue.
11541154
11551155
Args:
@@ -1188,7 +1188,7 @@ def _find_by_url(
11881188
self,
11891189
url: str,
11901190
params: dict[str, str] | None = None,
1191-
):
1191+
) -> None:
11921192
super()._find_by_url(url, params)
11931193
# An IssueProperty never returns "self" identifier, set it
11941194
self.self = url
@@ -1287,7 +1287,7 @@ def update( # type: ignore[override]
12871287
self,
12881288
users: str | list | tuple | None = None,
12891289
groups: str | list | tuple | None = None,
1290-
):
1290+
) -> None:
12911291
"""Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified.
12921292
12931293
Args:
@@ -1313,7 +1313,7 @@ def add_user(
13131313
self,
13141314
users: str | list | tuple | None = None,
13151315
groups: str | list | tuple | None = None,
1316-
):
1316+
) -> None:
13171317
"""Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified.
13181318
13191319
Args:

0 commit comments

Comments
 (0)