diff --git a/plugins/module_utils/vendor/hcloud/_version.py b/plugins/module_utils/vendor/hcloud/_version.py index b4bf770..b592a1b 100644 --- a/plugins/module_utils/vendor/hcloud/_version.py +++ b/plugins/module_utils/vendor/hcloud/_version.py @@ -1,3 +1,3 @@ from __future__ import annotations -VERSION = "1.33.3" # x-release-please-version +VERSION = "1.34.0" # x-release-please-version diff --git a/plugins/module_utils/vendor/hcloud/core/domain.py b/plugins/module_utils/vendor/hcloud/core/domain.py index 692f748..bba954f 100644 --- a/plugins/module_utils/vendor/hcloud/core/domain.py +++ b/plugins/module_utils/vendor/hcloud/core/domain.py @@ -34,6 +34,24 @@ class DomainIdentityMixin: return self.name raise ValueError("id or name must be set") + def has_id_or_name(self, id_or_name: int | str) -> bool: + """ + Return whether this domain has the same id or same name as the other. + + The domain calling this method MUST be a bound domain or be populated, otherwise + the comparison will not work as expected (e.g. the domains are the same but + cannot be equal, if one provides an id and the other the name). + """ + values: list[int | str] = [] + if self.id is not None: + values.append(self.id) + if self.name is not None: + values.append(self.name) + if not values: + raise ValueError("id or name must be set") + + return id_or_name in values + class Pagination(BaseDomain): __slots__ = ( diff --git a/plugins/module_utils/vendor/hcloud/firewalls/domain.py b/plugins/module_utils/vendor/hcloud/firewalls/domain.py index 5ce9281..d637231 100644 --- a/plugins/module_utils/vendor/hcloud/firewalls/domain.py +++ b/plugins/module_utils/vendor/hcloud/firewalls/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -15,7 +15,7 @@ if TYPE_CHECKING: from .client import BoundFirewall -class Firewall(BaseDomain): +class Firewall(BaseDomain, DomainIdentityMixin): """Firewall Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/floating_ips/domain.py b/plugins/module_utils/vendor/hcloud/floating_ips/domain.py index e1f295b..abd2c13 100644 --- a/plugins/module_utils/vendor/hcloud/floating_ips/domain.py +++ b/plugins/module_utils/vendor/hcloud/floating_ips/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -16,7 +16,7 @@ if TYPE_CHECKING: from .client import BoundFloatingIP -class FloatingIP(BaseDomain): +class FloatingIP(BaseDomain, DomainIdentityMixin): """Floating IP Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/load_balancers/domain.py b/plugins/module_utils/vendor/hcloud/load_balancers/domain.py index cc5f122..76e8db3 100644 --- a/plugins/module_utils/vendor/hcloud/load_balancers/domain.py +++ b/plugins/module_utils/vendor/hcloud/load_balancers/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -20,7 +20,7 @@ if TYPE_CHECKING: from .client import BoundLoadBalancer -class LoadBalancer(BaseDomain): +class LoadBalancer(BaseDomain, DomainIdentityMixin): """LoadBalancer Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/networks/domain.py b/plugins/module_utils/vendor/hcloud/networks/domain.py index c307bf9..e04de27 100644 --- a/plugins/module_utils/vendor/hcloud/networks/domain.py +++ b/plugins/module_utils/vendor/hcloud/networks/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -15,7 +15,7 @@ if TYPE_CHECKING: from .client import BoundNetwork -class Network(BaseDomain): +class Network(BaseDomain, DomainIdentityMixin): """Network Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/placement_groups/domain.py b/plugins/module_utils/vendor/hcloud/placement_groups/domain.py index 16b2a39..1c6fc04 100644 --- a/plugins/module_utils/vendor/hcloud/placement_groups/domain.py +++ b/plugins/module_utils/vendor/hcloud/placement_groups/domain.py @@ -7,14 +7,14 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction from .client import BoundPlacementGroup -class PlacementGroup(BaseDomain): +class PlacementGroup(BaseDomain, DomainIdentityMixin): """Placement Group Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/primary_ips/domain.py b/plugins/module_utils/vendor/hcloud/primary_ips/domain.py index aeb943f..2eebace 100644 --- a/plugins/module_utils/vendor/hcloud/primary_ips/domain.py +++ b/plugins/module_utils/vendor/hcloud/primary_ips/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -15,7 +15,7 @@ if TYPE_CHECKING: from .client import BoundPrimaryIP -class PrimaryIP(BaseDomain): +class PrimaryIP(BaseDomain, DomainIdentityMixin): """Primary IP Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/servers/domain.py b/plugins/module_utils/vendor/hcloud/servers/domain.py index 0a0d346..d5e769e 100644 --- a/plugins/module_utils/vendor/hcloud/servers/domain.py +++ b/plugins/module_utils/vendor/hcloud/servers/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -25,7 +25,7 @@ if TYPE_CHECKING: from .client import BoundServer -class Server(BaseDomain): +class Server(BaseDomain, DomainIdentityMixin): """Server Domain :param id: int diff --git a/scripts/vendor.py b/scripts/vendor.py index ee3541a..26a51ca 100755 --- a/scripts/vendor.py +++ b/scripts/vendor.py @@ -22,7 +22,7 @@ from textwrap import dedent logger = logging.getLogger("vendor") HCLOUD_SOURCE_URL = "https://github.com/hetznercloud/hcloud-python" -HCLOUD_VERSION = "v1.33.3" +HCLOUD_VERSION = "v1.34.0" HCLOUD_VENDOR_PATH = "plugins/module_utils/vendor/hcloud"