You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
632 B

3 years ago
  1. import json
  2. from typing import Any, Dict, List, Union
  3. class Record:
  4. def __init__(self,
  5. id: int,
  6. data: str,
  7. label: Union[List[Any], Dict[Any, Any]],
  8. user: str,
  9. metadata: Dict[Any, Any]):
  10. self.id = id
  11. self.data = data
  12. self.label = label
  13. self.user = user
  14. self.metadata = metadata
  15. def __str__(self):
  16. return json.dumps({
  17. 'id': self.id,
  18. 'data': self.data,
  19. 'label': self.label,
  20. 'user': self.user,
  21. 'metadata': self.metadata
  22. })