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,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,174 @@
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 name
23
+ # The name of the campaign
24
+ #
25
+ # @return [String]
26
+ required :name, String
27
+
28
+ # @!attribute call_retry_config
29
+ # Override retry configuration for calls in this campaign. If not provided, uses
30
+ # the assistant's retry config.
31
+ #
32
+ # @return [Revox::Models::CampaignCreateParams::CallRetryConfig, nil]
33
+ optional :call_retry_config, -> { Revox::CampaignCreateParams::CallRetryConfig }
34
+
35
+ # @!attribute from_phone_number
36
+ # The phone number to use for outbound calls (E.164 format, e.g., +1234567890)
37
+ #
38
+ # @return [String, nil]
39
+ optional :from_phone_number, String
40
+
41
+ # @!attribute max_concurrent_calls
42
+ # Maximum number of concurrent calls allowed for this campaign
43
+ #
44
+ # @return [Float, nil]
45
+ optional :max_concurrent_calls, Float
46
+
47
+ # @!attribute scheduled_at
48
+ # Schedule all calls in this campaign to start at a specific date and time (ISO
49
+ # 8601 format)
50
+ #
51
+ # @return [Time, Object, nil]
52
+ optional :scheduled_at, union: -> { Revox::CampaignCreateParams::ScheduledAt }
53
+
54
+ # @!method initialize(assistant_id:, contacts:, name:, call_retry_config: nil, from_phone_number: nil, max_concurrent_calls: nil, scheduled_at: nil, request_options: {})
55
+ # Some parameter documentations has been truncated, see
56
+ # {Revox::Models::CampaignCreateParams} for more details.
57
+ #
58
+ # @param assistant_id [String] The ID of the assistant to use
59
+ #
60
+ # @param contacts [Array<Revox::Models::CampaignCreateParams::Contact>] The list of contacts to call
61
+ #
62
+ # @param name [String] The name of the campaign
63
+ #
64
+ # @param call_retry_config [Revox::Models::CampaignCreateParams::CallRetryConfig] Override retry configuration for calls in this campaign. If not provided, uses t
65
+ #
66
+ # @param from_phone_number [String] The phone number to use for outbound calls (E.164 format, e.g., +1234567890)
67
+ #
68
+ # @param max_concurrent_calls [Float] Maximum number of concurrent calls allowed for this campaign
69
+ #
70
+ # @param scheduled_at [Time, Object] Schedule all calls in this campaign to start at a specific date and time (ISO 86
71
+ #
72
+ # @param request_options [Revox::RequestOptions, Hash{Symbol=>Object}]
73
+
74
+ class Contact < Revox::Internal::Type::BaseModel
75
+ # @!attribute prompt_variables
76
+ #
77
+ # @return [Hash{Symbol=>String}]
78
+ required :prompt_variables, Revox::Internal::Type::HashOf[String]
79
+
80
+ # @!attribute to_phone_number
81
+ #
82
+ # @return [String]
83
+ required :to_phone_number, String
84
+
85
+ # @!method initialize(prompt_variables:, to_phone_number:)
86
+ # @param prompt_variables [Hash{Symbol=>String}]
87
+ # @param to_phone_number [String]
88
+ end
89
+
90
+ class CallRetryConfig < Revox::Internal::Type::BaseModel
91
+ # @!attribute calling_windows
92
+ #
93
+ # @return [Array<Revox::Models::CampaignCreateParams::CallRetryConfig::CallingWindow>]
94
+ required :calling_windows,
95
+ -> { Revox::Internal::Type::ArrayOf[Revox::CampaignCreateParams::CallRetryConfig::CallingWindow] }
96
+
97
+ # @!attribute max_retry_attempts
98
+ # Maximum number of call retry attempts. Default: 3.
99
+ #
100
+ # @return [Integer]
101
+ required :max_retry_attempts, Integer
102
+
103
+ # @!attribute timezone
104
+ # Optional IANA timezone identifier to override the automatic timezone detection
105
+ # from phone number. If not provided, timezone is determined from the recipient's
106
+ # phone number country code. Examples: 'America/New_York', 'Europe/Paris'.
107
+ #
108
+ # @return [String, nil]
109
+ optional :timezone, String, nil?: true
110
+
111
+ # @!method initialize(calling_windows:, max_retry_attempts:, timezone: nil)
112
+ # Some parameter documentations has been truncated, see
113
+ # {Revox::Models::CampaignCreateParams::CallRetryConfig} for more details.
114
+ #
115
+ # Override retry configuration for calls in this campaign. If not provided, uses
116
+ # the assistant's retry config.
117
+ #
118
+ # @param calling_windows [Array<Revox::Models::CampaignCreateParams::CallRetryConfig::CallingWindow>]
119
+ #
120
+ # @param max_retry_attempts [Integer] Maximum number of call retry attempts. Default: 3.
121
+ #
122
+ # @param timezone [String, nil] Optional IANA timezone identifier to override the automatic timezone detection f
123
+
124
+ class CallingWindow < Revox::Internal::Type::BaseModel
125
+ # @!attribute calling_window_end_time
126
+ # End time for the calling window in the recipient's timezone (or
127
+ # timezone_override if provided). Format: 'HH:mm' (24-hour) or 'H:mma' (12-hour).
128
+ # Examples: '17:00', '6pm'. Default: '18:00'.
129
+ #
130
+ # @return [String]
131
+ required :calling_window_end_time, String
132
+
133
+ # @!attribute calling_window_start_time
134
+ # Start time for the calling window in the recipient's timezone (or
135
+ # timezone_override if provided). Format: 'HH:mm' (24-hour) or 'H:mma' (12-hour).
136
+ # Examples: '09:00', '10am'. Default: '10:00'.
137
+ #
138
+ # @return [String]
139
+ required :calling_window_start_time, String
140
+
141
+ # @!attribute retry_delay_seconds
142
+ # Delay between retry attempts in seconds. Default: 7200 (2 hours).
143
+ #
144
+ # @return [Integer]
145
+ required :retry_delay_seconds, Integer
146
+
147
+ # @!method initialize(calling_window_end_time:, calling_window_start_time:, retry_delay_seconds:)
148
+ # Some parameter documentations has been truncated, see
149
+ # {Revox::Models::CampaignCreateParams::CallRetryConfig::CallingWindow} for more
150
+ # details.
151
+ #
152
+ # @param calling_window_end_time [String] End time for the calling window in the recipient's timezone (or timezone_overrid
153
+ #
154
+ # @param calling_window_start_time [String] Start time for the calling window in the recipient's timezone (or timezone_overr
155
+ #
156
+ # @param retry_delay_seconds [Integer] Delay between retry attempts in seconds. Default: 7200 (2 hours).
157
+ end
158
+ end
159
+
160
+ # Schedule all calls in this campaign to start at a specific date and time (ISO
161
+ # 8601 format)
162
+ module ScheduledAt
163
+ extend Revox::Internal::Type::Union
164
+
165
+ variant Time
166
+
167
+ variant Revox::Internal::Type::Unknown
168
+
169
+ # @!method self.variants
170
+ # @return [Array(Time, Object)]
171
+ end
172
+ end
173
+ end
174
+ end