Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions hcloud/core/domain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from datetime import datetime
from typing import Any, overload
from typing import Any, TypeVar, overload

from dateutil.parser import isoparse

Expand All @@ -12,12 +12,14 @@
"Meta",
]

T = TypeVar("T", bound="BaseDomain")


class BaseDomain:
__api_properties__: tuple[str, ...]

@classmethod
def from_dict(cls, data: dict[str, Any]): # type: ignore[no-untyped-def]
def from_dict(cls: type[T], data: dict[str, Any]) -> T:
"""
Build the domain object from the data dict.
"""
Expand Down
2 changes: 1 addition & 1 deletion hcloud/isos/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ def deprecated(self) -> datetime | None:
)
if self.deprecation is None:
return None
return self.deprecation.unavailable_after # type: ignore[no-any-return]
return self.deprecation.unavailable_after
Loading