Debian Codegraph @

ansible_collections/hetzner/hcloud/plugins/module_utils/_floating_ip.py

raw
1 # Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
2 # Do not use this from other collections or standalone plugins/modules!
3
4 from __future__ import annotations
5
6 from ._vendor.hcloud.floating_ips import (
7 BoundFloatingIP,
8 )
9
10
11 def prepare_result(o: BoundFloatingIP):
12 return {
13 "id": o.id,
14 "name": o.name,
15 "description": o.description,
16 "ip": o.ip,
17 "type": o.type,
18 "home_location": o.home_location.name,
19 "labels": o.labels,
20 "server": o.server.name if o.server is not None else None,
21 "delete_protection": o.protection["delete"],
22 }