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

16 lines
331 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
2024-03-01 09:31:05 +00:00
icon: str
2024-02-23 10:14:00 +00:00
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))