[docs]classFieldFormat(str,Enum):""" Enumeration of the data formats a parser field can have. Used as the ``format`` of a field when creating or updating a mailbox's fields (``parser_object_set``). """
[docs]classParserFieldBaseSchema(BaseSchema):""" Properties shared by the read and write representations of a parser field. Both serializing API responses and validating create/update request bodies rely on these common fields, so they are declared once here. """
[docs]format=fields.String(required=True,validate=validate.OneOf([e.valueforeinFieldFormat],error="Must be one of: "+", ".join(e.valueforeinFieldFormat)+".",),)
[docs]classParserFieldWriteSchema(ParserFieldBaseSchema):""" Write schema for a parser field. Used to validate and serialize each entry of a mailbox's ``parser_object_set``. Unknown fields are rejected so read-only properties (``type``, ``csv_download``, ...) and typos never reach the API silently. Pass ``id`` to update an existing field; omit it to create a new one. """