This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/resources/documents/schemas.py

29 lines
1.4 KiB
Python
Raw Normal View History

from marshmallow.fields import DateTime, Integer, validate, Boolean
2021-07-21 06:35:18 +00:00
from teal.marshmallow import SanitizedStr, URL
from ereuse_devicehub.resources.schemas import Thing
from ereuse_devicehub.resources.documents import models as m
class DataWipeDocument(Thing):
__doc__ = m.DataWipeDocument.__doc__
id = Integer(description=m.DataWipeDocument.id.comment, dump_only=True)
type = SanitizedStr(default='DataWipeDocument')
url = URL(description=m.DataWipeDocument.url.comment)
success = Boolean(description=m.DataWipeDocument.success.comment)
software = SanitizedStr(description=m.DataWipeDocument.software.comment)
2021-07-21 06:35:18 +00:00
date = DateTime(data_key='endTime',
required=False,
description=m.DataWipeDocument.date.comment)
2021-07-21 06:35:18 +00:00
id_document = SanitizedStr(data_key='documentId',
2021-08-04 16:15:15 +00:00
required=False,
2021-07-21 06:35:18 +00:00
default='',
description=m.DataWipeDocument.id_document.comment)
2021-07-21 06:35:18 +00:00
file_name = SanitizedStr(data_key='filename',
default='',
description=m.DataWipeDocument.file_name.comment,
2021-07-21 06:35:18 +00:00
validate=validate.Length(max=100))
file_hash = SanitizedStr(data_key='hash',
default='',
description=m.DataWipeDocument.file_hash.comment,
2021-07-21 06:35:18 +00:00
validate=validate.Length(max=64))