misp-galaxy/tools/tidal-api/models/galaxy.py

15 lines
317 B
Python
Raw Normal View History

2024-02-21 15:24:48 +00:00
import json
2024-02-23 10:14:00 +00:00
from dataclasses import dataclass, asdict
2024-02-21 15:24:48 +00:00
2024-02-23 10:14:00 +00:00
@dataclass
2024-02-21 15:24:48 +00:00
class Galaxy():
2024-02-23 10:14:00 +00:00
description: str
name: str
namespace: str
type: str
uuid: str
version: str
2024-02-21 15:24:48 +00:00
2024-02-23 10:14:00 +00:00
def save_to_file(self, path: str):
2024-02-21 15:24:48 +00:00
with open(path, "w") as file:
2024-02-23 10:14:00 +00:00
file.write(json.dumps(asdict(self), indent=4))