entities.py 569 B

1234567891011121314151617181920212223242526272829303132
  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",
  11. "not contains",
  12. "start with",
  13. "end with",
  14. "is",
  15. "is not",
  16. "empty",
  17. "not empty",
  18. # for number
  19. "=",
  20. "≠",
  21. ">",
  22. "<",
  23. "≥",
  24. "≤",
  25. "null",
  26. "not null",
  27. ]
  28. value: Optional[str] = None