PageRenderTime 38ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Twilio/Rest/Fax/V1/FaxOptions.php

http://github.com/twilio/twilio-php
PHP | 267 lines | 99 code | 24 blank | 144 comment | 0 complexity | 42f5ddd4b0cdf595ec86a859ae0a4871 MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /**
  3. * This code was generated by
  4. * \ / _ _ _| _ _
  5. * | (_)\/(_)(_|\/| |(/_ v1.0.0
  6. * / /
  7. */
  8. namespace Twilio\Rest\Fax\V1;
  9. use Twilio\Options;
  10. use Twilio\Values;
  11. /**
  12. * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
  13. */
  14. abstract class FaxOptions {
  15. /**
  16. * @param string $from Retrieve only those faxes sent from this phone number
  17. * @param string $to Retrieve only those faxes sent to this phone number
  18. * @param \DateTime $dateCreatedOnOrBefore Retrieve only faxes created on or
  19. * before this date
  20. * @param \DateTime $dateCreatedAfter Retrieve only faxes created after this
  21. * date
  22. * @return ReadFaxOptions Options builder
  23. */
  24. public static function read(string $from = Values::NONE, string $to = Values::NONE, \DateTime $dateCreatedOnOrBefore = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE): ReadFaxOptions {
  25. return new ReadFaxOptions($from, $to, $dateCreatedOnOrBefore, $dateCreatedAfter);
  26. }
  27. /**
  28. * @param string $quality The quality of this fax
  29. * @param string $statusCallback The URL we should call to send status
  30. * information to your application
  31. * @param string $from The number the fax was sent from
  32. * @param string $sipAuthUsername The username for SIP authentication
  33. * @param string $sipAuthPassword The password for SIP authentication
  34. * @param bool $storeMedia Whether to store a copy of the sent media
  35. * @param int $ttl How long in minutes to try to send the fax
  36. * @return CreateFaxOptions Options builder
  37. */
  38. public static function create(string $quality = Values::NONE, string $statusCallback = Values::NONE, string $from = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, bool $storeMedia = Values::NONE, int $ttl = Values::NONE): CreateFaxOptions {
  39. return new CreateFaxOptions($quality, $statusCallback, $from, $sipAuthUsername, $sipAuthPassword, $storeMedia, $ttl);
  40. }
  41. /**
  42. * @param string $status The new status of the resource
  43. * @return UpdateFaxOptions Options builder
  44. */
  45. public static function update(string $status = Values::NONE): UpdateFaxOptions {
  46. return new UpdateFaxOptions($status);
  47. }
  48. }
  49. class ReadFaxOptions extends Options {
  50. /**
  51. * @param string $from Retrieve only those faxes sent from this phone number
  52. * @param string $to Retrieve only those faxes sent to this phone number
  53. * @param \DateTime $dateCreatedOnOrBefore Retrieve only faxes created on or
  54. * before this date
  55. * @param \DateTime $dateCreatedAfter Retrieve only faxes created after this
  56. * date
  57. */
  58. public function __construct(string $from = Values::NONE, string $to = Values::NONE, \DateTime $dateCreatedOnOrBefore = Values::NONE, \DateTime $dateCreatedAfter = Values::NONE) {
  59. $this->options['from'] = $from;
  60. $this->options['to'] = $to;
  61. $this->options['dateCreatedOnOrBefore'] = $dateCreatedOnOrBefore;
  62. $this->options['dateCreatedAfter'] = $dateCreatedAfter;
  63. }
  64. /**
  65. * Retrieve only those faxes sent from this phone number, specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format.
  66. *
  67. * @param string $from Retrieve only those faxes sent from this phone number
  68. * @return $this Fluent Builder
  69. */
  70. public function setFrom(string $from): self {
  71. $this->options['from'] = $from;
  72. return $this;
  73. }
  74. /**
  75. * Retrieve only those faxes sent to this phone number, specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format.
  76. *
  77. * @param string $to Retrieve only those faxes sent to this phone number
  78. * @return $this Fluent Builder
  79. */
  80. public function setTo(string $to): self {
  81. $this->options['to'] = $to;
  82. return $this;
  83. }
  84. /**
  85. * Retrieve only those faxes with a `date_created` that is before or equal to this value, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
  86. *
  87. * @param \DateTime $dateCreatedOnOrBefore Retrieve only faxes created on or
  88. * before this date
  89. * @return $this Fluent Builder
  90. */
  91. public function setDateCreatedOnOrBefore(\DateTime $dateCreatedOnOrBefore): self {
  92. $this->options['dateCreatedOnOrBefore'] = $dateCreatedOnOrBefore;
  93. return $this;
  94. }
  95. /**
  96. * Retrieve only those faxes with a `date_created` that is later than this value, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
  97. *
  98. * @param \DateTime $dateCreatedAfter Retrieve only faxes created after this
  99. * date
  100. * @return $this Fluent Builder
  101. */
  102. public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self {
  103. $this->options['dateCreatedAfter'] = $dateCreatedAfter;
  104. return $this;
  105. }
  106. /**
  107. * Provide a friendly representation
  108. *
  109. * @return string Machine friendly representation
  110. */
  111. public function __toString(): string {
  112. $options = \http_build_query(Values::of($this->options), '', ' ');
  113. return '[Twilio.Fax.V1.ReadFaxOptions ' . $options . ']';
  114. }
  115. }
  116. class CreateFaxOptions extends Options {
  117. /**
  118. * @param string $quality The quality of this fax
  119. * @param string $statusCallback The URL we should call to send status
  120. * information to your application
  121. * @param string $from The number the fax was sent from
  122. * @param string $sipAuthUsername The username for SIP authentication
  123. * @param string $sipAuthPassword The password for SIP authentication
  124. * @param bool $storeMedia Whether to store a copy of the sent media
  125. * @param int $ttl How long in minutes to try to send the fax
  126. */
  127. public function __construct(string $quality = Values::NONE, string $statusCallback = Values::NONE, string $from = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, bool $storeMedia = Values::NONE, int $ttl = Values::NONE) {
  128. $this->options['quality'] = $quality;
  129. $this->options['statusCallback'] = $statusCallback;
  130. $this->options['from'] = $from;
  131. $this->options['sipAuthUsername'] = $sipAuthUsername;
  132. $this->options['sipAuthPassword'] = $sipAuthPassword;
  133. $this->options['storeMedia'] = $storeMedia;
  134. $this->options['ttl'] = $ttl;
  135. }
  136. /**
  137. * The [Fax Quality value](https://www.twilio.com/docs/fax/api/fax-resource#fax-quality-values) that describes the fax quality. Can be: `standard`, `fine`, or `superfine` and defaults to `fine`.
  138. *
  139. * @param string $quality The quality of this fax
  140. * @return $this Fluent Builder
  141. */
  142. public function setQuality(string $quality): self {
  143. $this->options['quality'] = $quality;
  144. return $this;
  145. }
  146. /**
  147. * The URL we should call using the `POST` method to send [status information](https://www.twilio.com/docs/fax/api/fax-resource#fax-status-callback) to your application when the status of the fax changes.
  148. *
  149. * @param string $statusCallback The URL we should call to send status
  150. * information to your application
  151. * @return $this Fluent Builder
  152. */
  153. public function setStatusCallback(string $statusCallback): self {
  154. $this->options['statusCallback'] = $statusCallback;
  155. return $this;
  156. }
  157. /**
  158. * The number the fax was sent from. Can be the phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format or the SIP `from` value. The caller ID displayed to the recipient uses this value. If this is a phone number, it must be a Twilio number or a verified outgoing caller id from your account. If `to` is a SIP address, this can be any alphanumeric string (and also the characters `+`, `_`, `.`, and `-`), which will be used in the `from` header of the SIP request.
  159. *
  160. * @param string $from The number the fax was sent from
  161. * @return $this Fluent Builder
  162. */
  163. public function setFrom(string $from): self {
  164. $this->options['from'] = $from;
  165. return $this;
  166. }
  167. /**
  168. * The username to use with the `sip_auth_password` to authenticate faxes sent to a SIP address.
  169. *
  170. * @param string $sipAuthUsername The username for SIP authentication
  171. * @return $this Fluent Builder
  172. */
  173. public function setSipAuthUsername(string $sipAuthUsername): self {
  174. $this->options['sipAuthUsername'] = $sipAuthUsername;
  175. return $this;
  176. }
  177. /**
  178. * The password to use with `sip_auth_username` to authenticate faxes sent to a SIP address.
  179. *
  180. * @param string $sipAuthPassword The password for SIP authentication
  181. * @return $this Fluent Builder
  182. */
  183. public function setSipAuthPassword(string $sipAuthPassword): self {
  184. $this->options['sipAuthPassword'] = $sipAuthPassword;
  185. return $this;
  186. }
  187. /**
  188. * Whether to store a copy of the sent media on our servers for later retrieval. Can be: `true` or `false` and the default is `true`.
  189. *
  190. * @param bool $storeMedia Whether to store a copy of the sent media
  191. * @return $this Fluent Builder
  192. */
  193. public function setStoreMedia(bool $storeMedia): self {
  194. $this->options['storeMedia'] = $storeMedia;
  195. return $this;
  196. }
  197. /**
  198. * How long in minutes from when the fax is initiated that we should try to send the fax.
  199. *
  200. * @param int $ttl How long in minutes to try to send the fax
  201. * @return $this Fluent Builder
  202. */
  203. public function setTtl(int $ttl): self {
  204. $this->options['ttl'] = $ttl;
  205. return $this;
  206. }
  207. /**
  208. * Provide a friendly representation
  209. *
  210. * @return string Machine friendly representation
  211. */
  212. public function __toString(): string {
  213. $options = \http_build_query(Values::of($this->options), '', ' ');
  214. return '[Twilio.Fax.V1.CreateFaxOptions ' . $options . ']';
  215. }
  216. }
  217. class UpdateFaxOptions extends Options {
  218. /**
  219. * @param string $status The new status of the resource
  220. */
  221. public function __construct(string $status = Values::NONE) {
  222. $this->options['status'] = $status;
  223. }
  224. /**
  225. * The new [status](https://www.twilio.com/docs/fax/api/fax-resource#fax-status-values) of the resource. Can be only `canceled`. This may fail if transmission has already started.
  226. *
  227. * @param string $status The new status of the resource
  228. * @return $this Fluent Builder
  229. */
  230. public function setStatus(string $status): self {
  231. $this->options['status'] = $status;
  232. return $this;
  233. }
  234. /**
  235. * Provide a friendly representation
  236. *
  237. * @return string Machine friendly representation
  238. */
  239. public function __toString(): string {
  240. $options = \http_build_query(Values::of($this->options), '', ' ');
  241. return '[Twilio.Fax.V1.UpdateFaxOptions ' . $options . ']';
  242. }
  243. }