1 | <?php |
||
5 | class TelerivetMessage |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | protected $messageType; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $content; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $toNumber; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $contactId; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $routeId; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $statusUrl; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $statusSecret; |
||
41 | |||
42 | /** |
||
43 | * @var bool |
||
44 | */ |
||
45 | protected $isTemplate; |
||
46 | |||
47 | /** |
||
48 | * @var bool |
||
49 | */ |
||
50 | protected $trackClicks; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $mediaUrls; |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | protected $labelIds; |
||
61 | |||
62 | /** |
||
63 | * @var object |
||
64 | */ |
||
65 | protected $vars; |
||
66 | |||
67 | /** |
||
68 | * @var int |
||
69 | */ |
||
70 | protected $priority; |
||
71 | |||
72 | /** |
||
73 | * @var bool |
||
74 | */ |
||
75 | protected $simulated; |
||
76 | |||
77 | /** |
||
78 | * @var string |
||
79 | */ |
||
80 | protected $serviceId; |
||
81 | |||
82 | /** |
||
83 | * @var string |
||
84 | */ |
||
85 | protected $audioUrl; |
||
86 | |||
87 | /** |
||
88 | * @var string |
||
89 | */ |
||
90 | protected $ttsLang; |
||
91 | |||
92 | /** |
||
93 | * @var string |
||
94 | */ |
||
95 | protected $ttsVoice; |
||
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getMessageType(): ?string |
||
104 | |||
105 | /** |
||
106 | * [Optional] Type of message to send. If text, will use the default text message type for the selected route. |
||
107 | * Possible Values: sms, mms, ussd, call, text |
||
108 | * Default: text |
||
109 | * |
||
110 | * @param string $messageType |
||
111 | * @return TelerivetMessage |
||
112 | */ |
||
113 | public function setMessageType(?string $messageType): self |
||
119 | |||
120 | /** |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getContent(): ?string |
||
127 | |||
128 | /** |
||
129 | * [Required if sending SMS message] |
||
130 | * Content of the message to send (if message_type is call, the text will be spoken during a text-to-speech call) |
||
131 | * |
||
132 | * @param string $content |
||
133 | * @return TelerivetMessage |
||
134 | */ |
||
135 | public function setContent(?string $content): self |
||
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getToNumber(): ?string |
||
149 | |||
150 | /** |
||
151 | * [Required if contact_id not set] |
||
152 | * Phone number to send the message to. |
||
153 | * |
||
154 | * @param string $toNumber |
||
155 | * @return TelerivetMessage |
||
156 | */ |
||
157 | public function setToNumber(?string $toNumber): self |
||
163 | |||
164 | /** |
||
165 | * @return string |
||
166 | */ |
||
167 | public function getContactId(): ?string |
||
171 | |||
172 | /** |
||
173 | * [Required if to_number not set] |
||
174 | * ID of the contact to send the message to |
||
175 | * |
||
176 | * @param string $contactId |
||
177 | * @return TelerivetMessage |
||
178 | */ |
||
179 | public function setContactId(?string $contactId): self |
||
185 | |||
186 | /** |
||
187 | * @return string |
||
188 | */ |
||
189 | public function getRouteId(): ?string |
||
193 | |||
194 | /** |
||
195 | * [Optional] ID of the phone or route to send the message from |
||
196 | * Default: default sender route ID for your project |
||
197 | * |
||
198 | * @param string $routeId |
||
199 | * @return TelerivetMessage |
||
200 | */ |
||
201 | public function setRouteId(?string $routeId): self |
||
207 | |||
208 | /** |
||
209 | * @return string |
||
210 | */ |
||
211 | public function getStatusUrl(): ?string |
||
215 | |||
216 | /** |
||
217 | * [Optional] Webhook callback URL to be notified when message status changes |
||
218 | * |
||
219 | * @param string $statusUrl |
||
220 | * @return TelerivetMessage |
||
221 | */ |
||
222 | public function setStatusUrl(?string $statusUrl): self |
||
228 | |||
229 | /** |
||
230 | * @return string |
||
231 | */ |
||
232 | public function getStatusSecret(): ?string |
||
236 | |||
237 | /** |
||
238 | * [Optional] POST parameter 'secret' passed to status_url |
||
239 | * |
||
240 | * @param string $statusSecret |
||
241 | * @return TelerivetMessage |
||
242 | */ |
||
243 | public function setStatusSecret(?string $statusSecret): self |
||
249 | |||
250 | /** |
||
251 | * @return bool |
||
252 | */ |
||
253 | public function isTemplate(): ?bool |
||
257 | |||
258 | /** |
||
259 | * [Optional] Set to true to evaluate variables like [[contact.name]] in message content. |
||
260 | * (See available variables https://telerivet.com/api/rest/curl#variables) |
||
261 | * Default: false |
||
262 | * |
||
263 | * @param bool $isTemplate |
||
264 | * @return TelerivetMessage |
||
265 | */ |
||
266 | public function setIsTemplate(?bool $isTemplate): self |
||
272 | |||
273 | /** |
||
274 | * @return bool |
||
275 | */ |
||
276 | public function isTrackClicks(): ?bool |
||
280 | |||
281 | /** |
||
282 | * [Optional] If true, URLs in the message content will automatically be replaced with unique short URLs. |
||
283 | * Default: false |
||
284 | * |
||
285 | * @param bool $trackClicks |
||
286 | * @return TelerivetMessage |
||
287 | */ |
||
288 | public function setTrackClicks(?bool $trackClicks): self |
||
294 | |||
295 | /** |
||
296 | * @return array |
||
297 | */ |
||
298 | public function getMediaUrls(): ?array |
||
302 | |||
303 | /** |
||
304 | * [Optional] URLs of media files to attach to the text message. If message_type is sms, short links to each media |
||
305 | * URL will be appended to the end of the content (separated by a new line). |
||
306 | * |
||
307 | * @param array $mediaUrls |
||
308 | * @return TelerivetMessage |
||
309 | */ |
||
310 | public function setMediaUrls(?array $mediaUrls): self |
||
316 | |||
317 | /** |
||
318 | * @return array |
||
319 | */ |
||
320 | public function getLabelIds(): ?array |
||
324 | |||
325 | /** |
||
326 | * [Optional] Array string IDs of Label <https://telerivet.com/api/rest/curl#Label> |
||
327 | * List of IDs of labels to add to this message |
||
328 | * |
||
329 | * @param array $labelIds |
||
330 | * @return TelerivetMessage |
||
331 | */ |
||
332 | public function setLabelIds(?array $labelIds): self |
||
338 | |||
339 | /** |
||
340 | * @return object |
||
341 | */ |
||
342 | public function getVars(): ?object |
||
346 | |||
347 | /** |
||
348 | * [Optional] Custom variables to store with the message |
||
349 | * |
||
350 | * @param object $vars |
||
351 | * @return TelerivetMessage |
||
352 | */ |
||
353 | public function setVars(?object $vars): self |
||
359 | |||
360 | /** |
||
361 | * @return int |
||
362 | */ |
||
363 | public function getPriority(): ?int |
||
367 | |||
368 | /** |
||
369 | * [Optional] Priority of the message. Telerivet will attempt to send messages with higher priority numbers first |
||
370 | * (for example, so you can prioritize an auto-reply ahead of a bulk message to a large group). |
||
371 | * Possible Values: 1, 2 |
||
372 | * Default: 1 |
||
373 | * |
||
374 | * @param int $priority |
||
375 | * @return TelerivetMessage |
||
376 | */ |
||
377 | public function setPriority(?int $priority): self |
||
383 | |||
384 | /** |
||
385 | * @return bool |
||
386 | */ |
||
387 | public function isSimulated(): ?bool |
||
391 | |||
392 | /** |
||
393 | * [Optional] Set to true to test the Telerivet API without actually sending a message from the route |
||
394 | * Default: false |
||
395 | * |
||
396 | * @param bool $simulated |
||
397 | * @return TelerivetMessage |
||
398 | */ |
||
399 | public function setSimulated(?bool $simulated): self |
||
405 | |||
406 | /** |
||
407 | * @return string |
||
408 | */ |
||
409 | public function getServiceId(): ?string |
||
413 | |||
414 | /** |
||
415 | * [Optional] string ID of Service <https://telerivet.com/api/rest/curl#Service> |
||
416 | * Service that defines the call flow of the voice call (when message_type is call) |
||
417 | * |
||
418 | * @param string $serviceId |
||
419 | * @return TelerivetMessage |
||
420 | */ |
||
421 | public function setServiceId(?string $serviceId): self |
||
427 | |||
428 | /** |
||
429 | * @return string |
||
430 | */ |
||
431 | public function getAudioUrl(): ?string |
||
435 | |||
436 | /** |
||
437 | * [Optional] The URL of an MP3 file to play when the contact answers the call (when message_type is call). |
||
438 | * If audio_url is provided, the text-to-speech voice is not used to say content, although you can optionally use |
||
439 | * content to indicate the script for the audio. |
||
440 | * For best results, use an MP3 file containing only speech. Music is not recommended because the audio quality will |
||
441 | * be low when played over a phone line. |
||
442 | * |
||
443 | * @param string $audioUrl |
||
444 | * @return TelerivetMessage |
||
445 | */ |
||
446 | public function setAudioUrl(?string $audioUrl): self |
||
452 | |||
453 | /** |
||
454 | * @return string |
||
455 | */ |
||
456 | public function getTtsLang(): ?string |
||
460 | |||
461 | /** |
||
462 | * [Optional] The language of the text-to-speech voice (when message_type is call) |
||
463 | * Possible Values: en-US, en-GB, en-GB-WLS, en-AU, en-IN, da-DK, nl-NL, fr-FR, fr-CA, de-DE, is-IS, it-IT, pl-PL, |
||
464 | * pt-BR, pt-PT, ru-RU, es-ES, es-US, sv-SE |
||
465 | * Default: en-US |
||
466 | * |
||
467 | * @param string $ttsLang |
||
468 | * @return TelerivetMessage |
||
469 | */ |
||
470 | public function setTtsLang(?string $ttsLang): self |
||
476 | |||
477 | /** |
||
478 | * @return string |
||
479 | */ |
||
480 | public function getTtsVoice(): ?string |
||
484 | |||
485 | /** |
||
486 | * [Optional] The name of the text-to-speech voice (when message_type=call) |
||
487 | * Possible Values: female, male |
||
488 | * Default: female |
||
489 | * |
||
490 | * @param string $ttsVoice |
||
491 | * @return TelerivetMessage |
||
492 | */ |
||
493 | public function setTtsVoice(?string $ttsVoice): self |
||
499 | |||
500 | public function toArray() |
||
523 | } |
||
524 |