WorkflowRule.php 816 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Twilio\TaskRouter;
  3. /**
  4. * Twilio TaskRouter Workflow Rule
  5. *
  6. * @author Justin Witz <jwitz@twilio.com>
  7. * @license http://creativecommons.org/licenses/MIT/ MIT
  8. */
  9. class WorkflowRule implements \JsonSerializable {
  10. public $expression;
  11. public $friendly_name;
  12. public $targets;
  13. public function __construct($expression, $targets, $friendly_name = null)
  14. {
  15. $this->expression = $expression;
  16. $this->targets = $targets;
  17. $this->friendly_name = $friendly_name;
  18. }
  19. public function jsonSerialize() {
  20. $json = array();
  21. $json["expression"] = $this->expression;
  22. $json["targets"] = $this->targets;
  23. if($this->friendly_name != null) {
  24. $json["friendly_name"] = $this->friendly_name;
  25. }
  26. return $json;
  27. }
  28. }