Skip to content

Commit

Permalink
refactor type annotations
Browse files Browse the repository at this point in the history
Signed-off-by: flashdagger <flashdagger@googlemail.com>
  • Loading branch information
flashdagger committed Apr 1, 2024
1 parent c34c547 commit 3ca4fdf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion zammadoo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def request(
params: Optional["StringKeyMapping"] = None,
json: Optional["StringKeyMapping"] = None,
**kwargs,
):
) -> "JsonType":
"""
Perform a request on the API URL.
Expand Down
6 changes: 3 additions & 3 deletions zammadoo/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: UTF-8 -*-

from datetime import datetime
from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union
from typing import TYPE_CHECKING, Any, List, Optional, Tuple

from .resources import ResourcesT, _T_co
from .utils import DateTime, FrozenInfo, _AttributeBase
Expand All @@ -11,7 +11,7 @@
from typing import Literal, overload

from .users import User
from .utils import AttributeT, JsonDict, JsonType
from .utils import JsonDict, JsonType

class TypedResourceDict(JsonDict):
@overload
Expand Down Expand Up @@ -138,5 +138,5 @@ def delete(self) -> None:

class NamedResource(MutableResource):
active: bool #:
name: Union[str, "AttributeT[str]"] #:
name: str #:
note: Optional[str] #:
4 changes: 2 additions & 2 deletions zammadoo/users.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

from typing import TYPE_CHECKING, Dict, List, Optional, Union
from typing import TYPE_CHECKING, Dict, List, Optional, Union, cast

from .groups import Group
from .resource import NamedResource, OptionalUserProperty
Expand Down Expand Up @@ -39,7 +39,7 @@ class User(NamedResource):
login: str #: users login name
login_failed: int #:
mobile: str #:
name = AttributeT[str]("login") #: alias for :attr:`login`
name = cast(str, AttributeT[str]("login")) #: alias for :attr:`login`
out_of_office: bool #:
out_of_office_end_at = OptionalDateTime()
out_of_office_replacement = OptionalUserProperty()
Expand Down

0 comments on commit 3ca4fdf

Please sign in to comment.