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
@@ -15,11 +15,28 @@ module Sentdm
15
15
  sig { params(id: String).void }
16
16
  attr_writer :id
17
17
 
18
+ # The voice agent that answered the call, such as
19
+ # agent_9f2ab000-0000-4000-8000-000000000001. Null for an inapp call
20
+ sig { returns(T.nilable(String)) }
21
+ attr_accessor :agent_id
22
+
18
23
  # When the call was answered (UTC). Null until then, and always null for a call
19
24
  # between two of your app users
20
25
  sig { returns(T.nilable(Time)) }
21
26
  attr_accessor :answered_at
22
27
 
28
+ # The caller id shown on the phone leg, in E.164 format: the one your answer
29
+ # chose, or the owning number when it chose none. Null for a call with no phone
30
+ # leg
31
+ sig { returns(T.nilable(String)) }
32
+ attr_accessor :caller_id_used
33
+
34
+ # The phone number the call was connected to, in E.164 format: the number your
35
+ # answer dialed, or the fallback number a call to one of your voice agents
36
+ # reached. Null when the call was not connected to a phone number
37
+ sig { returns(T.nilable(String)) }
38
+ attr_accessor :connected_number
39
+
23
40
  # outbound for a call placed from your app, inbound for a call to one of your
24
41
  # numbers
25
42
  sig { returns(T.nilable(String)) }
@@ -37,9 +54,9 @@ module Sentdm
37
54
  attr_accessor :ended_at
38
55
 
39
56
  # Why the call did not complete: callback_timeout, invalid_answer,
40
- # insufficient_balance, destination_blocked, callback_not_configured, rejected or
41
- # no_answer. Null while the call is live, when it completed, and when it failed
42
- # without a recorded reason
57
+ # insufficient_balance, destination_blocked, callback_not_configured, rejected,
58
+ # no_answer, or for an agent call agent_busy or agent_unreachable. Null while the
59
+ # call is live, when it completed, and when it failed without a recorded reason
43
60
  sig { returns(T.nilable(String)) }
44
61
  attr_accessor :failure_reason
45
62
 
@@ -50,8 +67,16 @@ module Sentdm
50
67
  sig { params(from: Sentdm::Voice::CallParty::OrHash).void }
51
68
  attr_writer :from
52
69
 
70
+ # The legs the price covers, one entry per billed leg, each with its own cost: a
71
+ # call your answer connected to a phone number ran the caller's leg to your number
72
+ # and the leg to the connected number at once, and both are billed. Null until the
73
+ # call has been priced
74
+ sig { returns(T.nilable(T::Array[Sentdm::Voice::Call::Leg])) }
75
+ attr_accessor :legs
76
+
53
77
  # The calling mode: inapp for a call between people in your app and phone numbers,
54
- # routed by your number's callback URL
78
+ # routed by your number's callback URL; agent for a call one of your voice agents
79
+ # answered
55
80
  sig { returns(T.nilable(String)) }
56
81
  attr_reader :mode
57
82
 
@@ -107,12 +132,16 @@ module Sentdm
107
132
  sig do
108
133
  params(
109
134
  id: String,
135
+ agent_id: T.nilable(String),
110
136
  answered_at: T.nilable(Time),
137
+ caller_id_used: T.nilable(String),
138
+ connected_number: T.nilable(String),
111
139
  direction: String,
112
140
  duration_seconds: T.nilable(Integer),
113
141
  ended_at: T.nilable(Time),
114
142
  failure_reason: T.nilable(String),
115
143
  from: Sentdm::Voice::CallParty::OrHash,
144
+ legs: T.nilable(T::Array[Sentdm::Voice::Call::Leg::OrHash]),
116
145
  mode: String,
117
146
  number: String,
118
147
  price: T.nilable(Float),
@@ -128,9 +157,20 @@ module Sentdm
128
157
  # The call id, the same one carried by the call.request question and every call
129
158
  # webhook
130
159
  id: nil,
160
+ # The voice agent that answered the call, such as
161
+ # agent_9f2ab000-0000-4000-8000-000000000001. Null for an inapp call
162
+ agent_id: nil,
131
163
  # When the call was answered (UTC). Null until then, and always null for a call
132
164
  # between two of your app users
133
165
  answered_at: nil,
166
+ # The caller id shown on the phone leg, in E.164 format: the one your answer
167
+ # chose, or the owning number when it chose none. Null for a call with no phone
168
+ # leg
169
+ caller_id_used: nil,
170
+ # The phone number the call was connected to, in E.164 format: the number your
171
+ # answer dialed, or the fallback number a call to one of your voice agents
172
+ # reached. Null when the call was not connected to a phone number
173
+ connected_number: nil,
134
174
  # outbound for a call placed from your app, inbound for a call to one of your
135
175
  # numbers
136
176
  direction: nil,
@@ -139,14 +179,20 @@ module Sentdm
139
179
  # When the call ended (UTC). Null while the call is live
140
180
  ended_at: nil,
141
181
  # Why the call did not complete: callback_timeout, invalid_answer,
142
- # insufficient_balance, destination_blocked, callback_not_configured, rejected or
143
- # no_answer. Null while the call is live, when it completed, and when it failed
144
- # without a recorded reason
182
+ # insufficient_balance, destination_blocked, callback_not_configured, rejected,
183
+ # no_answer, or for an agent call agent_busy or agent_unreachable. Null while the
184
+ # call is live, when it completed, and when it failed without a recorded reason
145
185
  failure_reason: nil,
146
186
  # One end of a call
147
187
  from: nil,
188
+ # The legs the price covers, one entry per billed leg, each with its own cost: a
189
+ # call your answer connected to a phone number ran the caller's leg to your number
190
+ # and the leg to the connected number at once, and both are billed. Null until the
191
+ # call has been priced
192
+ legs: nil,
148
193
  # The calling mode: inapp for a call between people in your app and phone numbers,
149
- # routed by your number's callback URL
194
+ # routed by your number's callback URL; agent for a call one of your voice agents
195
+ # answered
150
196
  mode: nil,
151
197
  # Your number that owns the call, in E.164 format: the dialed number for an
152
198
  # inbound call, the caller's bound number for a call placed from your app
@@ -171,12 +217,16 @@ module Sentdm
171
217
  override.returns(
172
218
  {
173
219
  id: String,
220
+ agent_id: T.nilable(String),
174
221
  answered_at: T.nilable(Time),
222
+ caller_id_used: T.nilable(String),
223
+ connected_number: T.nilable(String),
175
224
  direction: String,
176
225
  duration_seconds: T.nilable(Integer),
177
226
  ended_at: T.nilable(Time),
178
227
  failure_reason: T.nilable(String),
179
228
  from: Sentdm::Voice::CallParty,
229
+ legs: T.nilable(T::Array[Sentdm::Voice::Call::Leg]),
180
230
  mode: String,
181
231
  number: String,
182
232
  price: T.nilable(Float),
@@ -190,6 +240,89 @@ module Sentdm
190
240
  end
191
241
  def to_hash
192
242
  end
243
+
244
+ class Leg < Sentdm::Internal::Type::BaseModel
245
+ OrHash =
246
+ T.type_alias do
247
+ T.any(Sentdm::Voice::Call::Leg, Sentdm::Internal::AnyHash)
248
+ end
249
+
250
+ # The whole minutes the leg was billed for
251
+ sig { returns(T.nilable(Integer)) }
252
+ attr_reader :billed_minutes
253
+
254
+ sig { params(billed_minutes: Integer).void }
255
+ attr_writer :billed_minutes
256
+
257
+ # What the leg cost, in the same unit as the call's price
258
+ sig { returns(T.nilable(Float)) }
259
+ attr_reader :cost
260
+
261
+ sig { params(cost: Float).void }
262
+ attr_writer :cost
263
+
264
+ # The currency of the cost: USD
265
+ sig { returns(T.nilable(String)) }
266
+ attr_reader :currency
267
+
268
+ sig { params(currency: String).void }
269
+ attr_writer :currency
270
+
271
+ # inbound for the caller's leg to your number, outbound for a leg placed on your
272
+ # behalf
273
+ sig { returns(T.nilable(String)) }
274
+ attr_reader :direction
275
+
276
+ sig { params(direction: String).void }
277
+ attr_writer :direction
278
+
279
+ # The phone number the leg reached, in E.164 format: your number for the inbound
280
+ # leg, the number dialed for an outbound one. Null for a leg to one of your app
281
+ # users or a room
282
+ sig { returns(T.nilable(String)) }
283
+ attr_accessor :number
284
+
285
+ # One leg of a call the price covers
286
+ sig do
287
+ params(
288
+ billed_minutes: Integer,
289
+ cost: Float,
290
+ currency: String,
291
+ direction: String,
292
+ number: T.nilable(String)
293
+ ).returns(T.attached_class)
294
+ end
295
+ def self.new(
296
+ # The whole minutes the leg was billed for
297
+ billed_minutes: nil,
298
+ # What the leg cost, in the same unit as the call's price
299
+ cost: nil,
300
+ # The currency of the cost: USD
301
+ currency: nil,
302
+ # inbound for the caller's leg to your number, outbound for a leg placed on your
303
+ # behalf
304
+ direction: nil,
305
+ # The phone number the leg reached, in E.164 format: your number for the inbound
306
+ # leg, the number dialed for an outbound one. Null for a leg to one of your app
307
+ # users or a room
308
+ number: nil
309
+ )
310
+ end
311
+
312
+ sig do
313
+ override.returns(
314
+ {
315
+ billed_minutes: Integer,
316
+ cost: Float,
317
+ currency: String,
318
+ direction: String,
319
+ number: T.nilable(String)
320
+ }
321
+ )
322
+ end
323
+ def to_hash
324
+ end
325
+ end
193
326
  end
194
327
  end
195
328
  end
@@ -12,6 +12,11 @@ module Sentdm
12
12
  T.any(Sentdm::Voice::CallListParams, Sentdm::Internal::AnyHash)
13
13
  end
14
14
 
15
+ # Optional filter on the voice agent that answered the call, such as
16
+ # agent_9f2ab000-0000-4000-8000-000000000001
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :agent_id
19
+
15
20
  # Optional direction filter: outbound for calls placed from your app, inbound for
16
21
  # calls to one of your numbers
17
22
  sig { returns(T.nilable(String)) }
@@ -21,6 +26,11 @@ module Sentdm
21
26
  sig { returns(T.nilable(Time)) }
22
27
  attr_accessor :from
23
28
 
29
+ # Optional mode filter: inapp for calls routed by your number's callback URL,
30
+ # agent for calls one of your voice agents answered
31
+ sig { returns(T.nilable(String)) }
32
+ attr_accessor :mode
33
+
24
34
  # Optional filter on the number that owns the call, one of your voice-enabled
25
35
  # numbers in E.164 format
26
36
  sig { returns(T.nilable(String)) }
@@ -57,8 +67,10 @@ module Sentdm
57
67
 
58
68
  sig do
59
69
  params(
70
+ agent_id: T.nilable(String),
60
71
  direction: T.nilable(String),
61
72
  from: T.nilable(Time),
73
+ mode: T.nilable(String),
62
74
  number: T.nilable(String),
63
75
  page: Integer,
64
76
  page_size: Integer,
@@ -69,11 +81,17 @@ module Sentdm
69
81
  ).returns(T.attached_class)
70
82
  end
71
83
  def self.new(
84
+ # Optional filter on the voice agent that answered the call, such as
85
+ # agent_9f2ab000-0000-4000-8000-000000000001
86
+ agent_id: nil,
72
87
  # Optional direction filter: outbound for calls placed from your app, inbound for
73
88
  # calls to one of your numbers
74
89
  direction: nil,
75
90
  # Only calls started at or after this time (ISO 8601)
76
91
  from: nil,
92
+ # Optional mode filter: inapp for calls routed by your number's callback URL,
93
+ # agent for calls one of your voice agents answered
94
+ mode: nil,
77
95
  # Optional filter on the number that owns the call, one of your voice-enabled
78
96
  # numbers in E.164 format
79
97
  number: nil,
@@ -94,8 +112,10 @@ module Sentdm
94
112
  sig do
95
113
  override.returns(
96
114
  {
115
+ agent_id: T.nilable(String),
97
116
  direction: T.nilable(String),
98
117
  from: T.nilable(Time),
118
+ mode: T.nilable(String),
99
119
  number: T.nilable(String),
100
120
  page: Integer,
101
121
  page_size: Integer,
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Voice
6
+ class CatalogueListParams < Sentdm::Internal::Type::BaseModel
7
+ extend Sentdm::Internal::Type::RequestParameters::Converter
8
+ include Sentdm::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(Sentdm::Voice::CatalogueListParams, Sentdm::Internal::AnyHash)
13
+ end
14
+
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :x_profile_id
17
+
18
+ sig { params(x_profile_id: String).void }
19
+ attr_writer :x_profile_id
20
+
21
+ sig do
22
+ params(
23
+ x_profile_id: String,
24
+ request_options: Sentdm::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(x_profile_id: nil, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { x_profile_id: String, request_options: Sentdm::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,196 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ VoiceAgent = Voice::VoiceAgent
6
+
7
+ module Voice
8
+ class VoiceAgent < Sentdm::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Sentdm::Voice::VoiceAgent, Sentdm::Internal::AnyHash)
12
+ end
13
+
14
+ # The agent's id, agent\_ and a UUID. It is also what the agent connects to the
15
+ # gateway as.
16
+ sig { returns(T.nilable(String)) }
17
+ attr_reader :id
18
+
19
+ sig { params(id: String).void }
20
+ attr_writer :id
21
+
22
+ # Audio sessions: the sample rate in use.
23
+ sig { returns(T.nilable(Sentdm::Voice::VoiceAgentAudio)) }
24
+ attr_reader :audio
25
+
26
+ sig do
27
+ params(audio: T.nilable(Sentdm::Voice::VoiceAgentAudio::OrHash)).void
28
+ end
29
+ attr_writer :audio
30
+
31
+ sig { returns(T.nilable(Time)) }
32
+ attr_reader :created_at
33
+
34
+ sig { params(created_at: Time).void }
35
+ attr_writer :created_at
36
+
37
+ sig { returns(T.nilable(Sentdm::Voice::VoiceAgentParty)) }
38
+ attr_reader :fallback
39
+
40
+ sig do
41
+ params(
42
+ fallback: T.nilable(Sentdm::Voice::VoiceAgentParty::OrHash)
43
+ ).void
44
+ end
45
+ attr_writer :fallback
46
+
47
+ sig { returns(T.nilable(String)) }
48
+ attr_accessor :greeting
49
+
50
+ sig { returns(T.nilable(Sentdm::Voice::VoiceAgentLimits)) }
51
+ attr_reader :limits
52
+
53
+ sig { params(limits: Sentdm::Voice::VoiceAgentLimits::OrHash).void }
54
+ attr_writer :limits
55
+
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :name
58
+
59
+ sig { params(name: String).void }
60
+ attr_writer :name
61
+
62
+ # text or audio.
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :session_type
65
+
66
+ sig { params(session_type: String).void }
67
+ attr_writer :session_type
68
+
69
+ # The whsec\_ secret the gateway signs its handshake to websocket_url with.
70
+ # Present on create and after a rotate-secret; absent on every other read. Store
71
+ # it now.
72
+ sig { returns(T.nilable(String)) }
73
+ attr_accessor :signing_secret
74
+
75
+ # Text sessions: the speech setting, voice and language in use.
76
+ sig { returns(T.nilable(Sentdm::Voice::VoiceAgentSpeech)) }
77
+ attr_reader :speech
78
+
79
+ sig do
80
+ params(
81
+ speech: T.nilable(Sentdm::Voice::VoiceAgentSpeech::OrHash)
82
+ ).void
83
+ end
84
+ attr_writer :speech
85
+
86
+ sig { returns(T.nilable(T::Array[String])) }
87
+ attr_reader :tools
88
+
89
+ sig { params(tools: T::Array[String]).void }
90
+ attr_writer :tools
91
+
92
+ sig { returns(T.nilable(Sentdm::Voice::VoiceAgentTranscripts)) }
93
+ attr_reader :transcripts
94
+
95
+ sig do
96
+ params(transcripts: Sentdm::Voice::VoiceAgentTranscripts::OrHash).void
97
+ end
98
+ attr_writer :transcripts
99
+
100
+ sig { returns(T.nilable(T::Array[Sentdm::Voice::VoiceAgentParty])) }
101
+ attr_reader :transfer_targets
102
+
103
+ sig do
104
+ params(
105
+ transfer_targets: T::Array[Sentdm::Voice::VoiceAgentParty::OrHash]
106
+ ).void
107
+ end
108
+ attr_writer :transfer_targets
109
+
110
+ sig { returns(T.nilable(Time)) }
111
+ attr_accessor :updated_at
112
+
113
+ # Where the gateway dials the agent; null when the agent dials in with your API
114
+ # key.
115
+ sig { returns(T.nilable(String)) }
116
+ attr_accessor :websocket_url
117
+
118
+ # A voice agent as stored: what was written with every default filled in, plus the
119
+ # signing secret the one time it is shown (on create, and on rotate). The one
120
+ # shape every read of an agent answers with, on /v3/voice/agents and on the admin
121
+ # API the dashboard uses, so the two cannot drift.
122
+ sig do
123
+ params(
124
+ id: String,
125
+ audio: T.nilable(Sentdm::Voice::VoiceAgentAudio::OrHash),
126
+ created_at: Time,
127
+ fallback: T.nilable(Sentdm::Voice::VoiceAgentParty::OrHash),
128
+ greeting: T.nilable(String),
129
+ limits: Sentdm::Voice::VoiceAgentLimits::OrHash,
130
+ name: String,
131
+ session_type: String,
132
+ signing_secret: T.nilable(String),
133
+ speech: T.nilable(Sentdm::Voice::VoiceAgentSpeech::OrHash),
134
+ tools: T::Array[String],
135
+ transcripts: Sentdm::Voice::VoiceAgentTranscripts::OrHash,
136
+ transfer_targets: T::Array[Sentdm::Voice::VoiceAgentParty::OrHash],
137
+ updated_at: T.nilable(Time),
138
+ websocket_url: T.nilable(String)
139
+ ).returns(T.attached_class)
140
+ end
141
+ def self.new(
142
+ # The agent's id, agent\_ and a UUID. It is also what the agent connects to the
143
+ # gateway as.
144
+ id: nil,
145
+ # Audio sessions: the sample rate in use.
146
+ audio: nil,
147
+ created_at: nil,
148
+ fallback: nil,
149
+ greeting: nil,
150
+ limits: nil,
151
+ name: nil,
152
+ # text or audio.
153
+ session_type: nil,
154
+ # The whsec\_ secret the gateway signs its handshake to websocket_url with.
155
+ # Present on create and after a rotate-secret; absent on every other read. Store
156
+ # it now.
157
+ signing_secret: nil,
158
+ # Text sessions: the speech setting, voice and language in use.
159
+ speech: nil,
160
+ tools: nil,
161
+ transcripts: nil,
162
+ transfer_targets: nil,
163
+ updated_at: nil,
164
+ # Where the gateway dials the agent; null when the agent dials in with your API
165
+ # key.
166
+ websocket_url: nil
167
+ )
168
+ end
169
+
170
+ sig do
171
+ override.returns(
172
+ {
173
+ id: String,
174
+ audio: T.nilable(Sentdm::Voice::VoiceAgentAudio),
175
+ created_at: Time,
176
+ fallback: T.nilable(Sentdm::Voice::VoiceAgentParty),
177
+ greeting: T.nilable(String),
178
+ limits: Sentdm::Voice::VoiceAgentLimits,
179
+ name: String,
180
+ session_type: String,
181
+ signing_secret: T.nilable(String),
182
+ speech: T.nilable(Sentdm::Voice::VoiceAgentSpeech),
183
+ tools: T::Array[String],
184
+ transcripts: Sentdm::Voice::VoiceAgentTranscripts,
185
+ transfer_targets: T::Array[Sentdm::Voice::VoiceAgentParty],
186
+ updated_at: T.nilable(Time),
187
+ websocket_url: T.nilable(String)
188
+ }
189
+ )
190
+ end
191
+ def to_hash
192
+ end
193
+ end
194
+ end
195
+ end
196
+ end
@@ -0,0 +1,30 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ VoiceAgentAudio = Voice::VoiceAgentAudio
6
+
7
+ module Voice
8
+ class VoiceAgentAudio < Sentdm::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Sentdm::Voice::VoiceAgentAudio, Sentdm::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(T.nilable(Integer)) }
15
+ attr_reader :sample_rate
16
+
17
+ sig { params(sample_rate: Integer).void }
18
+ attr_writer :sample_rate
19
+
20
+ sig { params(sample_rate: Integer).returns(T.attached_class) }
21
+ def self.new(sample_rate: nil)
22
+ end
23
+
24
+ sig { override.returns({ sample_rate: Integer }) }
25
+ def to_hash
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,33 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ VoiceAgentAudioSpec = Voice::VoiceAgentAudioSpec
6
+
7
+ module Voice
8
+ class VoiceAgentAudioSpec < Sentdm::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Sentdm::Voice::VoiceAgentAudioSpec, Sentdm::Internal::AnyHash)
12
+ end
13
+
14
+ # Samples per second of the audio exchanged: 8000, 16000 or 24000. Default 16000.
15
+ sig { returns(T.nilable(Integer)) }
16
+ attr_accessor :sample_rate
17
+
18
+ sig do
19
+ params(sample_rate: T.nilable(Integer)).returns(T.attached_class)
20
+ end
21
+ def self.new(
22
+ # Samples per second of the audio exchanged: 8000, 16000 or 24000. Default 16000.
23
+ sample_rate: nil
24
+ )
25
+ end
26
+
27
+ sig { override.returns({ sample_rate: T.nilable(Integer) }) }
28
+ def to_hash
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,57 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ VoiceAgentLimits = Voice::VoiceAgentLimits
6
+
7
+ module Voice
8
+ class VoiceAgentLimits < Sentdm::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Sentdm::Voice::VoiceAgentLimits, Sentdm::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(T.nilable(T::Array[String])) }
15
+ attr_accessor :allowed_countries
16
+
17
+ sig { returns(T.nilable(Integer)) }
18
+ attr_reader :max_call_seconds
19
+
20
+ sig { params(max_call_seconds: Integer).void }
21
+ attr_writer :max_call_seconds
22
+
23
+ sig { returns(T.nilable(Integer)) }
24
+ attr_reader :max_concurrent_calls
25
+
26
+ sig { params(max_concurrent_calls: Integer).void }
27
+ attr_writer :max_concurrent_calls
28
+
29
+ sig do
30
+ params(
31
+ allowed_countries: T.nilable(T::Array[String]),
32
+ max_call_seconds: Integer,
33
+ max_concurrent_calls: Integer
34
+ ).returns(T.attached_class)
35
+ end
36
+ def self.new(
37
+ allowed_countries: nil,
38
+ max_call_seconds: nil,
39
+ max_concurrent_calls: nil
40
+ )
41
+ end
42
+
43
+ sig do
44
+ override.returns(
45
+ {
46
+ allowed_countries: T.nilable(T::Array[String]),
47
+ max_call_seconds: Integer,
48
+ max_concurrent_calls: Integer
49
+ }
50
+ )
51
+ end
52
+ def to_hash
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end