sentdm 0.38.1 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/client.rb +3 -20
  5. data/lib/sentdm/internal/voice_agents_page.rb +115 -0
  6. data/lib/sentdm/models/call_event.rb +8 -6
  7. data/lib/sentdm/models/call_event_payload.rb +29 -9
  8. data/lib/sentdm/models/channels/voice_create_params.rb +23 -11
  9. data/lib/sentdm/models/channels/voice_number.rb +23 -1
  10. data/lib/sentdm/models/channels/voice_update_params.rb +12 -1
  11. data/lib/sentdm/models/message_send_params.rb +8 -1
  12. data/lib/sentdm/models/template.rb +6 -5
  13. data/lib/sentdm/models/template_body.rb +8 -8
  14. data/lib/sentdm/models/voice/agent_create_params.rb +142 -0
  15. data/lib/sentdm/models/{calls/participant_list_params.rb → voice/agent_delete_params.rb} +3 -3
  16. data/lib/sentdm/models/voice/agent_list_params.rb +38 -0
  17. data/lib/sentdm/models/{calls/participant_remove_all_params.rb → voice/agent_retrieve_params.rb} +3 -3
  18. data/lib/sentdm/models/voice/agent_rotate_secret_params.rb +34 -0
  19. data/lib/sentdm/models/voice/agent_update_params.rb +141 -0
  20. data/lib/sentdm/models/{calls/api_response_of_list_of_call_participant.rb → voice/api_response_of_call.rb} +7 -7
  21. data/lib/sentdm/models/voice/api_response_of_call_recordings.rb +45 -0
  22. data/lib/sentdm/models/voice/api_response_of_calls_list.rb +44 -0
  23. data/lib/sentdm/models/voice/api_response_of_voice_agent.rb +51 -0
  24. data/lib/sentdm/models/voice/api_response_of_voice_agent_secret.rb +45 -0
  25. data/lib/sentdm/models/voice/api_response_of_voice_agents_list.rb +48 -0
  26. data/lib/sentdm/models/voice/api_response_of_voice_catalogue.rb +49 -0
  27. data/lib/sentdm/models/{channels → voice}/api_response_of_voice_token.rb +5 -5
  28. data/lib/sentdm/models/voice/call.rb +241 -0
  29. data/lib/sentdm/models/{calls/participant_remove_params.rb → voice/call_hangup_params.rb} +8 -8
  30. data/lib/sentdm/models/voice/call_list_params.rb +103 -0
  31. data/lib/sentdm/models/voice/call_list_recordings_params.rb +28 -0
  32. data/lib/sentdm/models/voice/call_party.rb +33 -0
  33. data/lib/sentdm/models/{calls/participant_update_params.rb → voice/call_record_params.rb} +10 -17
  34. data/lib/sentdm/models/voice/call_recording.rb +40 -0
  35. data/lib/sentdm/models/voice/call_recordings.rb +26 -0
  36. data/lib/sentdm/models/voice/call_retrieve_params.rb +28 -0
  37. data/lib/sentdm/models/voice/call_timeline_entry.rb +28 -0
  38. data/lib/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rb +51 -0
  39. data/lib/sentdm/models/voice/calls/call_participant.rb +62 -0
  40. data/lib/sentdm/models/voice/calls/call_participant_target.rb +32 -0
  41. data/lib/sentdm/models/voice/calls/participant_add_params.rb +68 -0
  42. data/lib/sentdm/models/voice/calls/participant_list_params.rb +30 -0
  43. data/lib/sentdm/models/voice/calls/participant_remove_all_params.rb +30 -0
  44. data/lib/sentdm/models/voice/calls/participant_remove_params.rb +36 -0
  45. data/lib/sentdm/models/voice/calls/participant_update_params.rb +66 -0
  46. data/lib/sentdm/models/voice/calls_list.rb +28 -0
  47. data/lib/sentdm/models/voice/catalogue_list_params.rb +22 -0
  48. data/lib/sentdm/models/{channels/voice_create_token_params.rb → voice/token_create_params.rb} +4 -4
  49. data/lib/sentdm/models/voice/voice_agent.rb +138 -0
  50. data/lib/sentdm/models/voice/voice_agent_audio.rb +19 -0
  51. data/lib/sentdm/models/voice/voice_agent_audio_spec.rb +20 -0
  52. data/lib/sentdm/models/voice/voice_agent_limits.rb +31 -0
  53. data/lib/sentdm/models/voice/voice_agent_limits_spec.rb +40 -0
  54. data/lib/sentdm/models/voice/voice_agent_party.rb +25 -0
  55. data/lib/sentdm/models/voice/voice_agent_party_spec.rb +28 -0
  56. data/lib/sentdm/models/voice/voice_agent_secret.rb +27 -0
  57. data/lib/sentdm/models/voice/voice_agent_speech.rb +31 -0
  58. data/lib/sentdm/models/voice/voice_agent_speech_spec.rb +40 -0
  59. data/lib/sentdm/models/voice/voice_agent_transcripts.rb +25 -0
  60. data/lib/sentdm/models/voice/voice_agent_transcripts_spec.rb +32 -0
  61. data/lib/sentdm/models/voice/voice_agents_list.rb +30 -0
  62. data/lib/sentdm/models/voice/voice_catalogue.rb +30 -0
  63. data/lib/sentdm/models/voice/voice_catalogue_voice.rb +43 -0
  64. data/lib/sentdm/models/{channels → voice}/voice_token.rb +9 -3
  65. data/lib/sentdm/models/webhook_create_params.rb +31 -5
  66. data/lib/sentdm/models/webhook_response.rb +66 -4
  67. data/lib/sentdm/models/webhook_update_params.rb +15 -3
  68. data/lib/sentdm/models.rb +2 -30
  69. data/lib/sentdm/resources/channels/voice.rb +43 -63
  70. data/lib/sentdm/resources/channels.rb +2 -2
  71. data/lib/sentdm/resources/profiles/campaigns.rb +3 -2
  72. data/lib/sentdm/resources/voice/agents.rb +319 -0
  73. data/lib/sentdm/resources/voice/calls/participants.rb +244 -0
  74. data/lib/sentdm/resources/voice/calls.rb +269 -0
  75. data/lib/sentdm/resources/voice/catalogue.rb +71 -0
  76. data/lib/sentdm/resources/voice/tokens.rb +86 -0
  77. data/lib/sentdm/resources/voice.rb +142 -0
  78. data/lib/sentdm/resources/webhooks.rb +43 -15
  79. data/lib/sentdm/version.rb +1 -1
  80. data/lib/sentdm.rb +59 -28
  81. data/rbi/sentdm/client.rbi +2 -19
  82. data/rbi/sentdm/internal/voice_agents_page.rbi +71 -0
  83. data/rbi/sentdm/models/call_event.rbi +14 -10
  84. data/rbi/sentdm/models/call_event_payload.rbi +34 -9
  85. data/rbi/sentdm/models/channels/voice_create_params.rbi +33 -17
  86. data/rbi/sentdm/models/channels/voice_number.rbi +31 -0
  87. data/rbi/sentdm/models/channels/voice_update_params.rbi +14 -0
  88. data/rbi/sentdm/models/message_send_params.rbi +16 -2
  89. data/rbi/sentdm/models/template.rbi +12 -10
  90. data/rbi/sentdm/models/template_body.rbi +12 -12
  91. data/rbi/sentdm/models/voice/agent_create_params.rbi +215 -0
  92. data/rbi/sentdm/models/{calls/participant_remove_all_params.rbi → voice/agent_delete_params.rbi} +3 -6
  93. data/rbi/sentdm/models/voice/agent_list_params.rbi +66 -0
  94. data/rbi/sentdm/models/voice/agent_retrieve_params.rbi +48 -0
  95. data/rbi/sentdm/models/{calls/participant_remove_params.rbi → voice/agent_rotate_secret_params.rbi} +11 -8
  96. data/rbi/sentdm/models/voice/agent_update_params.rbi +211 -0
  97. data/rbi/sentdm/models/voice/api_response_of_call.rbi +76 -0
  98. data/rbi/sentdm/models/voice/api_response_of_call_recordings.rbi +81 -0
  99. data/rbi/sentdm/models/{calls/api_response_of_list_of_call_participant.rbi → voice/api_response_of_calls_list.rbi} +12 -9
  100. data/rbi/sentdm/models/voice/api_response_of_voice_agent.rbi +85 -0
  101. data/rbi/sentdm/models/voice/api_response_of_voice_agent_secret.rbi +81 -0
  102. data/rbi/sentdm/models/voice/api_response_of_voice_agents_list.rbi +83 -0
  103. data/rbi/sentdm/models/voice/api_response_of_voice_catalogue.rbi +83 -0
  104. data/rbi/sentdm/models/{channels → voice}/api_response_of_voice_token.rbi +6 -8
  105. data/rbi/sentdm/models/voice/call.rbi +329 -0
  106. data/rbi/sentdm/models/voice/call_hangup_params.rbi +61 -0
  107. data/rbi/sentdm/models/voice/call_list_params.rbi +134 -0
  108. data/rbi/sentdm/models/{calls/participant_list_params.rbi → voice/call_list_recordings_params.rbi} +3 -3
  109. data/rbi/sentdm/models/voice/call_party.rbi +47 -0
  110. data/rbi/sentdm/models/{calls/participant_update_params.rbi → voice/call_record_params.rbi} +12 -21
  111. data/rbi/sentdm/models/voice/call_recording.rbi +63 -0
  112. data/rbi/sentdm/models/voice/call_recordings.rbi +49 -0
  113. data/rbi/sentdm/models/voice/call_retrieve_params.rbi +48 -0
  114. data/rbi/sentdm/models/voice/call_timeline_entry.rbi +44 -0
  115. data/rbi/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rbi +84 -0
  116. data/rbi/sentdm/models/voice/calls/call_participant.rbi +97 -0
  117. data/rbi/sentdm/models/voice/calls/call_participant_target.rbi +49 -0
  118. data/rbi/sentdm/models/voice/calls/participant_add_params.rbi +104 -0
  119. data/rbi/sentdm/models/voice/calls/participant_list_params.rbi +53 -0
  120. data/rbi/sentdm/models/voice/calls/participant_remove_all_params.rbi +53 -0
  121. data/rbi/sentdm/models/voice/calls/participant_remove_params.rbi +63 -0
  122. data/rbi/sentdm/models/voice/calls/participant_update_params.rbi +96 -0
  123. data/rbi/sentdm/models/voice/calls_list.rbi +54 -0
  124. data/rbi/sentdm/models/voice/catalogue_list_params.rbi +40 -0
  125. data/rbi/sentdm/models/{channels/voice_create_token_params.rbi → voice/token_create_params.rbi} +3 -6
  126. data/rbi/sentdm/models/voice/voice_agent.rbi +196 -0
  127. data/rbi/sentdm/models/voice/voice_agent_audio.rbi +30 -0
  128. data/rbi/sentdm/models/voice/voice_agent_audio_spec.rbi +33 -0
  129. data/rbi/sentdm/models/voice/voice_agent_limits.rbi +57 -0
  130. data/rbi/sentdm/models/voice/voice_agent_limits_spec.rbi +62 -0
  131. data/rbi/sentdm/models/voice/voice_agent_party.rbi +36 -0
  132. data/rbi/sentdm/models/voice/voice_agent_party_spec.rbi +45 -0
  133. data/rbi/sentdm/models/voice/voice_agent_secret.rbi +37 -0
  134. data/rbi/sentdm/models/voice/voice_agent_speech.rbi +48 -0
  135. data/rbi/sentdm/models/voice/voice_agent_speech_spec.rbi +62 -0
  136. data/rbi/sentdm/models/voice/voice_agent_transcripts.rbi +43 -0
  137. data/rbi/sentdm/models/voice/voice_agent_transcripts_spec.rbi +51 -0
  138. data/rbi/sentdm/models/voice/voice_agents_list.rbi +55 -0
  139. data/rbi/sentdm/models/voice/voice_catalogue.rbi +59 -0
  140. data/rbi/sentdm/models/voice/voice_catalogue_voice.rbi +75 -0
  141. data/rbi/sentdm/models/{channels → voice}/voice_token.rbi +8 -4
  142. data/rbi/sentdm/models/webhook_create_params.rbi +41 -3
  143. data/rbi/sentdm/models/webhook_response.rbi +112 -3
  144. data/rbi/sentdm/models/webhook_update_params.rbi +18 -3
  145. data/rbi/sentdm/models.rbi +2 -30
  146. data/rbi/sentdm/resources/channels/voice.rbi +57 -67
  147. data/rbi/sentdm/resources/channels.rbi +2 -2
  148. data/rbi/sentdm/resources/messages.rbi +8 -1
  149. data/rbi/sentdm/resources/profiles/campaigns.rbi +3 -2
  150. data/rbi/sentdm/resources/voice/agents.rbi +316 -0
  151. data/rbi/sentdm/resources/voice/calls/participants.rbi +212 -0
  152. data/rbi/sentdm/resources/voice/calls.rbi +244 -0
  153. data/rbi/sentdm/resources/voice/catalogue.rbi +59 -0
  154. data/rbi/sentdm/resources/voice/tokens.rbi +84 -0
  155. data/rbi/sentdm/resources/voice.rbi +136 -0
  156. data/rbi/sentdm/resources/webhooks.rbi +56 -16
  157. data/sig/sentdm/client.rbs +1 -1
  158. data/sig/sentdm/internal/voice_agents_page.rbs +41 -0
  159. data/sig/sentdm/models/call_event_payload.rbs +12 -0
  160. data/sig/sentdm/models/channels/voice_create_params.rbs +9 -4
  161. data/sig/sentdm/models/channels/voice_number.rbs +12 -0
  162. data/sig/sentdm/models/channels/voice_update_params.rbs +5 -0
  163. data/sig/sentdm/models/voice/agent_create_params.rbs +99 -0
  164. data/sig/sentdm/models/{calls/participant_remove_all_params.rbs → voice/agent_delete_params.rbs} +3 -3
  165. data/sig/sentdm/models/voice/agent_list_params.rbs +40 -0
  166. data/sig/sentdm/models/{calls/participant_list_params.rbs → voice/agent_retrieve_params.rbs} +3 -3
  167. data/sig/sentdm/models/{calls/participant_remove_params.rbs → voice/agent_rotate_secret_params.rbs} +8 -8
  168. data/sig/sentdm/models/voice/agent_update_params.rbs +108 -0
  169. data/sig/sentdm/models/{calls/api_response_of_list_of_call_participant.rbs → voice/api_response_of_call.rbs} +7 -7
  170. data/sig/sentdm/models/voice/api_response_of_call_recordings.rbs +41 -0
  171. data/sig/sentdm/models/voice/api_response_of_calls_list.rbs +41 -0
  172. data/sig/sentdm/models/voice/api_response_of_voice_agent.rbs +41 -0
  173. data/sig/sentdm/models/voice/api_response_of_voice_agent_secret.rbs +41 -0
  174. data/sig/sentdm/models/voice/api_response_of_voice_agents_list.rbs +41 -0
  175. data/sig/sentdm/models/voice/api_response_of_voice_catalogue.rbs +41 -0
  176. data/sig/sentdm/models/{channels → voice}/api_response_of_voice_token.rbs +5 -5
  177. data/sig/sentdm/models/voice/call.rbs +175 -0
  178. data/sig/sentdm/models/voice/call_hangup_params.rbs +40 -0
  179. data/sig/sentdm/models/voice/call_list_params.rbs +79 -0
  180. data/sig/sentdm/models/voice/call_list_recordings_params.rbs +32 -0
  181. data/sig/sentdm/models/voice/call_party.rbs +19 -0
  182. data/sig/sentdm/models/{calls/participant_update_params.rbs → voice/call_record_params.rbs} +8 -13
  183. data/sig/sentdm/models/voice/call_recording.rbs +34 -0
  184. data/sig/sentdm/models/voice/call_recordings.rbs +22 -0
  185. data/sig/sentdm/models/voice/call_retrieve_params.rbs +32 -0
  186. data/sig/sentdm/models/voice/call_timeline_entry.rbs +21 -0
  187. data/sig/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rbs +43 -0
  188. data/sig/sentdm/models/voice/calls/call_participant.rbs +54 -0
  189. data/sig/sentdm/models/voice/calls/call_participant_target.rbs +25 -0
  190. data/sig/sentdm/models/voice/calls/participant_add_params.rbs +65 -0
  191. data/sig/sentdm/models/voice/calls/participant_list_params.rbs +34 -0
  192. data/sig/sentdm/models/voice/calls/participant_remove_all_params.rbs +36 -0
  193. data/sig/sentdm/models/voice/calls/participant_remove_params.rbs +42 -0
  194. data/sig/sentdm/models/voice/calls/participant_update_params.rbs +63 -0
  195. data/sig/sentdm/models/voice/calls_list.rbs +33 -0
  196. data/sig/sentdm/models/voice/catalogue_list_params.rbs +27 -0
  197. data/sig/sentdm/models/{channels/voice_create_token_params.rbs → voice/token_create_params.rbs} +3 -3
  198. data/sig/sentdm/models/voice/voice_agent.rbs +116 -0
  199. data/sig/sentdm/models/voice/voice_agent_audio.rbs +19 -0
  200. data/sig/sentdm/models/voice/voice_agent_audio_spec.rbs +17 -0
  201. data/sig/sentdm/models/voice/voice_agent_limits.rbs +38 -0
  202. data/sig/sentdm/models/voice/voice_agent_limits_spec.rbs +34 -0
  203. data/sig/sentdm/models/{calls/call_participant_target.rbs → voice/voice_agent_party.rbs} +4 -4
  204. data/sig/sentdm/models/voice/voice_agent_party_spec.rbs +19 -0
  205. data/sig/sentdm/models/voice/voice_agent_secret.rbs +19 -0
  206. data/sig/sentdm/models/voice/voice_agent_speech.rbs +32 -0
  207. data/sig/sentdm/models/voice/voice_agent_speech_spec.rbs +26 -0
  208. data/sig/sentdm/models/voice/voice_agent_transcripts.rbs +23 -0
  209. data/sig/sentdm/models/voice/voice_agent_transcripts_spec.rbs +20 -0
  210. data/sig/sentdm/models/voice/voice_agents_list.rbs +35 -0
  211. data/sig/sentdm/models/voice/voice_catalogue.rbs +35 -0
  212. data/sig/sentdm/models/voice/voice_catalogue_voice.rbs +42 -0
  213. data/sig/sentdm/models/{channels → voice}/voice_token.rbs +3 -1
  214. data/sig/sentdm/models/webhook_create_params.rbs +12 -0
  215. data/sig/sentdm/models/webhook_response.rbs +46 -3
  216. data/sig/sentdm/models/webhook_update_params.rbs +5 -0
  217. data/sig/sentdm/models.rbs +2 -30
  218. data/sig/sentdm/resources/channels/voice.rbs +3 -11
  219. data/sig/sentdm/resources/voice/agents.rbs +74 -0
  220. data/sig/sentdm/resources/voice/calls/participants.rbs +52 -0
  221. data/sig/sentdm/resources/{calls/participants.rbs → voice/calls.rbs} +25 -21
  222. data/sig/sentdm/resources/voice/catalogue.rbs +14 -0
  223. data/sig/sentdm/resources/voice/tokens.rbs +19 -0
  224. data/sig/sentdm/resources/voice.rbs +15 -0
  225. data/sig/sentdm/resources/webhooks.rbs +3 -0
  226. metadata +176 -83
  227. data/lib/sentdm/models/api_response_of_call.rb +0 -43
  228. data/lib/sentdm/models/api_response_of_call_recordings.rb +0 -43
  229. data/lib/sentdm/models/api_response_of_calls_list.rb +0 -42
  230. data/lib/sentdm/models/call.rb +0 -134
  231. data/lib/sentdm/models/call_hangup_params.rb +0 -32
  232. data/lib/sentdm/models/call_list_params.rb +0 -83
  233. data/lib/sentdm/models/call_list_recordings_params.rb +0 -26
  234. data/lib/sentdm/models/call_party.rb +0 -31
  235. data/lib/sentdm/models/call_record_params.rb +0 -55
  236. data/lib/sentdm/models/call_recording.rb +0 -38
  237. data/lib/sentdm/models/call_recordings.rb +0 -24
  238. data/lib/sentdm/models/call_retrieve_params.rb +0 -26
  239. data/lib/sentdm/models/call_timeline_entry.rb +0 -26
  240. data/lib/sentdm/models/calls/call_participant.rb +0 -60
  241. data/lib/sentdm/models/calls/call_participant_target.rb +0 -30
  242. data/lib/sentdm/models/calls/participant_add_params.rb +0 -66
  243. data/lib/sentdm/models/calls_list.rb +0 -26
  244. data/lib/sentdm/resources/calls/participants.rb +0 -231
  245. data/lib/sentdm/resources/calls.rb +0 -236
  246. data/rbi/sentdm/models/api_response_of_call.rbi +0 -74
  247. data/rbi/sentdm/models/api_response_of_call_recordings.rbi +0 -74
  248. data/rbi/sentdm/models/api_response_of_calls_list.rbi +0 -74
  249. data/rbi/sentdm/models/call.rbi +0 -179
  250. data/rbi/sentdm/models/call_hangup_params.rbi +0 -59
  251. data/rbi/sentdm/models/call_list_params.rbi +0 -112
  252. data/rbi/sentdm/models/call_list_recordings_params.rbi +0 -46
  253. data/rbi/sentdm/models/call_party.rbi +0 -41
  254. data/rbi/sentdm/models/call_record_params.rbi +0 -83
  255. data/rbi/sentdm/models/call_recording.rbi +0 -59
  256. data/rbi/sentdm/models/call_recordings.rbi +0 -39
  257. data/rbi/sentdm/models/call_retrieve_params.rbi +0 -46
  258. data/rbi/sentdm/models/call_timeline_entry.rbi +0 -40
  259. data/rbi/sentdm/models/calls/call_participant.rbi +0 -92
  260. data/rbi/sentdm/models/calls/call_participant_target.rbi +0 -47
  261. data/rbi/sentdm/models/calls/participant_add_params.rbi +0 -98
  262. data/rbi/sentdm/models/calls_list.rbi +0 -47
  263. data/rbi/sentdm/resources/calls/participants.rbi +0 -199
  264. data/rbi/sentdm/resources/calls.rbi +0 -207
  265. data/sig/sentdm/models/api_response_of_call.rbs +0 -39
  266. data/sig/sentdm/models/api_response_of_call_recordings.rbs +0 -39
  267. data/sig/sentdm/models/api_response_of_calls_list.rbs +0 -39
  268. data/sig/sentdm/models/call.rbs +0 -101
  269. data/sig/sentdm/models/call_hangup_params.rbs +0 -38
  270. data/sig/sentdm/models/call_list_params.rbs +0 -67
  271. data/sig/sentdm/models/call_list_recordings_params.rbs +0 -30
  272. data/sig/sentdm/models/call_party.rbs +0 -17
  273. data/sig/sentdm/models/call_record_params.rbs +0 -54
  274. data/sig/sentdm/models/call_recording.rbs +0 -32
  275. data/sig/sentdm/models/call_recordings.rbs +0 -17
  276. data/sig/sentdm/models/call_retrieve_params.rbs +0 -30
  277. data/sig/sentdm/models/call_timeline_entry.rbs +0 -19
  278. data/sig/sentdm/models/calls/call_participant.rbs +0 -52
  279. data/sig/sentdm/models/calls/participant_add_params.rbs +0 -63
  280. data/sig/sentdm/models/calls_list.rbs +0 -26
  281. data/sig/sentdm/resources/calls.rbs +0 -50
@@ -34,6 +34,14 @@ module Sentdm
34
34
  # @return [Array<String>, nil]
35
35
  optional :event_types, Sentdm::Internal::Type::ArrayOf[String]
36
36
 
37
+ # @!attribute is_inheritable
38
+ # Makes this webhook inheritable by the organization's sender profiles (see
39
+ # create), or stops it being inheritable. Omit or pass null to keep it as it is.
40
+ # Only a version 2 webhook can be inheritable.
41
+ #
42
+ # @return [Boolean, nil]
43
+ optional :is_inheritable, Sentdm::Internal::Type::Boolean, nil?: true
44
+
37
45
  # @!attribute retry_count
38
46
  #
39
47
  # @return [Integer, nil]
@@ -48,7 +56,8 @@ module Sentdm
48
56
 
49
57
  # @!attribute sender_profile
50
58
  # Request-only: the events an organization webhook's sender profile clones
51
- # receive, one clone per existing and future profile. Responses never return it.
59
+ # receive, one clone per existing and future profile. A version 1 webhook's
60
+ # responses report it as WebhookSenderProfileV3Response.
52
61
  #
53
62
  # @return [Sentdm::Models::WebhookUpdateParams::SenderProfile, nil]
54
63
  optional :sender_profile, -> { Sentdm::WebhookUpdateParams::SenderProfile }, nil?: true
@@ -68,7 +77,7 @@ module Sentdm
68
77
  # @return [String, nil]
69
78
  optional :x_profile_id, String
70
79
 
71
- # @!method initialize(id:, display_name: nil, endpoint_url: nil, event_filters: nil, event_types: nil, retry_count: nil, sandbox: nil, sender_profile: nil, timeout_seconds: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
80
+ # @!method initialize(id:, display_name: nil, endpoint_url: nil, event_filters: nil, event_types: nil, is_inheritable: nil, retry_count: nil, sandbox: nil, sender_profile: nil, timeout_seconds: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
72
81
  # Some parameter documentations has been truncated, see
73
82
  # {Sentdm::Models::WebhookUpdateParams} for more details.
74
83
  #
@@ -82,6 +91,8 @@ module Sentdm
82
91
  #
83
92
  # @param event_types [Array<String>]
84
93
  #
94
+ # @param is_inheritable [Boolean, nil] Makes this webhook inheritable by the organization's sender profiles (see create
95
+ #
85
96
  # @param retry_count [Integer]
86
97
  #
87
98
  # @param sandbox [Boolean] Sandbox flag - when true, the operation is simulated without side effects
@@ -111,7 +122,8 @@ module Sentdm
111
122
 
112
123
  # @!method initialize(event_filters: nil, event_types: nil)
113
124
  # Request-only: the events an organization webhook's sender profile clones
114
- # receive, one clone per existing and future profile. Responses never return it.
125
+ # receive, one clone per existing and future profile. A version 1 webhook's
126
+ # responses report it as WebhookSenderProfileV3Response.
115
127
  #
116
128
  # @param event_filters [Hash{Symbol=>Array<String>}, nil]
117
129
  # @param event_types [Array<String>]
data/lib/sentdm/models.rb CHANGED
@@ -41,12 +41,6 @@ module Sentdm
41
41
 
42
42
  APIMeta = Sentdm::Models::APIMeta
43
43
 
44
- APIResponseOfCall = Sentdm::Models::APIResponseOfCall
45
-
46
- APIResponseOfCallRecordings = Sentdm::Models::APIResponseOfCallRecordings
47
-
48
- APIResponseOfCallsList = Sentdm::Models::APIResponseOfCallsList
49
-
50
44
  APIResponseOfContact = Sentdm::Models::APIResponseOfContact
51
45
 
52
46
  APIResponseOfContactMessageSummary = Sentdm::Models::APIResponseOfContactMessageSummary
@@ -73,34 +67,10 @@ module Sentdm
73
67
 
74
68
  BrandsBrandData = Sentdm::Models::BrandsBrandData
75
69
 
76
- Call = Sentdm::Models::Call
77
-
78
70
  CallEvent = Sentdm::Models::CallEvent
79
71
 
80
72
  CallEventPayload = Sentdm::Models::CallEventPayload
81
73
 
82
- CallHangupParams = Sentdm::Models::CallHangupParams
83
-
84
- CallListParams = Sentdm::Models::CallListParams
85
-
86
- CallListRecordingsParams = Sentdm::Models::CallListRecordingsParams
87
-
88
- CallParty = Sentdm::Models::CallParty
89
-
90
- CallRecording = Sentdm::Models::CallRecording
91
-
92
- CallRecordings = Sentdm::Models::CallRecordings
93
-
94
- CallRecordParams = Sentdm::Models::CallRecordParams
95
-
96
- CallRetrieveParams = Sentdm::Models::CallRetrieveParams
97
-
98
- Calls = Sentdm::Models::Calls
99
-
100
- CallsList = Sentdm::Models::CallsList
101
-
102
- CallTimelineEntry = Sentdm::Models::CallTimelineEntry
103
-
104
74
  ChannelEvent = Sentdm::Models::ChannelEvent
105
75
 
106
76
  ChannelEventPayload = Sentdm::Models::ChannelEventPayload
@@ -227,6 +197,8 @@ module Sentdm
227
197
 
228
198
  UserUpdateRoleParams = Sentdm::Models::UserUpdateRoleParams
229
199
 
200
+ Voice = Sentdm::Models::Voice
201
+
230
202
  WebhookCreateParams = Sentdm::Models::WebhookCreateParams
231
203
 
232
204
  WebhookDeleteParams = Sentdm::Models::WebhookDeleteParams
@@ -12,8 +12,8 @@ module Sentdm
12
12
  # number**: each number you hold can carry phone calls on its own
13
13
  # (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do
14
14
  # with its calls, one of them is the default line for calls placed from your app,
15
- # and voice tokens are minted under `POST /v3/channels/voice/tokens`. Read your
16
- # voice numbers with `GET /v3/channels/voice` and change one with
15
+ # and voice tokens are minted with `POST /v3/voice/tokens`. Read your voice
16
+ # numbers with `GET /v3/channels/voice` and change one with
17
17
  # `PATCH /v3/channels/voice/{number}`.
18
18
  #
19
19
  # ## Compliance lives on the market
@@ -47,6 +47,16 @@ module Sentdm
47
47
  # question the way you verify a webhook. `POST /v3/channels/voice/{number}/test`
48
48
  # sends a test question and reports the verdict.
49
49
  #
50
+ # Send `agent_id` instead of `callback_url`, or with it, to have one of your voice
51
+ # agents (`GET /v3/voice/agents`) answer calls to the number. The agent wins over
52
+ # the callback URL for calls to the number; calls your app places from it still
53
+ # follow your app. `routes_to` in the response says which answers, and reads
54
+ # `agent_pending` while the number is still being moved to the agent. Calls follow
55
+ # the move within about an hour, as the provider applies it on its own clock.
56
+ # While numbers cannot be bound to agents, a request with `agent_id` is refused
57
+ # with `502` before any number is obtained or anything is written; send
58
+ # `callback_url` instead.
59
+ #
50
60
  # Your first voice number becomes the line app-originated calls are placed from
51
61
  # when a voice token names no number; send `default_for_app_calls: true` to give
52
62
  # that role to another number. A number you turned off earlier is turned back on,
@@ -59,12 +69,14 @@ module Sentdm
59
69
  # With `sandbox: true` the request is validated and a simulated number reported
60
70
  # with `202`; nothing is written and no number is bought.
61
71
  #
62
- # @overload create(callback_url:, area_code: nil, default_for_app_calls: nil, number: nil, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
72
+ # @overload create(agent_id: nil, area_code: nil, callback_url: nil, default_for_app_calls: nil, number: nil, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
63
73
  #
64
- # @param callback_url [String] Body param: Where Sent asks what to do with each call on this number: an absolut
74
+ # @param agent_id [String, nil] Body param: One of your voice agents (GET /v3/voice/agents), such as
65
75
  #
66
76
  # @param area_code [String, nil] Body param: The US area code a new number should be in, as 212. Only for a reque
67
77
  #
78
+ # @param callback_url [String, nil] Body param: Where Sent asks what to do with each call on this number: an absolut
79
+ #
68
80
  # @param default_for_app_calls [Boolean, nil] Body param: Make this the line app-originated calls are placed from when a voice
69
81
  #
70
82
  # @param number [String, nil] Body param: One of your phone numbers, in E.164 format. Leave the field out enti
@@ -80,7 +92,7 @@ module Sentdm
80
92
  # @return [Sentdm::Models::Channels::APIResponseOfVoiceNumberCreated]
81
93
  #
82
94
  # @see Sentdm::Models::Channels::VoiceCreateParams
83
- def create(params)
95
+ def create(params = {})
84
96
  parsed, options = Sentdm::Channels::VoiceCreateParams.dump_request(params)
85
97
  header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
86
98
  @client.request(
@@ -136,18 +148,27 @@ module Sentdm
136
148
  #
137
149
  # ## What it changes
138
150
  #
139
- # | Body | Effect |
140
- # | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
141
- # | `"status": "ACTIVE"` | turns calls on again for a number you turned off; the callback URL and the secret it had are kept |
142
- # | `"status": "INACTIVE"` | turns calls off; the callback URL and the secret stay on the number |
143
- # | `"default_for_app_calls": true` | makes this the line app-originated calls are placed from when a voice token names no number |
144
- # | `"callback_url": "https://example.com/voice"` | replaces where Sent asks what to do with each call on the number; the signing secret is kept, and a number that was waiting for its first URL is turned on |
145
- # | key omitted | left exactly as it is |
151
+ # | Body | Effect |
152
+ # | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
153
+ # | `"status": "ACTIVE"` | turns calls on again for a number you turned off; the callback URL and the secret it had are kept |
154
+ # | `"status": "INACTIVE"` | turns calls off; the callback URL and the secret stay on the number |
155
+ # | `"default_for_app_calls": true` | makes this the line app-originated calls are placed from when a voice token names no number |
156
+ # | `"callback_url": "https://example.com/voice"` | replaces where Sent asks what to do with each call on the number; the signing secret and the status are kept |
157
+ # | `"agent_id": "agent_…"` | one of your voice agents answers calls to the number, within about an hour of the change (the provider applies the move on its own clock, and `routes_to` reads `agent` as soon as it has recorded it); it wins over `callback_url` for calls to the number, and calls your app places from it still follow your app. `routes_to` reads `agent_pending` while the number is still being moved to the agent |
158
+ # | `"agent_id": null` | unbinds the agent, so `callback_url` answers calls to the number again |
159
+ # | key omitted | left exactly as it is |
146
160
  #
147
161
  # `status` is matched ignoring case. Any combination is accepted:
148
162
  # `status: "ACTIVE"` with `default_for_app_calls: true` turns a number on as the
149
- # new default, and a `callback_url` sent with either status is written too. A body
150
- # that names none of the three is refused.
163
+ # new default, and a `callback_url` sent with either status is written too.
164
+ # `agent_id` is applied first, so a refusal to move the number to or from the
165
+ # agent leaves everything as it was, and the `409` and `400` refusals below are
166
+ # decided before anything is written, so they leave everything as it was too. A
167
+ # body that names none of them is refused.
168
+ #
169
+ # A number can be on without a callback URL: calls placed from your app then
170
+ # connect straight to the number or user they dial, and calls to the number are
171
+ # declined.
151
172
  #
152
173
  # ## What it will refuse
153
174
  #
@@ -162,13 +183,12 @@ module Sentdm
162
183
  # **Making an inactive number the default is `400`.** Send `status: "ACTIVE"` in
163
184
  # the same call.
164
185
  #
165
- # A number added without a `callback_url` is `INACTIVE` for that one reason, so
166
- # sending it a `callback_url` turns it on by itself, and it becomes your default
167
- # line if you have no other active voice number. A number you turned off while it
168
- # had a URL stays off.
186
+ # **A number you never turned voice on for is `404`**, and so is an `agent_id`
187
+ # that is not one of your agents. Add the number with `POST /v3/channels/voice`.
169
188
  #
170
- # **A number you never turned voice on for is `404`.** Add it with
171
- # `POST /v3/channels/voice`.
189
+ # **`502` means the number could not be moved to or from the agent**, or an
190
+ # `agent_id` was sent while numbers cannot be bound to agents; nothing was
191
+ # written.
172
192
  #
173
193
  # The number is the E.164 value in the path with the plus sign URL-encoded
174
194
  # (`%2B`).
@@ -177,10 +197,12 @@ module Sentdm
177
197
  # stored number and the number is reported with `200` as it would read after the
178
198
  # change.
179
199
  #
180
- # @overload update(number, callback_url: nil, default_for_app_calls: nil, sandbox: nil, status: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
200
+ # @overload update(number, agent_id: nil, callback_url: nil, default_for_app_calls: nil, sandbox: nil, status: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
181
201
  #
182
202
  # @param number [String] Path param: The number in E.164 format with the plus sign URL-encoded, e.g. %2B1
183
203
  #
204
+ # @param agent_id [String, nil] Body param: One of your voice agents, such as agent_9f2ab000-0000-4000-8000-0000
205
+ #
184
206
  # @param callback_url [String, nil] Body param: A new callback URL for the number, active or not: an absolute HTTP o
185
207
  #
186
208
  # @param default_for_app_calls [Boolean, nil] Body param: true makes this the line app-originated calls are placed from when a
@@ -244,48 +266,6 @@ module Sentdm
244
266
  )
245
267
  end
246
268
 
247
- # Some parameter documentations has been truncated, see
248
- # {Sentdm::Models::Channels::VoiceCreateTokenParams} for more details.
249
- #
250
- # Mints a short-lived token for one of your app users. Call this from your backend
251
- # and return the token to your app, which passes it to the voice client SDK to
252
- # register. The identity is bound to the given number, or to your default app-call
253
- # number when omitted, and calls placed by that identity are routed through the
254
- # bound number. Minting again re-binds the identity, so an identity can move
255
- # between numbers.
256
- #
257
- # @overload create_token(identity: nil, number: nil, sandbox: nil, ttl: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
258
- #
259
- # @param identity [String] Body param: Your identifier for the app user, such as an agent or account id. Le
260
- #
261
- # @param number [String, nil] Body param: One of your voice-enabled phone numbers in E.164 format. Calls place
262
- #
263
- # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
264
- #
265
- # @param ttl [Integer, nil] Body param: Token lifetime in seconds. Defaults to 600 and cannot exceed 3600.
266
- #
267
- # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
268
- #
269
- # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
270
- #
271
- # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
272
- #
273
- # @return [Sentdm::Models::Channels::APIResponseOfVoiceToken]
274
- #
275
- # @see Sentdm::Models::Channels::VoiceCreateTokenParams
276
- def create_token(params = {})
277
- parsed, options = Sentdm::Channels::VoiceCreateTokenParams.dump_request(params)
278
- header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
279
- @client.request(
280
- method: :post,
281
- path: "v3/channels/voice/tokens",
282
- headers: parsed.slice(*header_params.keys).transform_keys(header_params),
283
- body: parsed.except(*header_params.keys),
284
- model: Sentdm::Channels::APIResponseOfVoiceToken,
285
- options: options
286
- )
287
- end
288
-
289
269
  # Some parameter documentations has been truncated, see
290
270
  # {Sentdm::Models::Channels::VoiceRotateSecretParams} for more details.
291
271
  #
@@ -12,8 +12,8 @@ module Sentdm
12
12
  # number**: each number you hold can carry phone calls on its own
13
13
  # (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do
14
14
  # with its calls, one of them is the default line for calls placed from your app,
15
- # and voice tokens are minted under `POST /v3/channels/voice/tokens`. Read your
16
- # voice numbers with `GET /v3/channels/voice` and change one with
15
+ # and voice tokens are minted with `POST /v3/voice/tokens`. Read your voice
16
+ # numbers with `GET /v3/channels/voice` and change one with
17
17
  # `PATCH /v3/channels/voice/{number}`.
18
18
  #
19
19
  # ## Compliance lives on the market
@@ -66,8 +66,9 @@ module Sentdm
66
66
  # which models a profile's markets, compliance, brand, campaigns and billing
67
67
  # explicitly.
68
68
  #
69
- # Updates an existing campaign under the brand of the specified profile. Cannot
70
- # update campaigns that have already been submitted to TCR.
69
+ # Updates an existing campaign under the brand of the specified profile. Once the
70
+ # campaign has been submitted to TCR its volume can no longer move between low
71
+ # volume (under 2,000 messages a day) and high volume.
71
72
  #
72
73
  # @overload update(campaign_id, profile_id:, campaign:, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
73
74
  #
@@ -0,0 +1,319 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Resources
5
+ class Voice
6
+ # Phone calls from the numbers you hold, driven by your own callback URL.
7
+ #
8
+ # `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
9
+ # asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
10
+ # short-lived token that lets a user of your app place and receive calls as that
11
+ # number. When a call arrives or a caller presses a key, a signed question is
12
+ # POSTed to the callback URL and the answer decides the call;
13
+ # `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
14
+ # before a real call reaches it, and
15
+ # `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
16
+ # The call events themselves (`call.completed` and the rest) arrive through your
17
+ # webhooks.
18
+ #
19
+ # Every call is a record under `/v3/voice/calls`: read it, list its recordings
20
+ # once one is ready, hang it up, start or stop recording, and add, mute or remove
21
+ # conference participants while it is live. A leg to a phone number runs for at
22
+ # most what your balance affords at the destination's rate.
23
+ #
24
+ # **Voice agents.** `POST /v3/voice/agents` creates an agent that answers calls
25
+ # through the Sent Voice Gateway: `session_type` says whether Sent carries the
26
+ # call as text (speech recognised and spoken for the agent) or as audio,
27
+ # `websocket_url` is where the gateway dials the agent for each call (leave it out
28
+ # and the agent dials in with your API key), and `tools`, `transfer_targets`,
29
+ # `fallback` and `limits` say what it may do on a call. The agent's
30
+ # `signing_secret` is shown on create and on
31
+ # `POST /v3/voice/agents/{id}/rotate-secret` only. Voices and languages for text
32
+ # sessions come from `GET /v3/voice/voices`. A number takes calls to an agent once
33
+ # it is bound to it on `/v3/channels/voice`.
34
+ class Agents
35
+ # Some parameter documentations has been truncated, see
36
+ # {Sentdm::Models::Voice::AgentCreateParams} for more details.
37
+ #
38
+ # Creates an agent that answers phone calls through the Sent Voice Gateway.
39
+ # `session_type` says whether Sent carries the call as text (the caller's speech
40
+ # recognised for the agent, the agent's text spoken) or as audio. With
41
+ # `websocket_url` the gateway dials your agent for each call and signs the
42
+ # handshake with the `signing_secret` this response returns; without it, your
43
+ # agent dials in with your API key and this agent's `id`.
44
+ #
45
+ # `tools`, `transfer_targets`, `fallback` and `limits` say what the agent may do
46
+ # on a call. Voices and languages for text sessions come from
47
+ # `GET /v3/voice/voices`. Calls reach the agent once a number is bound to it on
48
+ # `/v3/channels/voice`.
49
+ #
50
+ # `signing_secret` is shown here and on `POST /v3/voice/agents/{id}/rotate-secret`
51
+ # only; store it now. With `sandbox: true` the request is validated and the agent
52
+ # reported with `202`; nothing is written.
53
+ #
54
+ # @overload create(audio: nil, fallback: nil, greeting: nil, limits: nil, name: nil, sandbox: nil, session_type: nil, speech: nil, tools: nil, transcripts: nil, transfer_targets: nil, websocket_url: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
55
+ #
56
+ # @param audio [Sentdm::Models::Voice::VoiceAgentAudioSpec, nil] Body param: Audio sessions only: the sound format.
57
+ #
58
+ # @param fallback [Sentdm::Models::Voice::VoiceAgentPartySpec, nil] Body param: Who takes the call when the agent cannot: a phone number (kind: numb
59
+ #
60
+ # @param greeting [String, nil] Body param: Text sessions only: what the caller hears as soon as the call is ans
61
+ #
62
+ # @param limits [Sentdm::Models::Voice::VoiceAgentLimitsSpec, nil] Body param
63
+ #
64
+ # @param name [String, nil] Body param: A name for your own reference, 1 to 100 characters.
65
+ #
66
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
67
+ #
68
+ # @param session_type [String, nil] Body param: text: Sent turns the caller's speech into text and the agent's text
69
+ #
70
+ # @param speech [Sentdm::Models::Voice::VoiceAgentSpeechSpec, nil] Body param: Text sessions only: how the caller is spoken to and listened to.
71
+ #
72
+ # @param tools [Array<String>, nil] Body param: What the agent may do to the call: any of transfer, hangup, send_dtm
73
+ #
74
+ # @param transcripts [Sentdm::Models::Voice::VoiceAgentTranscriptsSpec, nil] Body param
75
+ #
76
+ # @param transfer_targets [Array<Sentdm::Models::Voice::VoiceAgentPartySpec>, nil] Body param: Where the agent may transfer a call to, up to 20 parties: a phone nu
77
+ #
78
+ # @param websocket_url [String, nil] Body param: Where the gateway connects to the agent for each call: an absolute w
79
+ #
80
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
81
+ #
82
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
83
+ #
84
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
85
+ #
86
+ # @return [Sentdm::Models::Voice::APIResponseOfVoiceAgent]
87
+ #
88
+ # @see Sentdm::Models::Voice::AgentCreateParams
89
+ def create(params = {})
90
+ parsed, options = Sentdm::Voice::AgentCreateParams.dump_request(params)
91
+ header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
92
+ @client.request(
93
+ method: :post,
94
+ path: "v3/voice/agents",
95
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
96
+ body: parsed.except(*header_params.keys),
97
+ model: Sentdm::Voice::APIResponseOfVoiceAgent,
98
+ options: options
99
+ )
100
+ end
101
+
102
+ # Some parameter documentations has been truncated, see
103
+ # {Sentdm::Models::Voice::AgentRetrieveParams} for more details.
104
+ #
105
+ # The agent as stored, without its signing secret.
106
+ #
107
+ # @overload retrieve(id, x_profile_id: nil, request_options: {})
108
+ #
109
+ # @param id [String] The agent id, such as agent_9f2ab000-0000-4000-8000-000000000001
110
+ #
111
+ # @param x_profile_id [String] Profile UUID to scope the request to a child profile. Only organization API keys
112
+ #
113
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
114
+ #
115
+ # @return [Sentdm::Models::Voice::APIResponseOfVoiceAgent]
116
+ #
117
+ # @see Sentdm::Models::Voice::AgentRetrieveParams
118
+ def retrieve(id, params = {})
119
+ parsed, options = Sentdm::Voice::AgentRetrieveParams.dump_request(params)
120
+ @client.request(
121
+ method: :get,
122
+ path: ["v3/voice/agents/%1$s", id],
123
+ headers: parsed.transform_keys(x_profile_id: "x-profile-id"),
124
+ model: Sentdm::Voice::APIResponseOfVoiceAgent,
125
+ options: options
126
+ )
127
+ end
128
+
129
+ # Some parameter documentations has been truncated, see
130
+ # {Sentdm::Models::Voice::AgentUpdateParams} for more details.
131
+ #
132
+ # Changes the fields you name and answers with the agent as stored, the same shape
133
+ # `GET` returns.
134
+ #
135
+ # A key left out is left alone. A key sent as `null` clears an optional field
136
+ # (`websocket_url` makes the agent dial in, `greeting` and `fallback` go,
137
+ # `speech`, `audio`, `tools`, `limits` and `transcripts` return to their
138
+ # defaults). A key sent with a value replaces that field whole: send the whole
139
+ # `limits` object, not one of its keys. Changing `session_type` drops `speech`,
140
+ # `audio` and `greeting` unless the body sends them, since the other type cannot
141
+ # carry them. The result is checked like a new agent, and a body that changes
142
+ # nothing is `400`.
143
+ #
144
+ # With `sandbox: true` nothing is written: the request is validated against the
145
+ # stored agent and the agent is reported with `200` as it would read after the
146
+ # change.
147
+ #
148
+ # @overload update(id, audio: nil, fallback: nil, greeting: nil, limits: nil, name: nil, sandbox: nil, session_type: nil, speech: nil, tools: nil, transcripts: nil, transfer_targets: nil, websocket_url: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
149
+ #
150
+ # @param id [String] Path param: The agent id, such as agent_9f2ab000-0000-4000-8000-000000000001
151
+ #
152
+ # @param audio [Sentdm::Models::Voice::VoiceAgentAudioSpec, nil] Body param: Audio sessions: { sample_rate }; null restores the default.
153
+ #
154
+ # @param fallback [Sentdm::Models::Voice::VoiceAgentPartySpec, nil] Body param: A new fallback party, or null for none.
155
+ #
156
+ # @param greeting [String, nil] Body param: A new greeting, or null for none.
157
+ #
158
+ # @param limits [Sentdm::Models::Voice::VoiceAgentLimitsSpec, nil] Body param: The whole limits object; null restores the defaults.
159
+ #
160
+ # @param name [String] Body param: A new name, 1 to 100 characters.
161
+ #
162
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
163
+ #
164
+ # @param session_type [String] Body param: text or audio. Changing it drops the settings the other type cannot
165
+ #
166
+ # @param speech [Sentdm::Models::Voice::VoiceAgentSpeechSpec, nil] Body param: Text sessions: { setting, voice, language }, replaced whole; null re
167
+ #
168
+ # @param tools [Array<String>, nil] Body param: The whole list of tools; null restores the default.
169
+ #
170
+ # @param transcripts [Sentdm::Models::Voice::VoiceAgentTranscriptsSpec, nil] Body param: The whole transcripts object; null restores the defaults.
171
+ #
172
+ # @param transfer_targets [Array<Sentdm::Models::Voice::VoiceAgentPartySpec>, nil] Body param: The whole list of parties; null clears it.
173
+ #
174
+ # @param websocket_url [String, nil] Body param: A new wss:// URL, or null for an agent that dials in.
175
+ #
176
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
177
+ #
178
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
179
+ #
180
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
181
+ #
182
+ # @return [Sentdm::Models::Voice::APIResponseOfVoiceAgent]
183
+ #
184
+ # @see Sentdm::Models::Voice::AgentUpdateParams
185
+ def update(id, params = {})
186
+ parsed, options = Sentdm::Voice::AgentUpdateParams.dump_request(params)
187
+ header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
188
+ @client.request(
189
+ method: :patch,
190
+ path: ["v3/voice/agents/%1$s", id],
191
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
192
+ body: parsed.except(*header_params.keys),
193
+ model: Sentdm::Voice::APIResponseOfVoiceAgent,
194
+ options: options
195
+ )
196
+ end
197
+
198
+ # Some parameter documentations has been truncated, see
199
+ # {Sentdm::Models::Voice::AgentListParams} for more details.
200
+ #
201
+ # Your voice agents, newest first. `page` and `page_size` (1 to 100, default 20)
202
+ # page the list. Signing secrets are never listed.
203
+ #
204
+ # @overload list(page: nil, page_size: nil, x_profile_id: nil, request_options: {})
205
+ #
206
+ # @param page [Integer] Query param: Page number, from 1
207
+ #
208
+ # @param page_size [Integer] Query param
209
+ #
210
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
211
+ #
212
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
213
+ #
214
+ # @return [Sentdm::Internal::VoiceAgentsPage<Sentdm::Models::Voice::VoiceAgent>]
215
+ #
216
+ # @see Sentdm::Models::Voice::AgentListParams
217
+ def list(params = {})
218
+ query_params = [:page, :page_size]
219
+ parsed, options = Sentdm::Voice::AgentListParams.dump_request(params)
220
+ query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
221
+ @client.request(
222
+ method: :get,
223
+ path: "v3/voice/agents",
224
+ query: query,
225
+ headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
226
+ page: Sentdm::Internal::VoiceAgentsPage,
227
+ model: Sentdm::Voice::VoiceAgent,
228
+ options: options
229
+ )
230
+ end
231
+
232
+ # Some parameter documentations has been truncated, see
233
+ # {Sentdm::Models::Voice::AgentDeleteParams} for more details.
234
+ #
235
+ # Removes the agent. Calls it already took keep their `agent_id`.
236
+ #
237
+ # An agent that one of your voice numbers routes to, or that another of your
238
+ # agents lists in `transfer_targets`, is not deleted: the answer is `409` with a
239
+ # message naming those numbers and agents. Unbind the numbers
240
+ # (`PATCH /v3/channels/voice/{number}` with `"agent_id": null`), take the agent
241
+ # out of the others' `transfer_targets` or delete them, and try again.
242
+ #
243
+ # With `sandbox: true` nothing is written: the agent is looked up and the answer
244
+ # is the one a real delete would give.
245
+ #
246
+ # @overload delete(id, sandbox: nil, x_profile_id: nil, request_options: {})
247
+ #
248
+ # @param id [String] Path param: The agent id, such as agent_9f2ab000-0000-4000-8000-000000000001
249
+ #
250
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
251
+ #
252
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
253
+ #
254
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
255
+ #
256
+ # @return [nil]
257
+ #
258
+ # @see Sentdm::Models::Voice::AgentDeleteParams
259
+ def delete(id, params = {})
260
+ parsed, options = Sentdm::Voice::AgentDeleteParams.dump_request(params)
261
+ header_params = {x_profile_id: "x-profile-id"}
262
+ @client.request(
263
+ method: :delete,
264
+ path: ["v3/voice/agents/%1$s", id],
265
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
266
+ body: parsed.except(*header_params.keys),
267
+ model: NilClass,
268
+ options: options
269
+ )
270
+ end
271
+
272
+ # Some parameter documentations has been truncated, see
273
+ # {Sentdm::Models::Voice::AgentRotateSecretParams} for more details.
274
+ #
275
+ # Generates a new `signing_secret` for the agent and returns it. The previous
276
+ # secret stops signing immediately, so update your agent before the next call
277
+ # reaches it.
278
+ #
279
+ # With `sandbox: true` a secret is generated and returned with `202`, and nothing
280
+ # is written.
281
+ #
282
+ # @overload rotate_secret(id, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
283
+ #
284
+ # @param id [String] Path param: The agent id, such as agent_9f2ab000-0000-4000-8000-000000000001
285
+ #
286
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
287
+ #
288
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
289
+ #
290
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
291
+ #
292
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
293
+ #
294
+ # @return [Sentdm::Models::Voice::APIResponseOfVoiceAgentSecret]
295
+ #
296
+ # @see Sentdm::Models::Voice::AgentRotateSecretParams
297
+ def rotate_secret(id, params = {})
298
+ parsed, options = Sentdm::Voice::AgentRotateSecretParams.dump_request(params)
299
+ header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
300
+ @client.request(
301
+ method: :post,
302
+ path: ["v3/voice/agents/%1$s/rotate-secret", id],
303
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
304
+ body: parsed.except(*header_params.keys),
305
+ model: Sentdm::Voice::APIResponseOfVoiceAgentSecret,
306
+ options: options
307
+ )
308
+ end
309
+
310
+ # @api private
311
+ #
312
+ # @param client [Sentdm::Client]
313
+ def initialize(client:)
314
+ @client = client
315
+ end
316
+ end
317
+ end
318
+ end
319
+ end