File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import warnings
34from typing import TYPE_CHECKING , Any , NamedTuple
45
56from ..actions import ActionsPageResult , BoundAction , ResourceActionsClient
@@ -305,12 +306,19 @@ def get_all(
305306 def get_by_name (self , name : str ) -> BoundImage | None :
306307 """Get image by name
307308
308- Deprecated: Use get_by_name_and_architecture instead.
309-
310309 :param name: str
311310 Used to get image by name.
312311 :return: :class:`BoundImage <hcloud.images.client.BoundImage>`
312+
313+ .. deprecated:: 1.19
314+ Use :func:`hcloud.images.client.ImagesClient.get_by_name_and_architecture` instead.
313315 """
316+ warnings .warn (
317+ "The 'hcloud.images.client.ImagesClient.get_by_name' method is deprecated, please use the "
318+ "'hcloud.images.client.ImagesClient.get_by_name_and_architecture' method instead." ,
319+ DeprecationWarning ,
320+ stacklevel = 2 ,
321+ )
314322 return self ._get_first_by (name = name )
315323
316324 def get_by_name_and_architecture (
You can’t perform that action at this time.
0 commit comments