sentdm 0.39.0 → 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 (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/internal/voice_agents_page.rb +115 -0
  5. data/lib/sentdm/models/call_event.rb +8 -6
  6. data/lib/sentdm/models/call_event_payload.rb +25 -6
  7. data/lib/sentdm/models/channels/voice_create_params.rb +23 -11
  8. data/lib/sentdm/models/channels/voice_number.rb +23 -1
  9. data/lib/sentdm/models/channels/voice_update_params.rb +12 -1
  10. data/lib/sentdm/models/voice/agent_create_params.rb +142 -0
  11. data/lib/sentdm/models/voice/agent_delete_params.rb +28 -0
  12. data/lib/sentdm/models/voice/agent_list_params.rb +38 -0
  13. data/lib/sentdm/models/voice/agent_retrieve_params.rb +28 -0
  14. data/lib/sentdm/models/voice/agent_rotate_secret_params.rb +34 -0
  15. data/lib/sentdm/models/voice/agent_update_params.rb +141 -0
  16. data/lib/sentdm/models/voice/api_response_of_voice_agent.rb +51 -0
  17. data/lib/sentdm/models/voice/api_response_of_voice_agent_secret.rb +45 -0
  18. data/lib/sentdm/models/voice/api_response_of_voice_agents_list.rb +48 -0
  19. data/lib/sentdm/models/voice/api_response_of_voice_catalogue.rb +49 -0
  20. data/lib/sentdm/models/voice/call.rb +97 -5
  21. data/lib/sentdm/models/voice/call_list_params.rb +19 -1
  22. data/lib/sentdm/models/voice/catalogue_list_params.rb +22 -0
  23. data/lib/sentdm/models/voice/voice_agent.rb +138 -0
  24. data/lib/sentdm/models/voice/voice_agent_audio.rb +19 -0
  25. data/lib/sentdm/models/voice/voice_agent_audio_spec.rb +20 -0
  26. data/lib/sentdm/models/voice/voice_agent_limits.rb +31 -0
  27. data/lib/sentdm/models/voice/voice_agent_limits_spec.rb +40 -0
  28. data/lib/sentdm/models/voice/voice_agent_party.rb +25 -0
  29. data/lib/sentdm/models/voice/voice_agent_party_spec.rb +28 -0
  30. data/lib/sentdm/models/voice/voice_agent_secret.rb +27 -0
  31. data/lib/sentdm/models/voice/voice_agent_speech.rb +31 -0
  32. data/lib/sentdm/models/voice/voice_agent_speech_spec.rb +40 -0
  33. data/lib/sentdm/models/voice/voice_agent_transcripts.rb +25 -0
  34. data/lib/sentdm/models/voice/voice_agent_transcripts_spec.rb +32 -0
  35. data/lib/sentdm/models/voice/voice_agents_list.rb +30 -0
  36. data/lib/sentdm/models/voice/voice_catalogue.rb +30 -0
  37. data/lib/sentdm/models/voice/voice_catalogue_voice.rb +43 -0
  38. data/lib/sentdm/models/webhook_create_params.rb +31 -5
  39. data/lib/sentdm/models/webhook_response.rb +66 -4
  40. data/lib/sentdm/models/webhook_update_params.rb +15 -3
  41. data/lib/sentdm/resources/channels/voice.rb +38 -15
  42. data/lib/sentdm/resources/profiles/campaigns.rb +3 -2
  43. data/lib/sentdm/resources/voice/agents.rb +319 -0
  44. data/lib/sentdm/resources/voice/calls/participants.rb +11 -0
  45. data/lib/sentdm/resources/voice/calls.rb +44 -13
  46. data/lib/sentdm/resources/voice/catalogue.rb +71 -0
  47. data/lib/sentdm/resources/voice/tokens.rb +11 -0
  48. data/lib/sentdm/resources/voice.rb +86 -0
  49. data/lib/sentdm/resources/webhooks.rb +43 -15
  50. data/lib/sentdm/version.rb +1 -1
  51. data/lib/sentdm.rb +29 -0
  52. data/rbi/sentdm/internal/voice_agents_page.rbi +71 -0
  53. data/rbi/sentdm/models/call_event.rbi +14 -10
  54. data/rbi/sentdm/models/call_event_payload.rbi +28 -5
  55. data/rbi/sentdm/models/channels/voice_create_params.rbi +33 -17
  56. data/rbi/sentdm/models/channels/voice_number.rbi +31 -0
  57. data/rbi/sentdm/models/channels/voice_update_params.rbi +14 -0
  58. data/rbi/sentdm/models/voice/agent_create_params.rbi +215 -0
  59. data/rbi/sentdm/models/voice/agent_delete_params.rbi +48 -0
  60. data/rbi/sentdm/models/voice/agent_list_params.rbi +66 -0
  61. data/rbi/sentdm/models/voice/agent_retrieve_params.rbi +48 -0
  62. data/rbi/sentdm/models/voice/agent_rotate_secret_params.rbi +64 -0
  63. data/rbi/sentdm/models/voice/agent_update_params.rbi +211 -0
  64. data/rbi/sentdm/models/voice/api_response_of_voice_agent.rbi +85 -0
  65. data/rbi/sentdm/models/voice/api_response_of_voice_agent_secret.rbi +81 -0
  66. data/rbi/sentdm/models/voice/api_response_of_voice_agents_list.rbi +83 -0
  67. data/rbi/sentdm/models/voice/api_response_of_voice_catalogue.rbi +83 -0
  68. data/rbi/sentdm/models/voice/call.rbi +141 -8
  69. data/rbi/sentdm/models/voice/call_list_params.rbi +20 -0
  70. data/rbi/sentdm/models/voice/catalogue_list_params.rbi +40 -0
  71. data/rbi/sentdm/models/voice/voice_agent.rbi +196 -0
  72. data/rbi/sentdm/models/voice/voice_agent_audio.rbi +30 -0
  73. data/rbi/sentdm/models/voice/voice_agent_audio_spec.rbi +33 -0
  74. data/rbi/sentdm/models/voice/voice_agent_limits.rbi +57 -0
  75. data/rbi/sentdm/models/voice/voice_agent_limits_spec.rbi +62 -0
  76. data/rbi/sentdm/models/voice/voice_agent_party.rbi +36 -0
  77. data/rbi/sentdm/models/voice/voice_agent_party_spec.rbi +45 -0
  78. data/rbi/sentdm/models/voice/voice_agent_secret.rbi +37 -0
  79. data/rbi/sentdm/models/voice/voice_agent_speech.rbi +48 -0
  80. data/rbi/sentdm/models/voice/voice_agent_speech_spec.rbi +62 -0
  81. data/rbi/sentdm/models/voice/voice_agent_transcripts.rbi +43 -0
  82. data/rbi/sentdm/models/voice/voice_agent_transcripts_spec.rbi +51 -0
  83. data/rbi/sentdm/models/voice/voice_agents_list.rbi +55 -0
  84. data/rbi/sentdm/models/voice/voice_catalogue.rbi +59 -0
  85. data/rbi/sentdm/models/voice/voice_catalogue_voice.rbi +75 -0
  86. data/rbi/sentdm/models/webhook_create_params.rbi +41 -3
  87. data/rbi/sentdm/models/webhook_response.rbi +112 -3
  88. data/rbi/sentdm/models/webhook_update_params.rbi +18 -3
  89. data/rbi/sentdm/resources/channels/voice.rbi +52 -19
  90. data/rbi/sentdm/resources/profiles/campaigns.rbi +3 -2
  91. data/rbi/sentdm/resources/voice/agents.rbi +316 -0
  92. data/rbi/sentdm/resources/voice/calls/participants.rbi +11 -0
  93. data/rbi/sentdm/resources/voice/calls.rbi +46 -11
  94. data/rbi/sentdm/resources/voice/catalogue.rbi +59 -0
  95. data/rbi/sentdm/resources/voice/tokens.rbi +11 -0
  96. data/rbi/sentdm/resources/voice.rbi +84 -0
  97. data/rbi/sentdm/resources/webhooks.rbi +56 -16
  98. data/sig/sentdm/internal/voice_agents_page.rbs +41 -0
  99. data/sig/sentdm/models/call_event_payload.rbs +12 -0
  100. data/sig/sentdm/models/channels/voice_create_params.rbs +9 -4
  101. data/sig/sentdm/models/channels/voice_number.rbs +12 -0
  102. data/sig/sentdm/models/channels/voice_update_params.rbs +5 -0
  103. data/sig/sentdm/models/voice/agent_create_params.rbs +99 -0
  104. data/sig/sentdm/models/voice/agent_delete_params.rbs +34 -0
  105. data/sig/sentdm/models/voice/agent_list_params.rbs +40 -0
  106. data/sig/sentdm/models/voice/agent_retrieve_params.rbs +32 -0
  107. data/sig/sentdm/models/voice/agent_rotate_secret_params.rbs +40 -0
  108. data/sig/sentdm/models/voice/agent_update_params.rbs +108 -0
  109. data/sig/sentdm/models/voice/api_response_of_voice_agent.rbs +41 -0
  110. data/sig/sentdm/models/voice/api_response_of_voice_agent_secret.rbs +41 -0
  111. data/sig/sentdm/models/voice/api_response_of_voice_agents_list.rbs +41 -0
  112. data/sig/sentdm/models/voice/api_response_of_voice_catalogue.rbs +41 -0
  113. data/sig/sentdm/models/voice/call.rbs +65 -0
  114. data/sig/sentdm/models/voice/call_list_params.rbs +10 -0
  115. data/sig/sentdm/models/voice/catalogue_list_params.rbs +27 -0
  116. data/sig/sentdm/models/voice/voice_agent.rbs +116 -0
  117. data/sig/sentdm/models/voice/voice_agent_audio.rbs +19 -0
  118. data/sig/sentdm/models/voice/voice_agent_audio_spec.rbs +17 -0
  119. data/sig/sentdm/models/voice/voice_agent_limits.rbs +38 -0
  120. data/sig/sentdm/models/voice/voice_agent_limits_spec.rbs +34 -0
  121. data/sig/sentdm/models/voice/voice_agent_party.rbs +23 -0
  122. data/sig/sentdm/models/voice/voice_agent_party_spec.rbs +19 -0
  123. data/sig/sentdm/models/voice/voice_agent_secret.rbs +19 -0
  124. data/sig/sentdm/models/voice/voice_agent_speech.rbs +32 -0
  125. data/sig/sentdm/models/voice/voice_agent_speech_spec.rbs +26 -0
  126. data/sig/sentdm/models/voice/voice_agent_transcripts.rbs +23 -0
  127. data/sig/sentdm/models/voice/voice_agent_transcripts_spec.rbs +20 -0
  128. data/sig/sentdm/models/voice/voice_agents_list.rbs +35 -0
  129. data/sig/sentdm/models/voice/voice_catalogue.rbs +35 -0
  130. data/sig/sentdm/models/voice/voice_catalogue_voice.rbs +42 -0
  131. data/sig/sentdm/models/webhook_create_params.rbs +12 -0
  132. data/sig/sentdm/models/webhook_response.rbs +46 -3
  133. data/sig/sentdm/models/webhook_update_params.rbs +5 -0
  134. data/sig/sentdm/resources/channels/voice.rbs +3 -1
  135. data/sig/sentdm/resources/voice/agents.rbs +74 -0
  136. data/sig/sentdm/resources/voice/calls.rbs +2 -0
  137. data/sig/sentdm/resources/voice/catalogue.rbs +14 -0
  138. data/sig/sentdm/resources/voice.rbs +4 -0
  139. data/sig/sentdm/resources/webhooks.rbs +3 -0
  140. metadata +89 -2
@@ -0,0 +1,316 @@
1
+ # typed: strong
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
+ # Creates an agent that answers phone calls through the Sent Voice Gateway.
36
+ # `session_type` says whether Sent carries the call as text (the caller's speech
37
+ # recognised for the agent, the agent's text spoken) or as audio. With
38
+ # `websocket_url` the gateway dials your agent for each call and signs the
39
+ # handshake with the `signing_secret` this response returns; without it, your
40
+ # agent dials in with your API key and this agent's `id`.
41
+ #
42
+ # `tools`, `transfer_targets`, `fallback` and `limits` say what the agent may do
43
+ # on a call. Voices and languages for text sessions come from
44
+ # `GET /v3/voice/voices`. Calls reach the agent once a number is bound to it on
45
+ # `/v3/channels/voice`.
46
+ #
47
+ # `signing_secret` is shown here and on `POST /v3/voice/agents/{id}/rotate-secret`
48
+ # only; store it now. With `sandbox: true` the request is validated and the agent
49
+ # reported with `202`; nothing is written.
50
+ sig do
51
+ params(
52
+ audio: T.nilable(Sentdm::Voice::VoiceAgentAudioSpec::OrHash),
53
+ fallback: T.nilable(Sentdm::Voice::VoiceAgentPartySpec::OrHash),
54
+ greeting: T.nilable(String),
55
+ limits: T.nilable(Sentdm::Voice::VoiceAgentLimitsSpec::OrHash),
56
+ name: T.nilable(String),
57
+ sandbox: T::Boolean,
58
+ session_type: T.nilable(String),
59
+ speech: T.nilable(Sentdm::Voice::VoiceAgentSpeechSpec::OrHash),
60
+ tools: T.nilable(T::Array[String]),
61
+ transcripts:
62
+ T.nilable(Sentdm::Voice::VoiceAgentTranscriptsSpec::OrHash),
63
+ transfer_targets:
64
+ T.nilable(T::Array[Sentdm::Voice::VoiceAgentPartySpec::OrHash]),
65
+ websocket_url: T.nilable(String),
66
+ idempotency_key: String,
67
+ x_profile_id: String,
68
+ request_options: Sentdm::RequestOptions::OrHash
69
+ ).returns(Sentdm::Voice::APIResponseOfVoiceAgent)
70
+ end
71
+ def create(
72
+ # Body param: Audio sessions only: the sound format.
73
+ audio: nil,
74
+ # Body param: Who takes the call when the agent cannot: a phone number (kind:
75
+ # number). Omit it and such a call hangs up.
76
+ fallback: nil,
77
+ # Body param: Text sessions only: what the caller hears as soon as the call is
78
+ # answered, before the agent's first turn. 1 to 4,096 characters. Omit it and the
79
+ # agent speaks first.
80
+ greeting: nil,
81
+ # Body param
82
+ limits: nil,
83
+ # Body param: A name for your own reference, 1 to 100 characters.
84
+ name: nil,
85
+ # Body param: Sandbox flag - when true, the operation is simulated without side
86
+ # effects Useful for testing integrations without actual execution
87
+ sandbox: nil,
88
+ # Body param: text: Sent turns the caller's speech into text and the agent's text
89
+ # into speech, so the agent exchanges text frames. audio: the agent receives and
90
+ # sends the sound itself.
91
+ session_type: nil,
92
+ # Body param: Text sessions only: how the caller is spoken to and listened to.
93
+ speech: nil,
94
+ # Body param: What the agent may do to the call: any of transfer, hangup,
95
+ # send_dtmf and hold. Default ["hangup"]. transfer needs at least one
96
+ # transfer_targets entry.
97
+ tools: nil,
98
+ # Body param
99
+ transcripts: nil,
100
+ # Body param: Where the agent may transfer a call to, up to 20 parties: a phone
101
+ # number (kind: number, E.164), one of your app users (kind: user, the identity)
102
+ # or another of your agents (kind: agent, its id). The agent can only transfer to
103
+ # a party listed here.
104
+ transfer_targets: nil,
105
+ # Body param: Where the gateway connects to the agent for each call: an absolute
106
+ # wss:// URL on a public host, at most 2,048 characters. The handshake is signed
107
+ # with the agent's signing_secret. Leave it out and the agent dials in instead,
108
+ # connecting to the gateway with your API key.
109
+ websocket_url: nil,
110
+ # Header param: Unique key to ensure idempotent request processing. Must be 1-255
111
+ # alphanumeric characters, hyphens, or underscores. Responses are cached for 24
112
+ # hours per key per customer.
113
+ idempotency_key: nil,
114
+ # Header param: Profile UUID to scope the request to a child profile. Only
115
+ # organization API keys can use this header. The profile must belong to the
116
+ # calling organization.
117
+ x_profile_id: nil,
118
+ request_options: {}
119
+ )
120
+ end
121
+
122
+ # The agent as stored, without its signing secret.
123
+ sig do
124
+ params(
125
+ id: String,
126
+ x_profile_id: String,
127
+ request_options: Sentdm::RequestOptions::OrHash
128
+ ).returns(Sentdm::Voice::APIResponseOfVoiceAgent)
129
+ end
130
+ def retrieve(
131
+ # The agent id, such as agent_9f2ab000-0000-4000-8000-000000000001
132
+ id,
133
+ # Profile UUID to scope the request to a child profile. Only organization API keys
134
+ # can use this header. The profile must belong to the calling organization.
135
+ x_profile_id: nil,
136
+ request_options: {}
137
+ )
138
+ end
139
+
140
+ # Changes the fields you name and answers with the agent as stored, the same shape
141
+ # `GET` returns.
142
+ #
143
+ # A key left out is left alone. A key sent as `null` clears an optional field
144
+ # (`websocket_url` makes the agent dial in, `greeting` and `fallback` go,
145
+ # `speech`, `audio`, `tools`, `limits` and `transcripts` return to their
146
+ # defaults). A key sent with a value replaces that field whole: send the whole
147
+ # `limits` object, not one of its keys. Changing `session_type` drops `speech`,
148
+ # `audio` and `greeting` unless the body sends them, since the other type cannot
149
+ # carry them. The result is checked like a new agent, and a body that changes
150
+ # nothing is `400`.
151
+ #
152
+ # With `sandbox: true` nothing is written: the request is validated against the
153
+ # stored agent and the agent is reported with `200` as it would read after the
154
+ # change.
155
+ sig do
156
+ params(
157
+ id: String,
158
+ audio: T.nilable(Sentdm::Voice::VoiceAgentAudioSpec::OrHash),
159
+ fallback: T.nilable(Sentdm::Voice::VoiceAgentPartySpec::OrHash),
160
+ greeting: T.nilable(String),
161
+ limits: T.nilable(Sentdm::Voice::VoiceAgentLimitsSpec::OrHash),
162
+ name: String,
163
+ sandbox: T::Boolean,
164
+ session_type: String,
165
+ speech: T.nilable(Sentdm::Voice::VoiceAgentSpeechSpec::OrHash),
166
+ tools: T.nilable(T::Array[String]),
167
+ transcripts:
168
+ T.nilable(Sentdm::Voice::VoiceAgentTranscriptsSpec::OrHash),
169
+ transfer_targets:
170
+ T.nilable(T::Array[Sentdm::Voice::VoiceAgentPartySpec::OrHash]),
171
+ websocket_url: T.nilable(String),
172
+ idempotency_key: String,
173
+ x_profile_id: String,
174
+ request_options: Sentdm::RequestOptions::OrHash
175
+ ).returns(Sentdm::Voice::APIResponseOfVoiceAgent)
176
+ end
177
+ def update(
178
+ # Path param: The agent id, such as agent_9f2ab000-0000-4000-8000-000000000001
179
+ id,
180
+ # Body param: Audio sessions: { sample_rate }; null restores the default.
181
+ audio: nil,
182
+ # Body param: A new fallback party, or null for none.
183
+ fallback: nil,
184
+ # Body param: A new greeting, or null for none.
185
+ greeting: nil,
186
+ # Body param: The whole limits object; null restores the defaults.
187
+ limits: nil,
188
+ # Body param: A new name, 1 to 100 characters.
189
+ name: nil,
190
+ # Body param: Sandbox flag - when true, the operation is simulated without side
191
+ # effects Useful for testing integrations without actual execution
192
+ sandbox: nil,
193
+ # Body param: text or audio. Changing it drops the settings the other type cannot
194
+ # have (speech, audio, greeting) unless the body sends them.
195
+ session_type: nil,
196
+ # Body param: Text sessions: { setting, voice, language }, replaced whole; null
197
+ # restores the defaults.
198
+ speech: nil,
199
+ # Body param: The whole list of tools; null restores the default.
200
+ tools: nil,
201
+ # Body param: The whole transcripts object; null restores the defaults.
202
+ transcripts: nil,
203
+ # Body param: The whole list of parties; null clears it.
204
+ transfer_targets: nil,
205
+ # Body param: A new wss:// URL, or null for an agent that dials in.
206
+ websocket_url: nil,
207
+ # Header param: Unique key to ensure idempotent request processing. Must be 1-255
208
+ # alphanumeric characters, hyphens, or underscores. Responses are cached for 24
209
+ # hours per key per customer.
210
+ idempotency_key: nil,
211
+ # Header param: Profile UUID to scope the request to a child profile. Only
212
+ # organization API keys can use this header. The profile must belong to the
213
+ # calling organization.
214
+ x_profile_id: nil,
215
+ request_options: {}
216
+ )
217
+ end
218
+
219
+ # Your voice agents, newest first. `page` and `page_size` (1 to 100, default 20)
220
+ # page the list. Signing secrets are never listed.
221
+ sig do
222
+ params(
223
+ page: Integer,
224
+ page_size: Integer,
225
+ x_profile_id: String,
226
+ request_options: Sentdm::RequestOptions::OrHash
227
+ ).returns(
228
+ Sentdm::Internal::VoiceAgentsPage[Sentdm::Voice::VoiceAgent]
229
+ )
230
+ end
231
+ def list(
232
+ # Query param: Page number, from 1
233
+ page: nil,
234
+ # Query param
235
+ page_size: nil,
236
+ # Header param: Profile UUID to scope the request to a child profile. Only
237
+ # organization API keys can use this header. The profile must belong to the
238
+ # calling organization.
239
+ x_profile_id: nil,
240
+ request_options: {}
241
+ )
242
+ end
243
+
244
+ # Removes the agent. Calls it already took keep their `agent_id`.
245
+ #
246
+ # An agent that one of your voice numbers routes to, or that another of your
247
+ # agents lists in `transfer_targets`, is not deleted: the answer is `409` with a
248
+ # message naming those numbers and agents. Unbind the numbers
249
+ # (`PATCH /v3/channels/voice/{number}` with `"agent_id": null`), take the agent
250
+ # out of the others' `transfer_targets` or delete them, and try again.
251
+ #
252
+ # With `sandbox: true` nothing is written: the agent is looked up and the answer
253
+ # is the one a real delete would give.
254
+ sig do
255
+ params(
256
+ id: String,
257
+ sandbox: T::Boolean,
258
+ x_profile_id: String,
259
+ request_options: Sentdm::RequestOptions::OrHash
260
+ ).void
261
+ end
262
+ def delete(
263
+ # Path param: The agent id, such as agent_9f2ab000-0000-4000-8000-000000000001
264
+ id,
265
+ # Body param: Sandbox flag - when true, the operation is simulated without side
266
+ # effects Useful for testing integrations without actual execution
267
+ sandbox: nil,
268
+ # Header param: Profile UUID to scope the request to a child profile. Only
269
+ # organization API keys can use this header. The profile must belong to the
270
+ # calling organization.
271
+ x_profile_id: nil,
272
+ request_options: {}
273
+ )
274
+ end
275
+
276
+ # Generates a new `signing_secret` for the agent and returns it. The previous
277
+ # secret stops signing immediately, so update your agent before the next call
278
+ # reaches it.
279
+ #
280
+ # With `sandbox: true` a secret is generated and returned with `202`, and nothing
281
+ # is written.
282
+ sig do
283
+ params(
284
+ id: String,
285
+ sandbox: T::Boolean,
286
+ idempotency_key: String,
287
+ x_profile_id: String,
288
+ request_options: Sentdm::RequestOptions::OrHash
289
+ ).returns(Sentdm::Voice::APIResponseOfVoiceAgentSecret)
290
+ end
291
+ def rotate_secret(
292
+ # Path param: The agent id, such as agent_9f2ab000-0000-4000-8000-000000000001
293
+ id,
294
+ # Body param: Sandbox flag - when true, the operation is simulated without side
295
+ # effects Useful for testing integrations without actual execution
296
+ sandbox: nil,
297
+ # Header param: Unique key to ensure idempotent request processing. Must be 1-255
298
+ # alphanumeric characters, hyphens, or underscores. Responses are cached for 24
299
+ # hours per key per customer.
300
+ idempotency_key: nil,
301
+ # Header param: Profile UUID to scope the request to a child profile. Only
302
+ # organization API keys can use this header. The profile must belong to the
303
+ # calling organization.
304
+ x_profile_id: nil,
305
+ request_options: {}
306
+ )
307
+ end
308
+
309
+ # @api private
310
+ sig { params(client: Sentdm::Client).returns(T.attached_class) }
311
+ def self.new(client:)
312
+ end
313
+ end
314
+ end
315
+ end
316
+ end
@@ -21,6 +21,17 @@ module Sentdm
21
21
  # once one is ready, hang it up, start or stop recording, and add, mute or remove
22
22
  # conference participants while it is live. A leg to a phone number runs for at
23
23
  # most what your balance affords at the destination's rate.
24
+ #
25
+ # **Voice agents.** `POST /v3/voice/agents` creates an agent that answers calls
26
+ # through the Sent Voice Gateway: `session_type` says whether Sent carries the
27
+ # call as text (speech recognised and spoken for the agent) or as audio,
28
+ # `websocket_url` is where the gateway dials the agent for each call (leave it out
29
+ # and the agent dials in with your API key), and `tools`, `transfer_targets`,
30
+ # `fallback` and `limits` say what it may do on a call. The agent's
31
+ # `signing_secret` is shown on create and on
32
+ # `POST /v3/voice/agents/{id}/rotate-secret` only. Voices and languages for text
33
+ # sessions come from `GET /v3/voice/voices`. A number takes calls to an agent once
34
+ # it is bound to it on `/v3/channels/voice`.
24
35
  class Participants
25
36
  # Mutes or unmutes one participant of the conference room a live call is in, named
26
37
  # by the participant's own call id from the participants list: send muted true to
@@ -20,6 +20,17 @@ module Sentdm
20
20
  # once one is ready, hang it up, start or stop recording, and add, mute or remove
21
21
  # conference participants while it is live. A leg to a phone number runs for at
22
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`.
23
34
  class Calls
24
35
  # Phone calls from the numbers you hold, driven by your own callback URL.
25
36
  #
@@ -38,12 +49,25 @@ module Sentdm
38
49
  # once one is ready, hang it up, start or stop recording, and add, mute or remove
39
50
  # conference participants while it is live. A leg to a phone number runs for at
40
51
  # most what your balance affords at the destination's rate.
52
+ #
53
+ # **Voice agents.** `POST /v3/voice/agents` creates an agent that answers calls
54
+ # through the Sent Voice Gateway: `session_type` says whether Sent carries the
55
+ # call as text (speech recognised and spoken for the agent) or as audio,
56
+ # `websocket_url` is where the gateway dials the agent for each call (leave it out
57
+ # and the agent dials in with your API key), and `tools`, `transfer_targets`,
58
+ # `fallback` and `limits` say what it may do on a call. The agent's
59
+ # `signing_secret` is shown on create and on
60
+ # `POST /v3/voice/agents/{id}/rotate-secret` only. Voices and languages for text
61
+ # sessions come from `GET /v3/voice/voices`. A number takes calls to an agent once
62
+ # it is bound to it on `/v3/channels/voice`.
41
63
  sig { returns(Sentdm::Resources::Voice::Calls::Participants) }
42
64
  attr_reader :participants
43
65
 
44
- # Retrieves one of your calls by id: the parties, the owning number, the current
45
- # status with its failure reason, duration, price, recording availability, and a
46
- # timeline of when the call entered each status.
66
+ # Retrieves one of your calls by id: the parties, the owning number, the phone
67
+ # number the call was connected to and the caller id it showed, the current status
68
+ # with its failure reason, duration, price with the billed legs and what each
69
+ # cost, recording availability, and a timeline of when the call entered each
70
+ # status.
47
71
  sig do
48
72
  params(
49
73
  id: String,
@@ -63,13 +87,18 @@ module Sentdm
63
87
  end
64
88
 
65
89
  # Retrieves a paginated list of your calls, most recent first. Filter by
66
- # direction, status, the owning number, and the time the call started (from and to
67
- # are inclusive). Use the call webhooks for real-time updates; this list is for
68
- # looking calls up afterwards.
90
+ # direction, status, the owning number, the mode (inapp, or agent for calls your
91
+ # voice agents answered), the agent that answered, and the time the call started
92
+ # (from and to are inclusive). Each call carries the phone number it was connected
93
+ # to, the caller id it showed, and the billed legs with what each cost. Use the
94
+ # call webhooks for real-time updates; this list is for looking calls up
95
+ # afterwards.
69
96
  sig do
70
97
  params(
98
+ agent_id: T.nilable(String),
71
99
  direction: T.nilable(String),
72
100
  from: T.nilable(Time),
101
+ mode: T.nilable(String),
73
102
  number: T.nilable(String),
74
103
  page: Integer,
75
104
  page_size: Integer,
@@ -80,11 +109,17 @@ module Sentdm
80
109
  ).returns(Sentdm::Internal::CallsPage[Sentdm::Voice::Call])
81
110
  end
82
111
  def list(
112
+ # Query param: Optional filter on the voice agent that answered the call, such as
113
+ # agent_9f2ab000-0000-4000-8000-000000000001
114
+ agent_id: nil,
83
115
  # Query param: Optional direction filter: outbound for calls placed from your app,
84
116
  # inbound for calls to one of your numbers
85
117
  direction: nil,
86
118
  # Query param: Only calls started at or after this time (ISO 8601)
87
119
  from: nil,
120
+ # Query param: Optional mode filter: inapp for calls routed by your number's
121
+ # callback URL, agent for calls one of your voice agents answered
122
+ mode: nil,
88
123
  # Query param: Optional filter on the number that owns the call, one of your
89
124
  # voice-enabled numbers in E.164 format
90
125
  number: nil,
@@ -108,8 +143,8 @@ module Sentdm
108
143
  # Ends one of your live calls. The call then ends the way any other call does once
109
144
  # the disconnect is reported: an answered call as COMPLETED with call.completed, a
110
145
  # call still ringing as NO_ANSWER, REJECTED or FAILED with call.failed. A call
111
- # that has already ended answers 409, and so does a call with no phone leg, such
112
- # as one between two app users.
146
+ # that has already ended answers 409, as do a call with no phone leg, such as one
147
+ # between two app users, and a call one of your voice agents answers.
113
148
  sig do
114
149
  params(
115
150
  id: String,
@@ -165,9 +200,9 @@ module Sentdm
165
200
 
166
201
  # Starts or stops recording one of your live calls. Use start to begin recording
167
202
  # mid-call, or stop to end a recording, whether it was started here or by a
168
- # connect answer with record set. A call that has already ended answers 409, and
169
- # so does a call with no phone leg, such as one between two app users, which can't
170
- # be recorded.
203
+ # connect answer with record set. A call that has already ended answers 409, as do
204
+ # a call with no phone leg, such as one between two app users, and a call one of
205
+ # your voice agents answers, neither of which can be recorded this way.
171
206
  sig do
172
207
  params(
173
208
  id: String,
@@ -0,0 +1,59 @@
1
+ # typed: strong
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 Catalogue
35
+ # The names a voice agent's `speech.voice` and `speech.language` accept, with the
36
+ # default marked. The list grows as voices are added; a name is never removed
37
+ # without notice.
38
+ sig do
39
+ params(
40
+ x_profile_id: String,
41
+ request_options: Sentdm::RequestOptions::OrHash
42
+ ).returns(Sentdm::Voice::APIResponseOfVoiceCatalogue)
43
+ end
44
+ def list(
45
+ # Profile UUID to scope the request to a child profile. Only organization API keys
46
+ # can use this header. The profile must belong to the calling organization.
47
+ x_profile_id: nil,
48
+ request_options: {}
49
+ )
50
+ end
51
+
52
+ # @api private
53
+ sig { params(client: Sentdm::Client).returns(T.attached_class) }
54
+ def self.new(client:)
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -20,6 +20,17 @@ module Sentdm
20
20
  # once one is ready, hang it up, start or stop recording, and add, mute or remove
21
21
  # conference participants while it is live. A leg to a phone number runs for at
22
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`.
23
34
  class Tokens
24
35
  # Mints a short-lived token for one of your app users. Call this from your backend
25
36
  # and return the token to your app, which passes it to the voice client SDK to
@@ -20,6 +20,17 @@ module Sentdm
20
20
  # once one is ready, hang it up, start or stop recording, and add, mute or remove
21
21
  # conference participants while it is live. A leg to a phone number runs for at
22
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`.
23
34
  sig { returns(Sentdm::Resources::Voice::Calls) }
24
35
  attr_reader :calls
25
36
 
@@ -40,9 +51,82 @@ module Sentdm
40
51
  # once one is ready, hang it up, start or stop recording, and add, mute or remove
41
52
  # conference participants while it is live. A leg to a phone number runs for at
42
53
  # most what your balance affords at the destination's rate.
54
+ #
55
+ # **Voice agents.** `POST /v3/voice/agents` creates an agent that answers calls
56
+ # through the Sent Voice Gateway: `session_type` says whether Sent carries the
57
+ # call as text (speech recognised and spoken for the agent) or as audio,
58
+ # `websocket_url` is where the gateway dials the agent for each call (leave it out
59
+ # and the agent dials in with your API key), and `tools`, `transfer_targets`,
60
+ # `fallback` and `limits` say what it may do on a call. The agent's
61
+ # `signing_secret` is shown on create and on
62
+ # `POST /v3/voice/agents/{id}/rotate-secret` only. Voices and languages for text
63
+ # sessions come from `GET /v3/voice/voices`. A number takes calls to an agent once
64
+ # it is bound to it on `/v3/channels/voice`.
43
65
  sig { returns(Sentdm::Resources::Voice::Tokens) }
44
66
  attr_reader :tokens
45
67
 
68
+ # Phone calls from the numbers you hold, driven by your own callback URL.
69
+ #
70
+ # `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
71
+ # asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
72
+ # short-lived token that lets a user of your app place and receive calls as that
73
+ # number. When a call arrives or a caller presses a key, a signed question is
74
+ # POSTed to the callback URL and the answer decides the call;
75
+ # `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
76
+ # before a real call reaches it, and
77
+ # `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
78
+ # The call events themselves (`call.completed` and the rest) arrive through your
79
+ # webhooks.
80
+ #
81
+ # Every call is a record under `/v3/voice/calls`: read it, list its recordings
82
+ # once one is ready, hang it up, start or stop recording, and add, mute or remove
83
+ # conference participants while it is live. A leg to a phone number runs for at
84
+ # most what your balance affords at the destination's rate.
85
+ #
86
+ # **Voice agents.** `POST /v3/voice/agents` creates an agent that answers calls
87
+ # through the Sent Voice Gateway: `session_type` says whether Sent carries the
88
+ # call as text (speech recognised and spoken for the agent) or as audio,
89
+ # `websocket_url` is where the gateway dials the agent for each call (leave it out
90
+ # and the agent dials in with your API key), and `tools`, `transfer_targets`,
91
+ # `fallback` and `limits` say what it may do on a call. The agent's
92
+ # `signing_secret` is shown on create and on
93
+ # `POST /v3/voice/agents/{id}/rotate-secret` only. Voices and languages for text
94
+ # sessions come from `GET /v3/voice/voices`. A number takes calls to an agent once
95
+ # it is bound to it on `/v3/channels/voice`.
96
+ sig { returns(Sentdm::Resources::Voice::Agents) }
97
+ attr_reader :agents
98
+
99
+ # Phone calls from the numbers you hold, driven by your own callback URL.
100
+ #
101
+ # `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
102
+ # asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
103
+ # short-lived token that lets a user of your app place and receive calls as that
104
+ # number. When a call arrives or a caller presses a key, a signed question is
105
+ # POSTed to the callback URL and the answer decides the call;
106
+ # `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
107
+ # before a real call reaches it, and
108
+ # `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
109
+ # The call events themselves (`call.completed` and the rest) arrive through your
110
+ # webhooks.
111
+ #
112
+ # Every call is a record under `/v3/voice/calls`: read it, list its recordings
113
+ # once one is ready, hang it up, start or stop recording, and add, mute or remove
114
+ # conference participants while it is live. A leg to a phone number runs for at
115
+ # most what your balance affords at the destination's rate.
116
+ #
117
+ # **Voice agents.** `POST /v3/voice/agents` creates an agent that answers calls
118
+ # through the Sent Voice Gateway: `session_type` says whether Sent carries the
119
+ # call as text (speech recognised and spoken for the agent) or as audio,
120
+ # `websocket_url` is where the gateway dials the agent for each call (leave it out
121
+ # and the agent dials in with your API key), and `tools`, `transfer_targets`,
122
+ # `fallback` and `limits` say what it may do on a call. The agent's
123
+ # `signing_secret` is shown on create and on
124
+ # `POST /v3/voice/agents/{id}/rotate-secret` only. Voices and languages for text
125
+ # sessions come from `GET /v3/voice/voices`. A number takes calls to an agent once
126
+ # it is bound to it on `/v3/channels/voice`.
127
+ sig { returns(Sentdm::Resources::Voice::Catalogue) }
128
+ attr_reader :catalogue
129
+
46
130
  # @api private
47
131
  sig { params(client: Sentdm::Client).returns(T.attached_class) }
48
132
  def self.new(client:)