from dataclasses import dataclass, fields, Field
from typing import Tuple


@dataclass
class Artefact:
    """"""
    type: str # TODO Create enum with possibilities or maybe Subclasses (InlineArtefact, ...)
    content: str
    name: str
    encoding: str

    def as_dict(self):
        """Returns the artefact in a dict format."""
        cls_fields: Tuple[Field, ...] = fields(self.__class__)
        return {field.name: getattr(self, field.name) for field in cls_fields}

# def fill_artefact(data: dict) -> Artefact:
#     """"""
#     type = data.get("")
#     content = data.get("")
#     encoding = data.get("")
#     if type and content and encoding:
#         return Artefact(type, content, encoding)
#     raise ValueError

# TODO Add a 'set from file' method. It will fill out the attributes and to the base64 stuff if type is inline
