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

19 lines
360 B
Python
Raw Permalink 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-03-05 13:27:25 +00:00
2024-02-23 10:14:00 +00:00
@dataclass
2024-03-05 13:27:25 +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-06-18 14:58:38 +00:00
file.write(json.dumps(asdict(self), indent=2))
file.write('\n')