feat(aurora): added a to_json method to the moderation model
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 33s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 49s

This commit is contained in:
Seaswimmer 2024-05-04 15:08:08 -04:00
parent ca1722fee3
commit 58303b8e9c
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -68,3 +68,7 @@ class Moderation(BaseModel):
return cls(**case) return cls(**case)
return None return None
def to_json(self, indent: int = None, file: bool = False):
from aurora.utilities.utils import dump, dumps
return dump(self.model_dump(), indent=indent) if file else dumps(self.model_dump(), indent=indent)