mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
chore(deps): update dependency hcloud to v2.6.0 (#686)
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [hcloud](https://redirect.github.com/hetznercloud/hcloud-python) ([changelog](https://redirect.github.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md)) | `2.5.4` -> `2.6.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>hetznercloud/hcloud-python (hcloud)</summary> ### [`v2.6.0`](https://redirect.github.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#v260) [Compare Source](https://redirect.github.com/hetznercloud/hcloud-python/compare/v2.5.4...v2.6.0) ##### Features - add category property to server type ([#​549](https://redirect.github.com/hetznercloud/hcloud-python/issues/549)) ##### Bug Fixes - rename `ClientEntityBase` to `ResourceClientBase` ([#​532](https://redirect.github.com/hetznercloud/hcloud-python/issues/532)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/ansible-collections/hetzner.hcloud). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45MS4xIiwidXBkYXRlZEluVmVyIjoiNDEuOTEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo <ljonas@riseup.net>
This commit is contained in:
parent
f2983603af
commit
923057c7b6
24 changed files with 451 additions and 411 deletions
|
|
@ -4,7 +4,7 @@ import time
|
|||
import warnings
|
||||
from typing import TYPE_CHECKING, Any, NamedTuple
|
||||
|
||||
from ..core import BoundModelBase, ClientEntityBase, Meta
|
||||
from ..core import BoundModelBase, Meta, ResourceClientBase
|
||||
from .domain import Action, ActionFailedException, ActionTimeoutException
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -50,11 +50,19 @@ class ActionsPageResult(NamedTuple):
|
|||
meta: Meta
|
||||
|
||||
|
||||
class ResourceActionsClient(ClientEntityBase):
|
||||
class ResourceActionsClient(ResourceClientBase):
|
||||
_resource: str
|
||||
|
||||
def __init__(self, client: Client, resource: str | None):
|
||||
super().__init__(client)
|
||||
def __init__(self, client: ResourceClientBase | Client, resource: str | None):
|
||||
if isinstance(client, ResourceClientBase):
|
||||
super().__init__(client._parent)
|
||||
# Use the same base client as the the resource base client. Allows us to
|
||||
# choose the base client outside of the ResourceActionsClient.
|
||||
self._client = client._client
|
||||
else:
|
||||
# Backward compatibility, defaults to the parent ("top level") base client (`_client`).
|
||||
super().__init__(client)
|
||||
|
||||
self._resource = resource or ""
|
||||
|
||||
def get_by_id(self, id: int) -> BoundAction:
|
||||
|
|
@ -67,7 +75,7 @@ class ResourceActionsClient(ClientEntityBase):
|
|||
url=f"{self._resource}/actions/{id}",
|
||||
method="GET",
|
||||
)
|
||||
return BoundAction(self._client.actions, response["action"])
|
||||
return BoundAction(self._parent.actions, response["action"])
|
||||
|
||||
def get_list(
|
||||
self,
|
||||
|
|
@ -104,7 +112,7 @@ class ResourceActionsClient(ClientEntityBase):
|
|||
params=params,
|
||||
)
|
||||
actions = [
|
||||
BoundAction(self._client.actions, action_data)
|
||||
BoundAction(self._parent.actions, action_data)
|
||||
for action_data in response["actions"]
|
||||
]
|
||||
return ActionsPageResult(actions, Meta.parse_meta(response))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue