Debian Codegraph @

ansible_collections/hetzner/hcloud/plugins/module_utils/_primary_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.primary_ips import (
7 BoundPrimaryIP,
8 )
9
10
11 def prepare_result(o: BoundPrimaryIP):
12 return {
13 "id": o.id,
14 "name": o.name,
15 "ip": o.ip,
16 "type": o.type,
17 "location": o.location.name,
18 "datacenter": o.datacenter and o.datacenter.name,
19 "labels": o.labels,
20 "delete_protection": o.protection["delete"],
21 "assignee_id": o.assignee_id,
22 "assignee_type": o.assignee_type,
23 "auto_delete": o.auto_delete,
24 }