/libraries/fabrik/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php

https://github.com/trob/fabrik · PHP · 287 lines · 104 code · 22 blank · 161 comment · 6 complexity · b181726e9495601eaa51738fa00f7a16 MD5 · raw file

  1. <?php
  2. /**
  3. * This code was generated by
  4. * \ / _ _ _| _ _
  5. * | (_)\/(_)(_|\/| |(/_ v1.0.0
  6. * / /
  7. */
  8. namespace Twilio\Rest\Taskrouter\V1\Workspace;
  9. use Twilio\Options;
  10. use Twilio\Values;
  11. abstract class WorkflowOptions {
  12. /**
  13. * @param string $friendlyName descriptive string that you create to describe
  14. * the Workflow resource
  15. * @param string $assignmentCallbackUrl The URL from your application that will
  16. * process task assignment events
  17. * @param string $fallbackAssignmentCallbackUrl The URL that we should call
  18. * when a call to the
  19. * `assignment_callback_url` fails
  20. * @param string $configuration A JSON string that contains the rules to apply
  21. * to the Workflow
  22. * @param int $taskReservationTimeout How long TaskRouter will wait for a
  23. * confirmation response from your
  24. * application after it assigns a Task to a
  25. * Worker
  26. * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks
  27. * @return UpdateWorkflowOptions Options builder
  28. */
  29. public static function update($friendlyName = Values::NONE, $assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $configuration = Values::NONE, $taskReservationTimeout = Values::NONE, $reEvaluateTasks = Values::NONE) {
  30. return new UpdateWorkflowOptions($friendlyName, $assignmentCallbackUrl, $fallbackAssignmentCallbackUrl, $configuration, $taskReservationTimeout, $reEvaluateTasks);
  31. }
  32. /**
  33. * @param string $friendlyName The friendly_name of the Workflow resources to
  34. * read
  35. * @return ReadWorkflowOptions Options builder
  36. */
  37. public static function read($friendlyName = Values::NONE) {
  38. return new ReadWorkflowOptions($friendlyName);
  39. }
  40. /**
  41. * @param string $assignmentCallbackUrl The URL from your application that will
  42. * process task assignment events
  43. * @param string $fallbackAssignmentCallbackUrl The URL that we should call
  44. * when a call to the
  45. * `assignment_callback_url` fails
  46. * @param int $taskReservationTimeout How long TaskRouter will wait for a
  47. * confirmation response from your
  48. * application after it assigns a Task to a
  49. * Worker
  50. * @return CreateWorkflowOptions Options builder
  51. */
  52. public static function create($assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $taskReservationTimeout = Values::NONE) {
  53. return new CreateWorkflowOptions($assignmentCallbackUrl, $fallbackAssignmentCallbackUrl, $taskReservationTimeout);
  54. }
  55. }
  56. class UpdateWorkflowOptions extends Options {
  57. /**
  58. * @param string $friendlyName descriptive string that you create to describe
  59. * the Workflow resource
  60. * @param string $assignmentCallbackUrl The URL from your application that will
  61. * process task assignment events
  62. * @param string $fallbackAssignmentCallbackUrl The URL that we should call
  63. * when a call to the
  64. * `assignment_callback_url` fails
  65. * @param string $configuration A JSON string that contains the rules to apply
  66. * to the Workflow
  67. * @param int $taskReservationTimeout How long TaskRouter will wait for a
  68. * confirmation response from your
  69. * application after it assigns a Task to a
  70. * Worker
  71. * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks
  72. */
  73. public function __construct($friendlyName = Values::NONE, $assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $configuration = Values::NONE, $taskReservationTimeout = Values::NONE, $reEvaluateTasks = Values::NONE) {
  74. $this->options['friendlyName'] = $friendlyName;
  75. $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl;
  76. $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl;
  77. $this->options['configuration'] = $configuration;
  78. $this->options['taskReservationTimeout'] = $taskReservationTimeout;
  79. $this->options['reEvaluateTasks'] = $reEvaluateTasks;
  80. }
  81. /**
  82. * A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`.
  83. *
  84. * @param string $friendlyName descriptive string that you create to describe
  85. * the Workflow resource
  86. * @return $this Fluent Builder
  87. */
  88. public function setFriendlyName($friendlyName) {
  89. $this->options['friendlyName'] = $friendlyName;
  90. return $this;
  91. }
  92. /**
  93. * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details.
  94. *
  95. * @param string $assignmentCallbackUrl The URL from your application that will
  96. * process task assignment events
  97. * @return $this Fluent Builder
  98. */
  99. public function setAssignmentCallbackUrl($assignmentCallbackUrl) {
  100. $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl;
  101. return $this;
  102. }
  103. /**
  104. * The URL that we should call when a call to the `assignment_callback_url` fails.
  105. *
  106. * @param string $fallbackAssignmentCallbackUrl The URL that we should call
  107. * when a call to the
  108. * `assignment_callback_url` fails
  109. * @return $this Fluent Builder
  110. */
  111. public function setFallbackAssignmentCallbackUrl($fallbackAssignmentCallbackUrl) {
  112. $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl;
  113. return $this;
  114. }
  115. /**
  116. * A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information.
  117. *
  118. * @param string $configuration A JSON string that contains the rules to apply
  119. * to the Workflow
  120. * @return $this Fluent Builder
  121. */
  122. public function setConfiguration($configuration) {
  123. $this->options['configuration'] = $configuration;
  124. return $this;
  125. }
  126. /**
  127. * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`.
  128. *
  129. * @param int $taskReservationTimeout How long TaskRouter will wait for a
  130. * confirmation response from your
  131. * application after it assigns a Task to a
  132. * Worker
  133. * @return $this Fluent Builder
  134. */
  135. public function setTaskReservationTimeout($taskReservationTimeout) {
  136. $this->options['taskReservationTimeout'] = $taskReservationTimeout;
  137. return $this;
  138. }
  139. /**
  140. * Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again.
  141. *
  142. * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks
  143. * @return $this Fluent Builder
  144. */
  145. public function setReEvaluateTasks($reEvaluateTasks) {
  146. $this->options['reEvaluateTasks'] = $reEvaluateTasks;
  147. return $this;
  148. }
  149. /**
  150. * Provide a friendly representation
  151. *
  152. * @return string Machine friendly representation
  153. */
  154. public function __toString() {
  155. $options = array();
  156. foreach ($this->options as $key => $value) {
  157. if ($value != Values::NONE) {
  158. $options[] = "$key=$value";
  159. }
  160. }
  161. return '[Twilio.Taskrouter.V1.UpdateWorkflowOptions ' . \implode(' ', $options) . ']';
  162. }
  163. }
  164. class ReadWorkflowOptions extends Options {
  165. /**
  166. * @param string $friendlyName The friendly_name of the Workflow resources to
  167. * read
  168. */
  169. public function __construct($friendlyName = Values::NONE) {
  170. $this->options['friendlyName'] = $friendlyName;
  171. }
  172. /**
  173. * The `friendly_name` of the Workflow resources to read.
  174. *
  175. * @param string $friendlyName The friendly_name of the Workflow resources to
  176. * read
  177. * @return $this Fluent Builder
  178. */
  179. public function setFriendlyName($friendlyName) {
  180. $this->options['friendlyName'] = $friendlyName;
  181. return $this;
  182. }
  183. /**
  184. * Provide a friendly representation
  185. *
  186. * @return string Machine friendly representation
  187. */
  188. public function __toString() {
  189. $options = array();
  190. foreach ($this->options as $key => $value) {
  191. if ($value != Values::NONE) {
  192. $options[] = "$key=$value";
  193. }
  194. }
  195. return '[Twilio.Taskrouter.V1.ReadWorkflowOptions ' . \implode(' ', $options) . ']';
  196. }
  197. }
  198. class CreateWorkflowOptions extends Options {
  199. /**
  200. * @param string $assignmentCallbackUrl The URL from your application that will
  201. * process task assignment events
  202. * @param string $fallbackAssignmentCallbackUrl The URL that we should call
  203. * when a call to the
  204. * `assignment_callback_url` fails
  205. * @param int $taskReservationTimeout How long TaskRouter will wait for a
  206. * confirmation response from your
  207. * application after it assigns a Task to a
  208. * Worker
  209. */
  210. public function __construct($assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $taskReservationTimeout = Values::NONE) {
  211. $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl;
  212. $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl;
  213. $this->options['taskReservationTimeout'] = $taskReservationTimeout;
  214. }
  215. /**
  216. * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details.
  217. *
  218. * @param string $assignmentCallbackUrl The URL from your application that will
  219. * process task assignment events
  220. * @return $this Fluent Builder
  221. */
  222. public function setAssignmentCallbackUrl($assignmentCallbackUrl) {
  223. $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl;
  224. return $this;
  225. }
  226. /**
  227. * The URL that we should call when a call to the `assignment_callback_url` fails.
  228. *
  229. * @param string $fallbackAssignmentCallbackUrl The URL that we should call
  230. * when a call to the
  231. * `assignment_callback_url` fails
  232. * @return $this Fluent Builder
  233. */
  234. public function setFallbackAssignmentCallbackUrl($fallbackAssignmentCallbackUrl) {
  235. $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl;
  236. return $this;
  237. }
  238. /**
  239. * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`.
  240. *
  241. * @param int $taskReservationTimeout How long TaskRouter will wait for a
  242. * confirmation response from your
  243. * application after it assigns a Task to a
  244. * Worker
  245. * @return $this Fluent Builder
  246. */
  247. public function setTaskReservationTimeout($taskReservationTimeout) {
  248. $this->options['taskReservationTimeout'] = $taskReservationTimeout;
  249. return $this;
  250. }
  251. /**
  252. * Provide a friendly representation
  253. *
  254. * @return string Machine friendly representation
  255. */
  256. public function __toString() {
  257. $options = array();
  258. foreach ($this->options as $key => $value) {
  259. if ($value != Values::NONE) {
  260. $options[] = "$key=$value";
  261. }
  262. }
  263. return '[Twilio.Taskrouter.V1.CreateWorkflowOptions ' . \implode(' ', $options) . ']';
  264. }
  265. }