Debian Codegraph @

ansible_collections/hetzner/hcloud/plugins/module_utils/_storage_box_snapshot.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.storage_boxes import (
7 BoundStorageBoxSnapshot,
8 )
9
10
11 def prepare_result(o: BoundStorageBoxSnapshot):
12 return {
13 "storage_box": o.storage_box.id,
14 "id": o.id,
15 "name": o.name,
16 "description": o.description,
17 "labels": o.labels,
18 "stats": {
19 "size": o.stats.size,
20 "size_filesystem": o.stats.size_filesystem,
21 },
22 "is_automatic": o.is_automatic,
23 "created": o.created.isoformat(),
24 }