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

16 lines
331 B
Python
Raw Normal View History

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