entities.py 455 B

123456789101112131415161718
  1. from typing import Literal, Optional
  2. from pydantic import BaseModel
  3. class Condition(BaseModel):
  4. """
  5. Condition entity
  6. """
  7. variable_selector: list[str]
  8. comparison_operator: Literal[
  9. # for string or array
  10. "contains", "not contains", "start with", "end with", "is", "is not", "empty", "not empty",
  11. # for number
  12. "=", "≠", ">", "<", "≥", "≤", "null", "not null"
  13. ]
  14. value: Optional[str] = None