From 7dd1494b76db20bb49c5dcb9c41cfd53ce8da012 Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Wed, 16 Oct 2024 20:55:38 +0200 Subject: [PATCH] chore(resources.py): add missing return type hint --- jira/resources.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/jira/resources.py b/jira/resources.py index 29c86e604..1b3f1de74 100644 --- a/jira/resources.py +++ b/jira/resources.py @@ -208,7 +208,7 @@ def __getstate__(self) -> dict[str, Any]: """Pickling the resource.""" return vars(self) - def __setstate__(self, raw_pickled: dict[str, Any]): + def __setstate__(self, raw_pickled: dict[str, Any]) -> None: """Unpickling of the resource.""" # https://stackoverflow.com/a/50888571/7724187 vars(self).update(raw_pickled) @@ -246,7 +246,7 @@ def find( self, id: tuple[str, ...] | int | str, params: dict[str, str] | None = None, - ): + ) -> None: """Finds a resource based on the input parameters. Args: @@ -267,7 +267,7 @@ def _find_by_url( self, url: str, params: dict[str, str] | None = None, - ): + ) -> None: """Finds a resource on the specified url. The resource is loaded with the JSON data returned by doing a @@ -299,7 +299,7 @@ def update( jira: JIRA | None = None, notify: bool = True, **kwargs: Any, - ): + ) -> None: """Update this resource on the server. 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( headers=CaseInsensitiveDict(), params: dict[str, str] | None = None, path: str | None = None, - ): + ) -> None: """Load a resource. Args: @@ -459,7 +459,7 @@ def _load( j = j[path] self._parse_raw(j) - def _parse_raw(self, raw: dict[str, Any]): + def _parse_raw(self, raw: dict[str, Any]) -> None: """Parse a raw dictionary to create a resource. Args: @@ -492,7 +492,7 @@ def __init__( self._parse_raw(raw) self.raw: dict[str, Any] = cast(dict[str, Any], self.raw) - def get(self): + def get(self) -> bytes | None: """Return the file content as a string.""" r = self._session.get(self.content, headers={"Accept": "*/*"}) return r.content @@ -517,7 +517,7 @@ def __init__( self._parse_raw(raw) self.raw: dict[str, Any] = cast(dict[str, Any], self.raw) - def delete(self, moveIssuesTo: str | None = None): # type: ignore[override] + def delete(self, moveIssuesTo: str | None = None) -> None: # type: ignore[override] """Delete this component from the server. Args: @@ -754,7 +754,7 @@ class _Worklog: def __init__(self) -> None: self.worklogs: list[Worklog] = [] - def __init__(self): + def __init__(self) -> None: self.assignee: UnknownResource | None = None self.attachment: list[Attachment] = [] self.comment = self._Comment() @@ -801,7 +801,7 @@ def update( # type: ignore[override] # incompatible supertype ignored jira: JIRA | None = None, notify: bool = True, **fieldargs, - ): + ) -> None: """Update this issue on the server. 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: else: return getattr(self.fields, field_name) - def add_field_value(self, field: str, value: str): + def add_field_value(self, field: str, value: str) -> None: """Add a value to a field that supports multiple values, without resetting the existing values. This should work with: labels, multiple checkbox lists, multiple select @@ -883,7 +883,7 @@ def add_field_value(self, field: str, value: str): """ super().update(fields={"update": {field: [{"add": value}]}}) - def delete(self, deleteSubtasks=False): + def delete(self, deleteSubtasks=False) -> None: """Delete this issue from the server. Args: @@ -891,7 +891,7 @@ def delete(self, deleteSubtasks=False): """ super().delete(params={"deleteSubtasks": deleteSubtasks}) - def permalink(self): + def permalink(self) -> str: """Get the URL of the issue, the browsable one not the REST one. Returns: @@ -926,7 +926,7 @@ def update( # type: ignore[override] visibility: dict[str, str] | None = None, is_internal: bool = False, notify: bool = True, - ): + ) -> None: """Update a comment. Keyword arguments are marshalled into a dict before being sent. @@ -991,7 +991,7 @@ def update( # type: ignore[override] globalId=None, application=None, relationship=None, - ): + ) -> None: """Update a RemoteLink. 'object' is required. For definitions of the allowable fields for 'object' and the keyword arguments 'globalId', 'application' and 'relationship', @@ -1149,7 +1149,7 @@ def __init__( def delete( # type: ignore[override] self, adjustEstimate: str | None = None, newEstimate=None, increaseBy=None - ): + ) -> None: """Delete this worklog entry from its associated issue. Args: @@ -1188,7 +1188,7 @@ def _find_by_url( self, url: str, params: dict[str, str] | None = None, - ): + ) -> None: super()._find_by_url(url, params) # An IssueProperty never returns "self" identifier, set it self.self = url @@ -1287,7 +1287,7 @@ def update( # type: ignore[override] self, users: str | list | tuple | None = None, groups: str | list | tuple | None = None, - ): + ) -> None: """Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified. Args: @@ -1313,7 +1313,7 @@ def add_user( self, users: str | list | tuple | None = None, groups: str | list | tuple | None = None, - ): + ) -> None: """Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified. Args: