revox 0.0.2 → 0.2.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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +96 -0
  3. data/README.md +88 -22
  4. data/lib/revox/client.rb +19 -1
  5. data/lib/revox/internal/transport/base_client.rb +5 -0
  6. data/lib/revox/internal/type/base_model.rb +3 -3
  7. data/lib/revox/internal/util.rb +53 -7
  8. data/lib/revox/models/assistant_create_params.rb +1036 -11
  9. data/lib/revox/models/assistant_create_response.rb +1071 -11
  10. data/lib/revox/models/assistant_delete_params.rb +7 -1
  11. data/lib/revox/models/assistant_list_response.rb +1070 -11
  12. data/lib/revox/models/assistant_retrieve_params.rb +7 -1
  13. data/lib/revox/models/assistant_retrieve_response.rb +1066 -11
  14. data/lib/revox/models/assistant_update_params.rb +1043 -11
  15. data/lib/revox/models/assistant_update_response.rb +1097 -12
  16. data/lib/revox/models/call_create_params.rb +1063 -11
  17. data/lib/revox/models/call_create_response.rb +2507 -87
  18. data/lib/revox/models/call_retrieve_params.rb +7 -1
  19. data/lib/revox/models/call_retrieve_response.rb +2512 -87
  20. data/lib/revox/models/campaign_cancel_params.rb +20 -0
  21. data/lib/revox/models/campaign_cancel_response.rb +16 -0
  22. data/lib/revox/models/campaign_create_params.rb +239 -0
  23. data/lib/revox/models/campaign_create_response.rb +2030 -0
  24. data/lib/revox/models/campaign_delete_params.rb +20 -0
  25. data/lib/revox/models/campaign_delete_response.rb +16 -0
  26. data/lib/revox/models/campaign_export_rows_params.rb +20 -0
  27. data/lib/revox/models/campaign_export_rows_response.rb +22 -0
  28. data/lib/revox/models/campaign_get_rows_params.rb +20 -0
  29. data/lib/revox/models/campaign_get_rows_response.rb +3176 -0
  30. data/lib/revox/models/campaign_list_params.rb +14 -0
  31. data/lib/revox/models/campaign_list_response.rb +2024 -0
  32. data/lib/revox/models/campaign_retrieve_params.rb +20 -0
  33. data/lib/revox/models/campaign_retrieve_response.rb +2032 -0
  34. data/lib/revox/models/users/me_retrieve_response.rb +13 -1
  35. data/lib/revox/models/users/me_update_response.rb +13 -1
  36. data/lib/revox/models/voice_list_response.rb +55 -1
  37. data/lib/revox/models/voice_preview_params.rb +43 -3
  38. data/lib/revox/models/voice_retrieve_params.rb +7 -1
  39. data/lib/revox/models.rb +14 -2
  40. data/lib/revox/resources/assistants.rb +138 -6
  41. data/lib/revox/resources/call.rb +10 -27
  42. data/lib/revox/resources/campaigns.rb +176 -0
  43. data/lib/revox/resources/voices.rb +17 -7
  44. data/lib/revox/version.rb +1 -1
  45. data/lib/revox.rb +15 -2
  46. data/rbi/revox/client.rbi +3 -0
  47. data/rbi/revox/internal/util.rbi +28 -0
  48. data/rbi/revox/models/assistant_create_params.rbi +2135 -102
  49. data/rbi/revox/models/assistant_create_response.rbi +2454 -199
  50. data/rbi/revox/models/assistant_delete_params.rbi +11 -5
  51. data/rbi/revox/models/assistant_list_response.rbi +2448 -195
  52. data/rbi/revox/models/assistant_retrieve_params.rbi +11 -5
  53. data/rbi/revox/models/assistant_retrieve_response.rbi +2401 -210
  54. data/rbi/revox/models/assistant_update_params.rbi +2139 -100
  55. data/rbi/revox/models/assistant_update_response.rbi +2504 -198
  56. data/rbi/revox/models/call_create_params.rbi +2377 -222
  57. data/rbi/revox/models/call_create_response.rbi +5840 -594
  58. data/rbi/revox/models/call_retrieve_params.rbi +11 -5
  59. data/rbi/revox/models/call_retrieve_response.rbi +5872 -618
  60. data/rbi/revox/models/campaign_cancel_params.rbi +33 -0
  61. data/rbi/revox/models/campaign_cancel_response.rbi +23 -0
  62. data/rbi/revox/models/campaign_create_params.rbi +433 -0
  63. data/rbi/revox/models/campaign_create_response.rbi +4170 -0
  64. data/rbi/revox/models/campaign_delete_params.rbi +33 -0
  65. data/rbi/revox/models/campaign_delete_response.rbi +23 -0
  66. data/rbi/revox/models/campaign_export_rows_params.rbi +33 -0
  67. data/rbi/revox/models/campaign_export_rows_response.rbi +29 -0
  68. data/rbi/revox/models/campaign_get_rows_params.rbi +33 -0
  69. data/rbi/revox/models/campaign_get_rows_response.rbi +6706 -0
  70. data/rbi/revox/models/campaign_list_params.rbi +27 -0
  71. data/rbi/revox/models/campaign_list_response.rbi +4156 -0
  72. data/rbi/revox/models/campaign_retrieve_params.rbi +33 -0
  73. data/rbi/revox/models/campaign_retrieve_response.rbi +4175 -0
  74. data/rbi/revox/models/users/me_retrieve_response.rbi +13 -3
  75. data/rbi/revox/models/users/me_update_response.rbi +13 -3
  76. data/rbi/revox/models/voice_list_response.rbi +105 -3
  77. data/rbi/revox/models/voice_preview_params.rbi +60 -2
  78. data/rbi/revox/models/voice_retrieve_params.rbi +6 -1
  79. data/rbi/revox/models.rbi +14 -2
  80. data/rbi/revox/resources/assistants.rbi +301 -6
  81. data/rbi/revox/resources/call.rbi +10 -19
  82. data/rbi/revox/resources/campaigns.rbi +121 -0
  83. data/rbi/revox/resources/voices.rbi +15 -5
  84. data/sig/revox/client.rbs +2 -0
  85. data/sig/revox/internal/util.rbs +14 -0
  86. data/sig/revox/models/assistant_create_params.rbs +841 -4
  87. data/sig/revox/models/assistant_create_response.rbs +860 -3
  88. data/sig/revox/models/assistant_delete_params.rbs +8 -3
  89. data/sig/revox/models/assistant_list_response.rbs +860 -3
  90. data/sig/revox/models/assistant_retrieve_params.rbs +8 -3
  91. data/sig/revox/models/assistant_retrieve_response.rbs +859 -3
  92. data/sig/revox/models/assistant_update_params.rbs +846 -4
  93. data/sig/revox/models/assistant_update_response.rbs +886 -6
  94. data/sig/revox/models/call_create_params.rbs +844 -6
  95. data/sig/revox/models/call_create_response.rbs +2166 -79
  96. data/sig/revox/models/call_retrieve_params.rbs +9 -3
  97. data/sig/revox/models/call_retrieve_response.rbs +2166 -79
  98. data/sig/revox/models/campaign_cancel_params.rbs +20 -0
  99. data/sig/revox/models/campaign_cancel_response.rbs +13 -0
  100. data/sig/revox/models/campaign_create_params.rbs +203 -0
  101. data/sig/revox/models/campaign_create_response.rbs +1694 -0
  102. data/sig/revox/models/campaign_delete_params.rbs +20 -0
  103. data/sig/revox/models/campaign_delete_response.rbs +13 -0
  104. data/sig/revox/models/campaign_export_rows_params.rbs +20 -0
  105. data/sig/revox/models/campaign_export_rows_response.rbs +15 -0
  106. data/sig/revox/models/campaign_get_rows_params.rbs +20 -0
  107. data/sig/revox/models/campaign_get_rows_response.rbs +2688 -0
  108. data/sig/revox/models/campaign_list_params.rbs +14 -0
  109. data/sig/revox/models/campaign_list_response.rbs +1694 -0
  110. data/sig/revox/models/campaign_retrieve_params.rbs +20 -0
  111. data/sig/revox/models/campaign_retrieve_response.rbs +1694 -0
  112. data/sig/revox/models/users/me_retrieve_response.rbs +8 -3
  113. data/sig/revox/models/users/me_update_response.rbs +8 -3
  114. data/sig/revox/models/voice_list_response.rbs +45 -3
  115. data/sig/revox/models/voice_preview_params.rbs +35 -1
  116. data/sig/revox/models/voice_retrieve_params.rbs +5 -1
  117. data/sig/revox/models.rbs +14 -2
  118. data/sig/revox/resources/assistants.rbs +54 -0
  119. data/sig/revox/resources/call.rbs +0 -6
  120. data/sig/revox/resources/campaigns.rbs +49 -0
  121. data/sig/revox/resources/voices.rbs +3 -0
  122. metadata +47 -8
  123. data/lib/revox/models/call_list_params.rb +0 -29
  124. data/lib/revox/models/call_list_response.rb +0 -197
  125. data/rbi/revox/models/call_list_params.rbi +0 -47
  126. data/rbi/revox/models/call_list_response.rbi +0 -401
  127. data/sig/revox/models/call_list_params.rbs +0 -28
  128. data/sig/revox/models/call_list_response.rbs +0 -171
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Revox
4
+ module Models
5
+ # @see Revox::Resources::Campaigns#cancel
6
+ class CampaignCancelParams < Revox::Internal::Type::BaseModel
7
+ extend Revox::Internal::Type::RequestParameters::Converter
8
+ include Revox::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
17
+ # @param request_options [Revox::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Revox
4
+ module Models
5
+ # @see Revox::Resources::Campaigns#cancel
6
+ class CampaignCancelResponse < Revox::Internal::Type::BaseModel
7
+ # @!attribute success
8
+ #
9
+ # @return [Boolean]
10
+ required :success, Revox::Internal::Type::Boolean
11
+
12
+ # @!method initialize(success:)
13
+ # @param success [Boolean]
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,239 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Revox
4
+ module Models
5
+ # @see Revox::Resources::Campaigns#create
6
+ class CampaignCreateParams < Revox::Internal::Type::BaseModel
7
+ extend Revox::Internal::Type::RequestParameters::Converter
8
+ include Revox::Internal::Type::RequestParameters
9
+
10
+ # @!attribute assistant_id
11
+ # The ID of the assistant to use
12
+ #
13
+ # @return [String]
14
+ required :assistant_id, String
15
+
16
+ # @!attribute contacts
17
+ # The list of contacts to call
18
+ #
19
+ # @return [Array<Revox::Models::CampaignCreateParams::Contact>]
20
+ required :contacts, -> { Revox::Internal::Type::ArrayOf[Revox::CampaignCreateParams::Contact] }
21
+
22
+ # @!attribute launch
23
+ # Whether to launch the campaign immediately. Set to false to save as a draft.
24
+ #
25
+ # @return [Boolean]
26
+ required :launch, Revox::Internal::Type::Boolean
27
+
28
+ # @!attribute name
29
+ # The name of the campaign
30
+ #
31
+ # @return [String]
32
+ required :name, String
33
+
34
+ # @!attribute type
35
+ # Campaign type. 'jump_in' campaigns only dial while someone is on the campaign
36
+ # page and auto-pause when unattended.
37
+ #
38
+ # @return [Symbol, Revox::Models::CampaignCreateParams::Type]
39
+ required :type, enum: -> { Revox::CampaignCreateParams::Type }
40
+
41
+ # @!attribute call_retry_config
42
+ # Override retry configuration for calls in this campaign. If not provided, uses
43
+ # the assistant's retry config.
44
+ #
45
+ # @return [Revox::Models::CampaignCreateParams::CallRetryConfig, nil]
46
+ optional :call_retry_config, -> { Revox::CampaignCreateParams::CallRetryConfig }
47
+
48
+ # @!attribute from_phone_number
49
+ # The phone number to use for outbound calls (E.164 format, e.g., +1234567890)
50
+ #
51
+ # @return [String, nil]
52
+ optional :from_phone_number, String
53
+
54
+ # @!attribute max_concurrent_calls
55
+ # Maximum number of concurrent calls allowed for this campaign
56
+ #
57
+ # @return [Float, nil]
58
+ optional :max_concurrent_calls, Float
59
+
60
+ # @!attribute scheduled_at
61
+ # Schedule all calls in this campaign to start at a specific date and time (ISO
62
+ # 8601 format)
63
+ #
64
+ # @return [Time, Object, nil]
65
+ optional :scheduled_at, union: -> { Revox::CampaignCreateParams::ScheduledAt }
66
+
67
+ # @!method initialize(assistant_id:, contacts:, launch:, name:, type:, call_retry_config: nil, from_phone_number: nil, max_concurrent_calls: nil, scheduled_at: nil, request_options: {})
68
+ # Some parameter documentations has been truncated, see
69
+ # {Revox::Models::CampaignCreateParams} for more details.
70
+ #
71
+ # @param assistant_id [String] The ID of the assistant to use
72
+ #
73
+ # @param contacts [Array<Revox::Models::CampaignCreateParams::Contact>] The list of contacts to call
74
+ #
75
+ # @param launch [Boolean] Whether to launch the campaign immediately. Set to false to save as a draft.
76
+ #
77
+ # @param name [String] The name of the campaign
78
+ #
79
+ # @param type [Symbol, Revox::Models::CampaignCreateParams::Type] Campaign type. 'jump_in' campaigns only dial while someone is on the campaign pa
80
+ #
81
+ # @param call_retry_config [Revox::Models::CampaignCreateParams::CallRetryConfig] Override retry configuration for calls in this campaign. If not provided, uses t
82
+ #
83
+ # @param from_phone_number [String] The phone number to use for outbound calls (E.164 format, e.g., +1234567890)
84
+ #
85
+ # @param max_concurrent_calls [Float] Maximum number of concurrent calls allowed for this campaign
86
+ #
87
+ # @param scheduled_at [Time, Object] Schedule all calls in this campaign to start at a specific date and time (ISO 86
88
+ #
89
+ # @param request_options [Revox::RequestOptions, Hash{Symbol=>Object}]
90
+
91
+ class Contact < Revox::Internal::Type::BaseModel
92
+ # @!attribute prompt_variables
93
+ #
94
+ # @return [Hash{Symbol=>String}]
95
+ required :prompt_variables, Revox::Internal::Type::HashOf[String]
96
+
97
+ # @!attribute to_phone_number
98
+ #
99
+ # @return [String]
100
+ required :to_phone_number, String
101
+
102
+ # @!method initialize(prompt_variables:, to_phone_number:)
103
+ # @param prompt_variables [Hash{Symbol=>String}]
104
+ # @param to_phone_number [String]
105
+ end
106
+
107
+ # Campaign type. 'jump_in' campaigns only dial while someone is on the campaign
108
+ # page and auto-pause when unattended.
109
+ module Type
110
+ extend Revox::Internal::Type::Enum
111
+
112
+ REGULAR = :regular
113
+ JUMP_IN = :jump_in
114
+
115
+ # @!method self.values
116
+ # @return [Array<Symbol>]
117
+ end
118
+
119
+ class CallRetryConfig < Revox::Internal::Type::BaseModel
120
+ # @!attribute allowed_days
121
+ # Days of the week when calls are allowed, in the recipient's timezone. Default:
122
+ # Monday through Friday.
123
+ #
124
+ # @return [Array<Symbol, Revox::Models::CampaignCreateParams::CallRetryConfig::AllowedDay>]
125
+ required :allowed_days,
126
+ -> { Revox::Internal::Type::ArrayOf[enum: Revox::CampaignCreateParams::CallRetryConfig::AllowedDay] }
127
+
128
+ # @!attribute call_twice_in_a_row
129
+ # If true and max_retry_attempts >= 2, attempt #2 fires immediately (skipping
130
+ # retry_delay_seconds) when attempt #1 didn't reach a human.
131
+ # Calling-window/allowed-days checks still apply. Only affects the 1→2 transition.
132
+ # Default: false.
133
+ #
134
+ # @return [Boolean]
135
+ required :call_twice_in_a_row, Revox::Internal::Type::Boolean
136
+
137
+ # @!attribute calling_windows
138
+ #
139
+ # @return [Array<Revox::Models::CampaignCreateParams::CallRetryConfig::CallingWindow>]
140
+ required :calling_windows,
141
+ -> { Revox::Internal::Type::ArrayOf[Revox::CampaignCreateParams::CallRetryConfig::CallingWindow] }
142
+
143
+ # @!attribute max_retry_attempts
144
+ # Maximum number of call retry attempts. Default: 3.
145
+ #
146
+ # @return [Integer]
147
+ required :max_retry_attempts, Integer
148
+
149
+ # @!attribute timezone
150
+ # Optional IANA timezone identifier to override the automatic timezone detection
151
+ # from phone number. If not provided, timezone is determined from the recipient's
152
+ # phone number country code. Examples: 'America/New_York', 'Europe/Paris'.
153
+ #
154
+ # @return [String, nil]
155
+ optional :timezone, String, nil?: true
156
+
157
+ # @!method initialize(allowed_days:, call_twice_in_a_row:, calling_windows:, max_retry_attempts:, timezone: nil)
158
+ # Some parameter documentations has been truncated, see
159
+ # {Revox::Models::CampaignCreateParams::CallRetryConfig} for more details.
160
+ #
161
+ # Override retry configuration for calls in this campaign. If not provided, uses
162
+ # the assistant's retry config.
163
+ #
164
+ # @param allowed_days [Array<Symbol, Revox::Models::CampaignCreateParams::CallRetryConfig::AllowedDay>] Days of the week when calls are allowed, in the recipient's timezone. Default: M
165
+ #
166
+ # @param call_twice_in_a_row [Boolean] If true and max_retry_attempts >= 2, attempt #2 fires immediately (skipping retr
167
+ #
168
+ # @param calling_windows [Array<Revox::Models::CampaignCreateParams::CallRetryConfig::CallingWindow>]
169
+ #
170
+ # @param max_retry_attempts [Integer] Maximum number of call retry attempts. Default: 3.
171
+ #
172
+ # @param timezone [String, nil] Optional IANA timezone identifier to override the automatic timezone detection f
173
+
174
+ module AllowedDay
175
+ extend Revox::Internal::Type::Enum
176
+
177
+ MONDAY = :monday
178
+ TUESDAY = :tuesday
179
+ WEDNESDAY = :wednesday
180
+ THURSDAY = :thursday
181
+ FRIDAY = :friday
182
+ SATURDAY = :saturday
183
+ SUNDAY = :sunday
184
+
185
+ # @!method self.values
186
+ # @return [Array<Symbol>]
187
+ end
188
+
189
+ class CallingWindow < Revox::Internal::Type::BaseModel
190
+ # @!attribute calling_window_end_time
191
+ # End time for the calling window in the recipient's timezone (or
192
+ # timezone_override if provided). Format: 'HH:mm' (24-hour) or 'H:mma' (12-hour).
193
+ # Examples: '17:00', '6pm'. Default: '18:00'.
194
+ #
195
+ # @return [String]
196
+ required :calling_window_end_time, String
197
+
198
+ # @!attribute calling_window_start_time
199
+ # Start time for the calling window in the recipient's timezone (or
200
+ # timezone_override if provided). Format: 'HH:mm' (24-hour) or 'H:mma' (12-hour).
201
+ # Examples: '09:00', '10am'. Default: '10:00'.
202
+ #
203
+ # @return [String]
204
+ required :calling_window_start_time, String
205
+
206
+ # @!attribute retry_delay_seconds
207
+ # Delay between retry attempts in seconds. Default: 7200 (2 hours).
208
+ #
209
+ # @return [Integer]
210
+ required :retry_delay_seconds, Integer
211
+
212
+ # @!method initialize(calling_window_end_time:, calling_window_start_time:, retry_delay_seconds:)
213
+ # Some parameter documentations has been truncated, see
214
+ # {Revox::Models::CampaignCreateParams::CallRetryConfig::CallingWindow} for more
215
+ # details.
216
+ #
217
+ # @param calling_window_end_time [String] End time for the calling window in the recipient's timezone (or timezone_overrid
218
+ #
219
+ # @param calling_window_start_time [String] Start time for the calling window in the recipient's timezone (or timezone_overr
220
+ #
221
+ # @param retry_delay_seconds [Integer] Delay between retry attempts in seconds. Default: 7200 (2 hours).
222
+ end
223
+ end
224
+
225
+ # Schedule all calls in this campaign to start at a specific date and time (ISO
226
+ # 8601 format)
227
+ module ScheduledAt
228
+ extend Revox::Internal::Type::Union
229
+
230
+ variant Time
231
+
232
+ variant Revox::Internal::Type::Unknown
233
+
234
+ # @!method self.variants
235
+ # @return [Array(Time, Object)]
236
+ end
237
+ end
238
+ end
239
+ end