revox 0.0.2 → 0.1.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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +63 -22
  4. data/lib/revox/client.rb +4 -0
  5. data/lib/revox/internal/type/base_model.rb +3 -3
  6. data/lib/revox/internal/util.rb +31 -0
  7. data/lib/revox/models/assistant_create_params.rb +2 -2
  8. data/lib/revox/models/assistant_delete_params.rb +7 -1
  9. data/lib/revox/models/assistant_retrieve_params.rb +7 -1
  10. data/lib/revox/models/assistant_update_params.rb +10 -3
  11. data/lib/revox/models/call_create_params.rb +2 -2
  12. data/lib/revox/models/call_create_response.rb +720 -12
  13. data/lib/revox/models/call_list_params.rb +30 -7
  14. data/lib/revox/models/call_list_response.rb +63 -1
  15. data/lib/revox/models/call_retrieve_params.rb +7 -1
  16. data/lib/revox/models/call_retrieve_response.rb +723 -12
  17. data/lib/revox/models/campaign_cancel_params.rb +20 -0
  18. data/lib/revox/models/campaign_cancel_response.rb +16 -0
  19. data/lib/revox/models/campaign_create_params.rb +174 -0
  20. data/lib/revox/models/campaign_create_response.rb +775 -0
  21. data/lib/revox/models/campaign_delete_params.rb +20 -0
  22. data/lib/revox/models/campaign_delete_response.rb +16 -0
  23. data/lib/revox/models/campaign_export_rows_params.rb +20 -0
  24. data/lib/revox/models/campaign_export_rows_response.rb +22 -0
  25. data/lib/revox/models/campaign_get_rows_params.rb +65 -0
  26. data/lib/revox/models/campaign_get_rows_response.rb +1468 -0
  27. data/lib/revox/models/campaign_list_params.rb +14 -0
  28. data/lib/revox/models/campaign_list_response.rb +771 -0
  29. data/lib/revox/models/campaign_retrieve_params.rb +20 -0
  30. data/lib/revox/models/campaign_retrieve_response.rb +776 -0
  31. data/lib/revox/models/voice_preview_params.rb +1 -9
  32. data/lib/revox/models/voice_retrieve_params.rb +7 -1
  33. data/lib/revox/models.rb +14 -0
  34. data/lib/revox/resources/assistants.rb +26 -2
  35. data/lib/revox/resources/call.rb +20 -8
  36. data/lib/revox/resources/campaigns.rb +181 -0
  37. data/lib/revox/resources/voices.rb +12 -8
  38. data/lib/revox/version.rb +1 -1
  39. data/lib/revox.rb +15 -0
  40. data/rbi/revox/client.rbi +3 -0
  41. data/rbi/revox/internal/util.rbi +20 -0
  42. data/rbi/revox/models/assistant_create_params.rbi +3 -5
  43. data/rbi/revox/models/assistant_delete_params.rbi +11 -5
  44. data/rbi/revox/models/assistant_retrieve_params.rbi +11 -5
  45. data/rbi/revox/models/assistant_update_params.rbi +9 -5
  46. data/rbi/revox/models/call_create_params.rbi +3 -5
  47. data/rbi/revox/models/call_create_response.rbi +1537 -11
  48. data/rbi/revox/models/call_list_params.rbi +53 -6
  49. data/rbi/revox/models/call_list_response.rbi +162 -0
  50. data/rbi/revox/models/call_retrieve_params.rbi +11 -5
  51. data/rbi/revox/models/call_retrieve_response.rbi +1543 -11
  52. data/rbi/revox/models/campaign_cancel_params.rbi +33 -0
  53. data/rbi/revox/models/campaign_cancel_response.rbi +23 -0
  54. data/rbi/revox/models/campaign_create_params.rbi +297 -0
  55. data/rbi/revox/models/campaign_create_response.rbi +1490 -0
  56. data/rbi/revox/models/campaign_delete_params.rbi +33 -0
  57. data/rbi/revox/models/campaign_delete_response.rbi +23 -0
  58. data/rbi/revox/models/campaign_export_rows_params.rbi +33 -0
  59. data/rbi/revox/models/campaign_export_rows_response.rbi +29 -0
  60. data/rbi/revox/models/campaign_get_rows_params.rbi +113 -0
  61. data/rbi/revox/models/campaign_get_rows_response.rbi +2981 -0
  62. data/rbi/revox/models/campaign_list_params.rbi +27 -0
  63. data/rbi/revox/models/campaign_list_response.rbi +1482 -0
  64. data/rbi/revox/models/campaign_retrieve_params.rbi +33 -0
  65. data/rbi/revox/models/campaign_retrieve_response.rbi +1495 -0
  66. data/rbi/revox/models/voice_preview_params.rbi +0 -11
  67. data/rbi/revox/models/voice_retrieve_params.rbi +6 -1
  68. data/rbi/revox/models.rbi +14 -0
  69. data/rbi/revox/resources/assistants.rbi +21 -2
  70. data/rbi/revox/resources/call.rbi +18 -6
  71. data/rbi/revox/resources/campaigns.rbi +128 -0
  72. data/rbi/revox/resources/voices.rbi +9 -7
  73. data/sig/revox/client.rbs +2 -0
  74. data/sig/revox/internal/util.rbs +10 -0
  75. data/sig/revox/models/assistant_create_params.rbs +8 -4
  76. data/sig/revox/models/assistant_delete_params.rbs +8 -3
  77. data/sig/revox/models/assistant_retrieve_params.rbs +8 -3
  78. data/sig/revox/models/assistant_update_params.rbs +13 -4
  79. data/sig/revox/models/call_create_params.rbs +8 -4
  80. data/sig/revox/models/call_create_response.rbs +615 -8
  81. data/sig/revox/models/call_list_params.rbs +42 -7
  82. data/sig/revox/models/call_list_response.rbs +57 -2
  83. data/sig/revox/models/call_retrieve_params.rbs +9 -3
  84. data/sig/revox/models/call_retrieve_response.rbs +615 -8
  85. data/sig/revox/models/campaign_cancel_params.rbs +20 -0
  86. data/sig/revox/models/campaign_cancel_response.rbs +13 -0
  87. data/sig/revox/models/campaign_create_params.rbs +149 -0
  88. data/sig/revox/models/campaign_create_response.rbs +666 -0
  89. data/sig/revox/models/campaign_delete_params.rbs +20 -0
  90. data/sig/revox/models/campaign_delete_response.rbs +13 -0
  91. data/sig/revox/models/campaign_export_rows_params.rbs +20 -0
  92. data/sig/revox/models/campaign_export_rows_response.rbs +15 -0
  93. data/sig/revox/models/campaign_get_rows_params.rbs +82 -0
  94. data/sig/revox/models/campaign_get_rows_response.rbs +1220 -0
  95. data/sig/revox/models/campaign_list_params.rbs +14 -0
  96. data/sig/revox/models/campaign_list_response.rbs +666 -0
  97. data/sig/revox/models/campaign_retrieve_params.rbs +20 -0
  98. data/sig/revox/models/campaign_retrieve_response.rbs +666 -0
  99. data/sig/revox/models/voice_preview_params.rbs +1 -8
  100. data/sig/revox/models/voice_retrieve_params.rbs +5 -1
  101. data/sig/revox/models.rbs +14 -0
  102. data/sig/revox/resources/assistants.rbs +2 -2
  103. data/sig/revox/resources/call.rbs +3 -2
  104. data/sig/revox/resources/campaigns.rbs +52 -0
  105. data/sig/revox/resources/voices.rbs +0 -1
  106. metadata +47 -2
@@ -0,0 +1,33 @@
1
+ # typed: strong
2
+
3
+ module Revox
4
+ module Models
5
+ class CampaignCancelParams < Revox::Internal::Type::BaseModel
6
+ extend Revox::Internal::Type::RequestParameters::Converter
7
+ include Revox::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Revox::CampaignCancelParams, Revox::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :id
16
+
17
+ sig do
18
+ params(
19
+ id: String,
20
+ request_options: Revox::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns({ id: String, request_options: Revox::RequestOptions })
28
+ end
29
+ def to_hash
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Revox
4
+ module Models
5
+ class CampaignCancelResponse < Revox::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Revox::Models::CampaignCancelResponse, Revox::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T::Boolean) }
12
+ attr_accessor :success
13
+
14
+ sig { params(success: T::Boolean).returns(T.attached_class) }
15
+ def self.new(success:)
16
+ end
17
+
18
+ sig { override.returns({ success: T::Boolean }) }
19
+ def to_hash
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,297 @@
1
+ # typed: strong
2
+
3
+ module Revox
4
+ module Models
5
+ class CampaignCreateParams < Revox::Internal::Type::BaseModel
6
+ extend Revox::Internal::Type::RequestParameters::Converter
7
+ include Revox::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Revox::CampaignCreateParams, Revox::Internal::AnyHash)
12
+ end
13
+
14
+ # The ID of the assistant to use
15
+ sig { returns(String) }
16
+ attr_accessor :assistant_id
17
+
18
+ # The list of contacts to call
19
+ sig { returns(T::Array[Revox::CampaignCreateParams::Contact]) }
20
+ attr_accessor :contacts
21
+
22
+ # The name of the campaign
23
+ sig { returns(String) }
24
+ attr_accessor :name
25
+
26
+ # Override retry configuration for calls in this campaign. If not provided, uses
27
+ # the assistant's retry config.
28
+ sig { returns(T.nilable(Revox::CampaignCreateParams::CallRetryConfig)) }
29
+ attr_reader :call_retry_config
30
+
31
+ sig do
32
+ params(
33
+ call_retry_config:
34
+ Revox::CampaignCreateParams::CallRetryConfig::OrHash
35
+ ).void
36
+ end
37
+ attr_writer :call_retry_config
38
+
39
+ # The phone number to use for outbound calls (E.164 format, e.g., +1234567890)
40
+ sig { returns(T.nilable(String)) }
41
+ attr_reader :from_phone_number
42
+
43
+ sig { params(from_phone_number: String).void }
44
+ attr_writer :from_phone_number
45
+
46
+ # Maximum number of concurrent calls allowed for this campaign
47
+ sig { returns(T.nilable(Float)) }
48
+ attr_reader :max_concurrent_calls
49
+
50
+ sig { params(max_concurrent_calls: Float).void }
51
+ attr_writer :max_concurrent_calls
52
+
53
+ # Schedule all calls in this campaign to start at a specific date and time (ISO
54
+ # 8601 format)
55
+ sig do
56
+ returns(T.nilable(Revox::CampaignCreateParams::ScheduledAt::Variants))
57
+ end
58
+ attr_reader :scheduled_at
59
+
60
+ sig do
61
+ params(
62
+ scheduled_at: Revox::CampaignCreateParams::ScheduledAt::Variants
63
+ ).void
64
+ end
65
+ attr_writer :scheduled_at
66
+
67
+ sig do
68
+ params(
69
+ assistant_id: String,
70
+ contacts: T::Array[Revox::CampaignCreateParams::Contact::OrHash],
71
+ name: String,
72
+ call_retry_config:
73
+ Revox::CampaignCreateParams::CallRetryConfig::OrHash,
74
+ from_phone_number: String,
75
+ max_concurrent_calls: Float,
76
+ scheduled_at: Revox::CampaignCreateParams::ScheduledAt::Variants,
77
+ request_options: Revox::RequestOptions::OrHash
78
+ ).returns(T.attached_class)
79
+ end
80
+ def self.new(
81
+ # The ID of the assistant to use
82
+ assistant_id:,
83
+ # The list of contacts to call
84
+ contacts:,
85
+ # The name of the campaign
86
+ name:,
87
+ # Override retry configuration for calls in this campaign. If not provided, uses
88
+ # the assistant's retry config.
89
+ call_retry_config: nil,
90
+ # The phone number to use for outbound calls (E.164 format, e.g., +1234567890)
91
+ from_phone_number: nil,
92
+ # Maximum number of concurrent calls allowed for this campaign
93
+ max_concurrent_calls: nil,
94
+ # Schedule all calls in this campaign to start at a specific date and time (ISO
95
+ # 8601 format)
96
+ scheduled_at: nil,
97
+ request_options: {}
98
+ )
99
+ end
100
+
101
+ sig do
102
+ override.returns(
103
+ {
104
+ assistant_id: String,
105
+ contacts: T::Array[Revox::CampaignCreateParams::Contact],
106
+ name: String,
107
+ call_retry_config: Revox::CampaignCreateParams::CallRetryConfig,
108
+ from_phone_number: String,
109
+ max_concurrent_calls: Float,
110
+ scheduled_at: Revox::CampaignCreateParams::ScheduledAt::Variants,
111
+ request_options: Revox::RequestOptions
112
+ }
113
+ )
114
+ end
115
+ def to_hash
116
+ end
117
+
118
+ class Contact < Revox::Internal::Type::BaseModel
119
+ OrHash =
120
+ T.type_alias do
121
+ T.any(
122
+ Revox::CampaignCreateParams::Contact,
123
+ Revox::Internal::AnyHash
124
+ )
125
+ end
126
+
127
+ sig { returns(T::Hash[Symbol, String]) }
128
+ attr_accessor :prompt_variables
129
+
130
+ sig { returns(String) }
131
+ attr_accessor :to_phone_number
132
+
133
+ sig do
134
+ params(
135
+ prompt_variables: T::Hash[Symbol, String],
136
+ to_phone_number: String
137
+ ).returns(T.attached_class)
138
+ end
139
+ def self.new(prompt_variables:, to_phone_number:)
140
+ end
141
+
142
+ sig do
143
+ override.returns(
144
+ {
145
+ prompt_variables: T::Hash[Symbol, String],
146
+ to_phone_number: String
147
+ }
148
+ )
149
+ end
150
+ def to_hash
151
+ end
152
+ end
153
+
154
+ class CallRetryConfig < Revox::Internal::Type::BaseModel
155
+ OrHash =
156
+ T.type_alias do
157
+ T.any(
158
+ Revox::CampaignCreateParams::CallRetryConfig,
159
+ Revox::Internal::AnyHash
160
+ )
161
+ end
162
+
163
+ sig do
164
+ returns(
165
+ T::Array[
166
+ Revox::CampaignCreateParams::CallRetryConfig::CallingWindow
167
+ ]
168
+ )
169
+ end
170
+ attr_accessor :calling_windows
171
+
172
+ # Maximum number of call retry attempts. Default: 3.
173
+ sig { returns(Integer) }
174
+ attr_accessor :max_retry_attempts
175
+
176
+ # Optional IANA timezone identifier to override the automatic timezone detection
177
+ # from phone number. If not provided, timezone is determined from the recipient's
178
+ # phone number country code. Examples: 'America/New_York', 'Europe/Paris'.
179
+ sig { returns(T.nilable(String)) }
180
+ attr_accessor :timezone
181
+
182
+ # Override retry configuration for calls in this campaign. If not provided, uses
183
+ # the assistant's retry config.
184
+ sig do
185
+ params(
186
+ calling_windows:
187
+ T::Array[
188
+ Revox::CampaignCreateParams::CallRetryConfig::CallingWindow::OrHash
189
+ ],
190
+ max_retry_attempts: Integer,
191
+ timezone: T.nilable(String)
192
+ ).returns(T.attached_class)
193
+ end
194
+ def self.new(
195
+ calling_windows:,
196
+ # Maximum number of call retry attempts. Default: 3.
197
+ max_retry_attempts:,
198
+ # Optional IANA timezone identifier to override the automatic timezone detection
199
+ # from phone number. If not provided, timezone is determined from the recipient's
200
+ # phone number country code. Examples: 'America/New_York', 'Europe/Paris'.
201
+ timezone: nil
202
+ )
203
+ end
204
+
205
+ sig do
206
+ override.returns(
207
+ {
208
+ calling_windows:
209
+ T::Array[
210
+ Revox::CampaignCreateParams::CallRetryConfig::CallingWindow
211
+ ],
212
+ max_retry_attempts: Integer,
213
+ timezone: T.nilable(String)
214
+ }
215
+ )
216
+ end
217
+ def to_hash
218
+ end
219
+
220
+ class CallingWindow < Revox::Internal::Type::BaseModel
221
+ OrHash =
222
+ T.type_alias do
223
+ T.any(
224
+ Revox::CampaignCreateParams::CallRetryConfig::CallingWindow,
225
+ Revox::Internal::AnyHash
226
+ )
227
+ end
228
+
229
+ # End time for the calling window in the recipient's timezone (or
230
+ # timezone_override if provided). Format: 'HH:mm' (24-hour) or 'H:mma' (12-hour).
231
+ # Examples: '17:00', '6pm'. Default: '18:00'.
232
+ sig { returns(String) }
233
+ attr_accessor :calling_window_end_time
234
+
235
+ # Start time for the calling window in the recipient's timezone (or
236
+ # timezone_override if provided). Format: 'HH:mm' (24-hour) or 'H:mma' (12-hour).
237
+ # Examples: '09:00', '10am'. Default: '10:00'.
238
+ sig { returns(String) }
239
+ attr_accessor :calling_window_start_time
240
+
241
+ # Delay between retry attempts in seconds. Default: 7200 (2 hours).
242
+ sig { returns(Integer) }
243
+ attr_accessor :retry_delay_seconds
244
+
245
+ sig do
246
+ params(
247
+ calling_window_end_time: String,
248
+ calling_window_start_time: String,
249
+ retry_delay_seconds: Integer
250
+ ).returns(T.attached_class)
251
+ end
252
+ def self.new(
253
+ # End time for the calling window in the recipient's timezone (or
254
+ # timezone_override if provided). Format: 'HH:mm' (24-hour) or 'H:mma' (12-hour).
255
+ # Examples: '17:00', '6pm'. Default: '18:00'.
256
+ calling_window_end_time:,
257
+ # Start time for the calling window in the recipient's timezone (or
258
+ # timezone_override if provided). Format: 'HH:mm' (24-hour) or 'H:mma' (12-hour).
259
+ # Examples: '09:00', '10am'. Default: '10:00'.
260
+ calling_window_start_time:,
261
+ # Delay between retry attempts in seconds. Default: 7200 (2 hours).
262
+ retry_delay_seconds:
263
+ )
264
+ end
265
+
266
+ sig do
267
+ override.returns(
268
+ {
269
+ calling_window_end_time: String,
270
+ calling_window_start_time: String,
271
+ retry_delay_seconds: Integer
272
+ }
273
+ )
274
+ end
275
+ def to_hash
276
+ end
277
+ end
278
+ end
279
+
280
+ # Schedule all calls in this campaign to start at a specific date and time (ISO
281
+ # 8601 format)
282
+ module ScheduledAt
283
+ extend Revox::Internal::Type::Union
284
+
285
+ Variants = T.type_alias { T.any(Time, T.anything) }
286
+
287
+ sig do
288
+ override.returns(
289
+ T::Array[Revox::CampaignCreateParams::ScheduledAt::Variants]
290
+ )
291
+ end
292
+ def self.variants
293
+ end
294
+ end
295
+ end
296
+ end
297
+ end