surge_api 0.8.0 → 0.10.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 (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +41 -0
  3. data/README.md +29 -1
  4. data/lib/surge_api/client.rb +4 -0
  5. data/lib/surge_api/internal/cursor.rb +112 -0
  6. data/lib/surge_api/internal/transport/pooled_net_requester.rb +1 -1
  7. data/lib/surge_api/internal/util.rb +1 -1
  8. data/lib/surge_api/models/blast.rb +2 -2
  9. data/lib/surge_api/models/blast_create_params.rb +4 -4
  10. data/lib/surge_api/models/campaign.rb +27 -1
  11. data/lib/surge_api/models/campaign_retrieve_params.rb +14 -0
  12. data/lib/surge_api/models/contact_list_params.rb +34 -0
  13. data/lib/surge_api/models/message.rb +4 -4
  14. data/lib/surge_api/models/message_delivered_webhook_event.rb +3 -3
  15. data/lib/surge_api/models/message_failed_webhook_event.rb +3 -3
  16. data/lib/surge_api/models/message_list_params.rb +34 -0
  17. data/lib/surge_api/models/message_received_webhook_event.rb +3 -3
  18. data/lib/surge_api/models/message_sent_webhook_event.rb +3 -3
  19. data/lib/surge_api/models/phone_number.rb +1 -1
  20. data/lib/surge_api/models/phone_number_list_params.rb +34 -0
  21. data/lib/surge_api/models/recording_completed_webhook_event.rb +136 -0
  22. data/lib/surge_api/models/recording_get_file_params.rb +14 -0
  23. data/lib/surge_api/models/recording_get_file_response.rb +19 -0
  24. data/lib/surge_api/models/unwrap_webhook_event.rb +5 -1
  25. data/lib/surge_api/models/voicemail_received_webhook_event.rb +144 -0
  26. data/lib/surge_api/models.rb +14 -0
  27. data/lib/surge_api/resources/blasts.rb +1 -1
  28. data/lib/surge_api/resources/campaigns.rb +20 -0
  29. data/lib/surge_api/resources/contacts.rb +30 -0
  30. data/lib/surge_api/resources/messages.rb +30 -0
  31. data/lib/surge_api/resources/phone_numbers.rb +30 -0
  32. data/lib/surge_api/resources/recordings.rb +35 -0
  33. data/lib/surge_api/resources/webhooks.rb +1 -1
  34. data/lib/surge_api/version.rb +1 -1
  35. data/lib/surge_api.rb +10 -0
  36. data/rbi/surge_api/client.rbi +3 -0
  37. data/rbi/surge_api/internal/cursor.rbi +52 -0
  38. data/rbi/surge_api/internal/util.rbi +1 -1
  39. data/rbi/surge_api/models/blast.rbi +3 -6
  40. data/rbi/surge_api/models/blast_create_params.rbi +3 -6
  41. data/rbi/surge_api/models/campaign.rbi +32 -0
  42. data/rbi/surge_api/models/campaign_retrieve_params.rbi +27 -0
  43. data/rbi/surge_api/models/contact_list_params.rbi +59 -0
  44. data/rbi/surge_api/models/message.rbi +6 -12
  45. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +3 -3
  46. data/rbi/surge_api/models/message_failed_webhook_event.rbi +3 -3
  47. data/rbi/surge_api/models/message_list_params.rbi +59 -0
  48. data/rbi/surge_api/models/message_received_webhook_event.rbi +3 -3
  49. data/rbi/surge_api/models/message_sent_webhook_event.rbi +3 -3
  50. data/rbi/surge_api/models/phone_number_list_params.rbi +59 -0
  51. data/rbi/surge_api/models/recording_completed_webhook_event.rbi +277 -0
  52. data/rbi/surge_api/models/recording_get_file_params.rbi +27 -0
  53. data/rbi/surge_api/models/recording_get_file_response.rbi +34 -0
  54. data/rbi/surge_api/models/unwrap_webhook_event.rbi +3 -1
  55. data/rbi/surge_api/models/voicemail_received_webhook_event.rbi +283 -0
  56. data/rbi/surge_api/models.rbi +16 -0
  57. data/rbi/surge_api/resources/blasts.rbi +1 -1
  58. data/rbi/surge_api/resources/campaigns.rbi +14 -0
  59. data/rbi/surge_api/resources/contacts.rbi +21 -0
  60. data/rbi/surge_api/resources/messages.rbi +21 -0
  61. data/rbi/surge_api/resources/phone_numbers.rbi +21 -0
  62. data/rbi/surge_api/resources/recordings.rbi +27 -0
  63. data/rbi/surge_api/resources/webhooks.rbi +3 -1
  64. data/sig/surge_api/client.rbs +2 -0
  65. data/sig/surge_api/internal/cursor.rbs +28 -0
  66. data/sig/surge_api/models/blast.rbs +4 -6
  67. data/sig/surge_api/models/blast_create_params.rbs +4 -6
  68. data/sig/surge_api/models/campaign.rbs +28 -0
  69. data/sig/surge_api/models/campaign_retrieve_params.rbs +15 -0
  70. data/sig/surge_api/models/contact_list_params.rbs +32 -0
  71. data/sig/surge_api/models/message.rbs +8 -12
  72. data/sig/surge_api/models/message_delivered_webhook_event.rbs +4 -4
  73. data/sig/surge_api/models/message_failed_webhook_event.rbs +4 -4
  74. data/sig/surge_api/models/message_list_params.rbs +32 -0
  75. data/sig/surge_api/models/message_received_webhook_event.rbs +4 -4
  76. data/sig/surge_api/models/message_sent_webhook_event.rbs +4 -4
  77. data/sig/surge_api/models/phone_number_list_params.rbs +32 -0
  78. data/sig/surge_api/models/recording_completed_webhook_event.rbs +126 -0
  79. data/sig/surge_api/models/recording_get_file_params.rbs +15 -0
  80. data/sig/surge_api/models/recording_get_file_response.rbs +13 -0
  81. data/sig/surge_api/models/unwrap_webhook_event.rbs +2 -0
  82. data/sig/surge_api/models/voicemail_received_webhook_event.rbs +131 -0
  83. data/sig/surge_api/models.rbs +14 -0
  84. data/sig/surge_api/resources/blasts.rbs +1 -1
  85. data/sig/surge_api/resources/campaigns.rbs +5 -0
  86. data/sig/surge_api/resources/contacts.rbs +7 -0
  87. data/sig/surge_api/resources/messages.rbs +7 -0
  88. data/sig/surge_api/resources/phone_numbers.rbs +7 -0
  89. data/sig/surge_api/resources/recordings.rbs +12 -0
  90. data/sig/surge_api/resources/webhooks.rbs +3 -1
  91. metadata +32 -2
@@ -0,0 +1,277 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class RecordingCompletedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ SurgeAPI::RecordingCompletedWebhookEvent,
10
+ SurgeAPI::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The ID of the account in which this event occurred
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
17
+
18
+ # The data associated with the event
19
+ sig { returns(SurgeAPI::RecordingCompletedWebhookEvent::Data) }
20
+ attr_reader :data
21
+
22
+ sig do
23
+ params(
24
+ data: SurgeAPI::RecordingCompletedWebhookEvent::Data::OrHash
25
+ ).void
26
+ end
27
+ attr_writer :data
28
+
29
+ # The timestamp when this event occurred, in ISO8601 format
30
+ sig { returns(Time) }
31
+ attr_accessor :timestamp
32
+
33
+ # The type of the event. Always `recording.completed` for this event.
34
+ sig { returns(Symbol) }
35
+ attr_accessor :type
36
+
37
+ sig do
38
+ params(
39
+ account_id: String,
40
+ data: SurgeAPI::RecordingCompletedWebhookEvent::Data::OrHash,
41
+ timestamp: Time,
42
+ type: Symbol
43
+ ).returns(T.attached_class)
44
+ end
45
+ def self.new(
46
+ # The ID of the account in which this event occurred
47
+ account_id:,
48
+ # The data associated with the event
49
+ data:,
50
+ # The timestamp when this event occurred, in ISO8601 format
51
+ timestamp:,
52
+ # The type of the event. Always `recording.completed` for this event.
53
+ type: :"recording.completed"
54
+ )
55
+ end
56
+
57
+ sig do
58
+ override.returns(
59
+ {
60
+ account_id: String,
61
+ data: SurgeAPI::RecordingCompletedWebhookEvent::Data,
62
+ timestamp: Time,
63
+ type: Symbol
64
+ }
65
+ )
66
+ end
67
+ def to_hash
68
+ end
69
+
70
+ class Data < SurgeAPI::Internal::Type::BaseModel
71
+ OrHash =
72
+ T.type_alias do
73
+ T.any(
74
+ SurgeAPI::RecordingCompletedWebhookEvent::Data,
75
+ SurgeAPI::Internal::AnyHash
76
+ )
77
+ end
78
+
79
+ # The unique identifier for the recording
80
+ sig { returns(String) }
81
+ attr_accessor :id
82
+
83
+ # The call that produced this recording
84
+ sig { returns(SurgeAPI::RecordingCompletedWebhookEvent::Data::Call) }
85
+ attr_reader :call
86
+
87
+ sig do
88
+ params(
89
+ call: SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::OrHash
90
+ ).void
91
+ end
92
+ attr_writer :call
93
+
94
+ # The duration of the recording in seconds
95
+ sig { returns(Integer) }
96
+ attr_accessor :duration
97
+
98
+ # The data associated with the event
99
+ sig do
100
+ params(
101
+ id: String,
102
+ call: SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::OrHash,
103
+ duration: Integer
104
+ ).returns(T.attached_class)
105
+ end
106
+ def self.new(
107
+ # The unique identifier for the recording
108
+ id:,
109
+ # The call that produced this recording
110
+ call:,
111
+ # The duration of the recording in seconds
112
+ duration:
113
+ )
114
+ end
115
+
116
+ sig do
117
+ override.returns(
118
+ {
119
+ id: String,
120
+ call: SurgeAPI::RecordingCompletedWebhookEvent::Data::Call,
121
+ duration: Integer
122
+ }
123
+ )
124
+ end
125
+ def to_hash
126
+ end
127
+
128
+ class Call < SurgeAPI::Internal::Type::BaseModel
129
+ OrHash =
130
+ T.type_alias do
131
+ T.any(
132
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call,
133
+ SurgeAPI::Internal::AnyHash
134
+ )
135
+ end
136
+
137
+ # The unique identifier for the call
138
+ sig { returns(String) }
139
+ attr_accessor :id
140
+
141
+ # A contact who has consented to receive messages
142
+ sig { returns(SurgeAPI::Contact) }
143
+ attr_reader :contact
144
+
145
+ sig { params(contact: SurgeAPI::Contact::OrHash).void }
146
+ attr_writer :contact
147
+
148
+ # The duration of the call in seconds
149
+ sig { returns(Integer) }
150
+ attr_accessor :duration
151
+
152
+ # When the call was initiated
153
+ sig { returns(Time) }
154
+ attr_accessor :initiated_at
155
+
156
+ # The status of the call
157
+ sig do
158
+ returns(
159
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
160
+ )
161
+ end
162
+ attr_accessor :status
163
+
164
+ # The call that produced this recording
165
+ sig do
166
+ params(
167
+ id: String,
168
+ contact: SurgeAPI::Contact::OrHash,
169
+ duration: Integer,
170
+ initiated_at: Time,
171
+ status:
172
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::OrSymbol
173
+ ).returns(T.attached_class)
174
+ end
175
+ def self.new(
176
+ # The unique identifier for the call
177
+ id:,
178
+ # A contact who has consented to receive messages
179
+ contact:,
180
+ # The duration of the call in seconds
181
+ duration:,
182
+ # When the call was initiated
183
+ initiated_at:,
184
+ # The status of the call
185
+ status:
186
+ )
187
+ end
188
+
189
+ sig do
190
+ override.returns(
191
+ {
192
+ id: String,
193
+ contact: SurgeAPI::Contact,
194
+ duration: Integer,
195
+ initiated_at: Time,
196
+ status:
197
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
198
+ }
199
+ )
200
+ end
201
+ def to_hash
202
+ end
203
+
204
+ # The status of the call
205
+ module Status
206
+ extend SurgeAPI::Internal::Type::Enum
207
+
208
+ TaggedSymbol =
209
+ T.type_alias do
210
+ T.all(
211
+ Symbol,
212
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status
213
+ )
214
+ end
215
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
216
+
217
+ BUSY =
218
+ T.let(
219
+ :busy,
220
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
221
+ )
222
+ CANCELED =
223
+ T.let(
224
+ :canceled,
225
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
226
+ )
227
+ COMPLETED =
228
+ T.let(
229
+ :completed,
230
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
231
+ )
232
+ FAILED =
233
+ T.let(
234
+ :failed,
235
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
236
+ )
237
+ IN_PROGRESS =
238
+ T.let(
239
+ :in_progress,
240
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
241
+ )
242
+ MISSED =
243
+ T.let(
244
+ :missed,
245
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
246
+ )
247
+ NO_ANSWER =
248
+ T.let(
249
+ :no_answer,
250
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
251
+ )
252
+ QUEUED =
253
+ T.let(
254
+ :queued,
255
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
256
+ )
257
+ RINGING =
258
+ T.let(
259
+ :ringing,
260
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
261
+ )
262
+
263
+ sig do
264
+ override.returns(
265
+ T::Array[
266
+ SurgeAPI::RecordingCompletedWebhookEvent::Data::Call::Status::TaggedSymbol
267
+ ]
268
+ )
269
+ end
270
+ def self.values
271
+ end
272
+ end
273
+ end
274
+ end
275
+ end
276
+ end
277
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class RecordingGetFileParams < SurgeAPI::Internal::Type::BaseModel
6
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
7
+ include SurgeAPI::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(SurgeAPI::RecordingGetFileParams, SurgeAPI::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: SurgeAPI::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: SurgeAPI::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,34 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class RecordingGetFileResponse < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ SurgeAPI::Models::RecordingGetFileResponse,
10
+ SurgeAPI::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # An error response
15
+ sig { returns(SurgeAPI::Error) }
16
+ attr_reader :error
17
+
18
+ sig { params(error: SurgeAPI::Error::OrHash).void }
19
+ attr_writer :error
20
+
21
+ # An error response
22
+ sig { params(error: SurgeAPI::Error::OrHash).returns(T.attached_class) }
23
+ def self.new(
24
+ # An error response
25
+ error:
26
+ )
27
+ end
28
+
29
+ sig { override.returns({ error: SurgeAPI::Error }) }
30
+ def to_hash
31
+ end
32
+ end
33
+ end
34
+ end
@@ -17,7 +17,9 @@ module SurgeAPI
17
17
  SurgeAPI::MessageDeliveredWebhookEvent,
18
18
  SurgeAPI::MessageFailedWebhookEvent,
19
19
  SurgeAPI::MessageReceivedWebhookEvent,
20
- SurgeAPI::MessageSentWebhookEvent
20
+ SurgeAPI::MessageSentWebhookEvent,
21
+ SurgeAPI::RecordingCompletedWebhookEvent,
22
+ SurgeAPI::VoicemailReceivedWebhookEvent
21
23
  )
22
24
  end
23
25
 
@@ -0,0 +1,283 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class VoicemailReceivedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ SurgeAPI::VoicemailReceivedWebhookEvent,
10
+ SurgeAPI::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The ID of the account in which this event occurred
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
17
+
18
+ # The data associated with the event
19
+ sig { returns(SurgeAPI::VoicemailReceivedWebhookEvent::Data) }
20
+ attr_reader :data
21
+
22
+ sig do
23
+ params(data: SurgeAPI::VoicemailReceivedWebhookEvent::Data::OrHash).void
24
+ end
25
+ attr_writer :data
26
+
27
+ # The timestamp when this event occurred, in ISO8601 format
28
+ sig { returns(Time) }
29
+ attr_accessor :timestamp
30
+
31
+ # The type of the event. Always `voicemail.received` for this event.
32
+ sig { returns(Symbol) }
33
+ attr_accessor :type
34
+
35
+ sig do
36
+ params(
37
+ account_id: String,
38
+ data: SurgeAPI::VoicemailReceivedWebhookEvent::Data::OrHash,
39
+ timestamp: Time,
40
+ type: Symbol
41
+ ).returns(T.attached_class)
42
+ end
43
+ def self.new(
44
+ # The ID of the account in which this event occurred
45
+ account_id:,
46
+ # The data associated with the event
47
+ data:,
48
+ # The timestamp when this event occurred, in ISO8601 format
49
+ timestamp:,
50
+ # The type of the event. Always `voicemail.received` for this event.
51
+ type: :"voicemail.received"
52
+ )
53
+ end
54
+
55
+ sig do
56
+ override.returns(
57
+ {
58
+ account_id: String,
59
+ data: SurgeAPI::VoicemailReceivedWebhookEvent::Data,
60
+ timestamp: Time,
61
+ type: Symbol
62
+ }
63
+ )
64
+ end
65
+ def to_hash
66
+ end
67
+
68
+ class Data < SurgeAPI::Internal::Type::BaseModel
69
+ OrHash =
70
+ T.type_alias do
71
+ T.any(
72
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data,
73
+ SurgeAPI::Internal::AnyHash
74
+ )
75
+ end
76
+
77
+ # The unique identifier for the voicemail
78
+ sig { returns(String) }
79
+ attr_accessor :id
80
+
81
+ # The call that resulted in this voicemail
82
+ sig { returns(SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call) }
83
+ attr_reader :call
84
+
85
+ sig do
86
+ params(
87
+ call: SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::OrHash
88
+ ).void
89
+ end
90
+ attr_writer :call
91
+
92
+ # The duration of the voicemail in seconds
93
+ sig { returns(Integer) }
94
+ attr_accessor :duration
95
+
96
+ # The unique identifier for the recording
97
+ sig { returns(String) }
98
+ attr_accessor :recording_id
99
+
100
+ # The data associated with the event
101
+ sig do
102
+ params(
103
+ id: String,
104
+ call: SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::OrHash,
105
+ duration: Integer,
106
+ recording_id: String
107
+ ).returns(T.attached_class)
108
+ end
109
+ def self.new(
110
+ # The unique identifier for the voicemail
111
+ id:,
112
+ # The call that resulted in this voicemail
113
+ call:,
114
+ # The duration of the voicemail in seconds
115
+ duration:,
116
+ # The unique identifier for the recording
117
+ recording_id:
118
+ )
119
+ end
120
+
121
+ sig do
122
+ override.returns(
123
+ {
124
+ id: String,
125
+ call: SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call,
126
+ duration: Integer,
127
+ recording_id: String
128
+ }
129
+ )
130
+ end
131
+ def to_hash
132
+ end
133
+
134
+ class Call < SurgeAPI::Internal::Type::BaseModel
135
+ OrHash =
136
+ T.type_alias do
137
+ T.any(
138
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call,
139
+ SurgeAPI::Internal::AnyHash
140
+ )
141
+ end
142
+
143
+ # The unique identifier for the call
144
+ sig { returns(String) }
145
+ attr_accessor :id
146
+
147
+ # A contact who has consented to receive messages
148
+ sig { returns(SurgeAPI::Contact) }
149
+ attr_reader :contact
150
+
151
+ sig { params(contact: SurgeAPI::Contact::OrHash).void }
152
+ attr_writer :contact
153
+
154
+ # The duration of the call in seconds
155
+ sig { returns(Integer) }
156
+ attr_accessor :duration
157
+
158
+ # When the call was initiated
159
+ sig { returns(Time) }
160
+ attr_accessor :initiated_at
161
+
162
+ # The status of the call
163
+ sig do
164
+ returns(
165
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
166
+ )
167
+ end
168
+ attr_accessor :status
169
+
170
+ # The call that resulted in this voicemail
171
+ sig do
172
+ params(
173
+ id: String,
174
+ contact: SurgeAPI::Contact::OrHash,
175
+ duration: Integer,
176
+ initiated_at: Time,
177
+ status:
178
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::OrSymbol
179
+ ).returns(T.attached_class)
180
+ end
181
+ def self.new(
182
+ # The unique identifier for the call
183
+ id:,
184
+ # A contact who has consented to receive messages
185
+ contact:,
186
+ # The duration of the call in seconds
187
+ duration:,
188
+ # When the call was initiated
189
+ initiated_at:,
190
+ # The status of the call
191
+ status:
192
+ )
193
+ end
194
+
195
+ sig do
196
+ override.returns(
197
+ {
198
+ id: String,
199
+ contact: SurgeAPI::Contact,
200
+ duration: Integer,
201
+ initiated_at: Time,
202
+ status:
203
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
204
+ }
205
+ )
206
+ end
207
+ def to_hash
208
+ end
209
+
210
+ # The status of the call
211
+ module Status
212
+ extend SurgeAPI::Internal::Type::Enum
213
+
214
+ TaggedSymbol =
215
+ T.type_alias do
216
+ T.all(
217
+ Symbol,
218
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status
219
+ )
220
+ end
221
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
222
+
223
+ BUSY =
224
+ T.let(
225
+ :busy,
226
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
227
+ )
228
+ CANCELED =
229
+ T.let(
230
+ :canceled,
231
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
232
+ )
233
+ COMPLETED =
234
+ T.let(
235
+ :completed,
236
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
237
+ )
238
+ FAILED =
239
+ T.let(
240
+ :failed,
241
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
242
+ )
243
+ IN_PROGRESS =
244
+ T.let(
245
+ :in_progress,
246
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
247
+ )
248
+ MISSED =
249
+ T.let(
250
+ :missed,
251
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
252
+ )
253
+ NO_ANSWER =
254
+ T.let(
255
+ :no_answer,
256
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
257
+ )
258
+ QUEUED =
259
+ T.let(
260
+ :queued,
261
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
262
+ )
263
+ RINGING =
264
+ T.let(
265
+ :ringing,
266
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
267
+ )
268
+
269
+ sig do
270
+ override.returns(
271
+ T::Array[
272
+ SurgeAPI::VoicemailReceivedWebhookEvent::Data::Call::Status::TaggedSymbol
273
+ ]
274
+ )
275
+ end
276
+ def self.values
277
+ end
278
+ end
279
+ end
280
+ end
281
+ end
282
+ end
283
+ end
@@ -27,10 +27,14 @@ module SurgeAPI
27
27
 
28
28
  CampaignParams = SurgeAPI::Models::CampaignParams
29
29
 
30
+ CampaignRetrieveParams = SurgeAPI::Models::CampaignRetrieveParams
31
+
30
32
  Contact = SurgeAPI::Models::Contact
31
33
 
32
34
  ContactCreateParams = SurgeAPI::Models::ContactCreateParams
33
35
 
36
+ ContactListParams = SurgeAPI::Models::ContactListParams
37
+
34
38
  ContactOptedInWebhookEvent = SurgeAPI::Models::ContactOptedInWebhookEvent
35
39
 
36
40
  ContactOptedOutWebhookEvent = SurgeAPI::Models::ContactOptedOutWebhookEvent
@@ -54,6 +58,8 @@ module SurgeAPI
54
58
 
55
59
  MessageFailedWebhookEvent = SurgeAPI::Models::MessageFailedWebhookEvent
56
60
 
61
+ MessageListParams = SurgeAPI::Models::MessageListParams
62
+
57
63
  MessageParams = SurgeAPI::Models::MessageParams
58
64
 
59
65
  MessageReceivedWebhookEvent = SurgeAPI::Models::MessageReceivedWebhookEvent
@@ -66,8 +72,15 @@ module SurgeAPI
66
72
 
67
73
  PhoneNumber = SurgeAPI::Models::PhoneNumber
68
74
 
75
+ PhoneNumberListParams = SurgeAPI::Models::PhoneNumberListParams
76
+
69
77
  PhoneNumberPurchaseParams = SurgeAPI::Models::PhoneNumberPurchaseParams
70
78
 
79
+ RecordingCompletedWebhookEvent =
80
+ SurgeAPI::Models::RecordingCompletedWebhookEvent
81
+
82
+ RecordingGetFileParams = SurgeAPI::Models::RecordingGetFileParams
83
+
71
84
  UnwrapWebhookEvent = SurgeAPI::Models::UnwrapWebhookEvent
72
85
 
73
86
  User = SurgeAPI::Models::User
@@ -92,5 +105,8 @@ module SurgeAPI
92
105
 
93
106
  VerificationCreateParams = SurgeAPI::Models::VerificationCreateParams
94
107
 
108
+ VoicemailReceivedWebhookEvent =
109
+ SurgeAPI::Models::VoicemailReceivedWebhookEvent
110
+
95
111
  WebhookUnwrapParams = SurgeAPI::Models::WebhookUnwrapParams
96
112
  end
@@ -9,7 +9,7 @@ module SurgeAPI
9
9
  account_id: String,
10
10
  attachments:
11
11
  T::Array[SurgeAPI::BlastCreateParams::Attachment::OrHash],
12
- body: String,
12
+ body: T.nilable(String),
13
13
  contacts: T::Array[String],
14
14
  from: String,
15
15
  name: String,
@@ -21,6 +21,20 @@ module SurgeAPI
21
21
  )
22
22
  end
23
23
 
24
+ # Retrieves a Campaign object.
25
+ sig do
26
+ params(
27
+ id: String,
28
+ request_options: SurgeAPI::RequestOptions::OrHash
29
+ ).returns(SurgeAPI::Campaign)
30
+ end
31
+ def retrieve(
32
+ # The ID of the campaign to retrieve.
33
+ id,
34
+ request_options: {}
35
+ )
36
+ end
37
+
24
38
  # @api private
25
39
  sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
26
40
  def self.new(client:)