surge_api 0.9.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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +1 -1
  4. data/lib/surge_api/client.rb +4 -0
  5. data/lib/surge_api/internal/util.rb +1 -1
  6. data/lib/surge_api/models/campaign.rb +27 -1
  7. data/lib/surge_api/models/campaign_retrieve_params.rb +14 -0
  8. data/lib/surge_api/models/message.rb +2 -2
  9. data/lib/surge_api/models/recording_completed_webhook_event.rb +136 -0
  10. data/lib/surge_api/models/recording_get_file_params.rb +14 -0
  11. data/lib/surge_api/models/recording_get_file_response.rb +19 -0
  12. data/lib/surge_api/models/unwrap_webhook_event.rb +5 -1
  13. data/lib/surge_api/models/voicemail_received_webhook_event.rb +144 -0
  14. data/lib/surge_api/models.rb +8 -0
  15. data/lib/surge_api/resources/campaigns.rb +20 -0
  16. data/lib/surge_api/resources/recordings.rb +35 -0
  17. data/lib/surge_api/resources/webhooks.rb +1 -1
  18. data/lib/surge_api/version.rb +1 -1
  19. data/lib/surge_api.rb +6 -0
  20. data/rbi/surge_api/client.rbi +3 -0
  21. data/rbi/surge_api/internal/util.rbi +1 -1
  22. data/rbi/surge_api/models/campaign.rbi +32 -0
  23. data/rbi/surge_api/models/campaign_retrieve_params.rbi +27 -0
  24. data/rbi/surge_api/models/message.rbi +3 -6
  25. data/rbi/surge_api/models/recording_completed_webhook_event.rbi +277 -0
  26. data/rbi/surge_api/models/recording_get_file_params.rbi +27 -0
  27. data/rbi/surge_api/models/recording_get_file_response.rbi +34 -0
  28. data/rbi/surge_api/models/unwrap_webhook_event.rbi +3 -1
  29. data/rbi/surge_api/models/voicemail_received_webhook_event.rbi +283 -0
  30. data/rbi/surge_api/models.rbi +10 -0
  31. data/rbi/surge_api/resources/campaigns.rbi +14 -0
  32. data/rbi/surge_api/resources/recordings.rbi +27 -0
  33. data/rbi/surge_api/resources/webhooks.rbi +3 -1
  34. data/sig/surge_api/client.rbs +2 -0
  35. data/sig/surge_api/models/campaign.rbs +28 -0
  36. data/sig/surge_api/models/campaign_retrieve_params.rbs +15 -0
  37. data/sig/surge_api/models/message.rbs +4 -6
  38. data/sig/surge_api/models/recording_completed_webhook_event.rbs +126 -0
  39. data/sig/surge_api/models/recording_get_file_params.rbs +15 -0
  40. data/sig/surge_api/models/recording_get_file_response.rbs +13 -0
  41. data/sig/surge_api/models/unwrap_webhook_event.rbs +2 -0
  42. data/sig/surge_api/models/voicemail_received_webhook_event.rbs +131 -0
  43. data/sig/surge_api/models.rbs +8 -0
  44. data/sig/surge_api/resources/campaigns.rbs +5 -0
  45. data/sig/surge_api/resources/recordings.rbs +12 -0
  46. data/sig/surge_api/resources/webhooks.rbs +3 -1
  47. metadata +20 -2
@@ -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,6 +27,8 @@ 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
@@ -74,6 +76,11 @@ module SurgeAPI
74
76
 
75
77
  PhoneNumberPurchaseParams = SurgeAPI::Models::PhoneNumberPurchaseParams
76
78
 
79
+ RecordingCompletedWebhookEvent =
80
+ SurgeAPI::Models::RecordingCompletedWebhookEvent
81
+
82
+ RecordingGetFileParams = SurgeAPI::Models::RecordingGetFileParams
83
+
77
84
  UnwrapWebhookEvent = SurgeAPI::Models::UnwrapWebhookEvent
78
85
 
79
86
  User = SurgeAPI::Models::User
@@ -98,5 +105,8 @@ module SurgeAPI
98
105
 
99
106
  VerificationCreateParams = SurgeAPI::Models::VerificationCreateParams
100
107
 
108
+ VoicemailReceivedWebhookEvent =
109
+ SurgeAPI::Models::VoicemailReceivedWebhookEvent
110
+
101
111
  WebhookUnwrapParams = SurgeAPI::Models::WebhookUnwrapParams
102
112
  end
@@ -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:)
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Resources
5
+ class Recordings
6
+ # Redirects to a signed URL where the recording audio file can be downloaded. URL
7
+ # is short-lived, so redirect should be followed immediately.
8
+ sig do
9
+ params(
10
+ recording_id: String,
11
+ request_options: SurgeAPI::RequestOptions::OrHash
12
+ ).returns(SurgeAPI::Models::RecordingGetFileResponse)
13
+ end
14
+ def get_file(
15
+ # The ID of the recording.
16
+ recording_id,
17
+ request_options: {}
18
+ )
19
+ end
20
+
21
+ # @api private
22
+ sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
23
+ def self.new(client:)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -15,7 +15,9 @@ module SurgeAPI
15
15
  SurgeAPI::MessageDeliveredWebhookEvent,
16
16
  SurgeAPI::MessageFailedWebhookEvent,
17
17
  SurgeAPI::MessageReceivedWebhookEvent,
18
- SurgeAPI::MessageSentWebhookEvent
18
+ SurgeAPI::MessageSentWebhookEvent,
19
+ SurgeAPI::RecordingCompletedWebhookEvent,
20
+ SurgeAPI::VoicemailReceivedWebhookEvent
19
21
  )
20
22
  )
21
23
  end
@@ -22,6 +22,8 @@ module SurgeAPI
22
22
 
23
23
  attr_reader phone_numbers: SurgeAPI::Resources::PhoneNumbers
24
24
 
25
+ attr_reader recordings: SurgeAPI::Resources::Recordings
26
+
25
27
  attr_reader users: SurgeAPI::Resources::Users
26
28
 
27
29
  attr_reader verifications: SurgeAPI::Resources::Verifications
@@ -8,6 +8,7 @@ module SurgeAPI
8
8
  includes: ::Array[SurgeAPI::Models::Campaign::include_],
9
9
  message_samples: ::Array[String],
10
10
  privacy_policy_url: String,
11
+ status: SurgeAPI::Models::Campaign::status,
11
12
  use_cases: ::Array[SurgeAPI::Models::Campaign::use_case],
12
13
  volume: SurgeAPI::Models::Campaign::volume,
13
14
  link_sample: String,
@@ -27,6 +28,8 @@ module SurgeAPI
27
28
 
28
29
  attr_accessor privacy_policy_url: String
29
30
 
31
+ attr_accessor status: SurgeAPI::Models::Campaign::status
32
+
30
33
  attr_accessor use_cases: ::Array[SurgeAPI::Models::Campaign::use_case]
31
34
 
32
35
  attr_accessor volume: SurgeAPI::Models::Campaign::volume
@@ -46,6 +49,7 @@ module SurgeAPI
46
49
  includes: ::Array[SurgeAPI::Models::Campaign::include_],
47
50
  message_samples: ::Array[String],
48
51
  privacy_policy_url: String,
52
+ status: SurgeAPI::Models::Campaign::status,
49
53
  use_cases: ::Array[SurgeAPI::Models::Campaign::use_case],
50
54
  volume: SurgeAPI::Models::Campaign::volume,
51
55
  ?link_sample: String,
@@ -59,6 +63,7 @@ module SurgeAPI
59
63
  includes: ::Array[SurgeAPI::Models::Campaign::include_],
60
64
  message_samples: ::Array[String],
61
65
  privacy_policy_url: String,
66
+ status: SurgeAPI::Models::Campaign::status,
62
67
  use_cases: ::Array[SurgeAPI::Models::Campaign::use_case],
63
68
  volume: SurgeAPI::Models::Campaign::volume,
64
69
  link_sample: String,
@@ -78,6 +83,29 @@ module SurgeAPI
78
83
  def self?.values: -> ::Array[SurgeAPI::Models::Campaign::include_]
79
84
  end
80
85
 
86
+ type status =
87
+ :active
88
+ | :canceled
89
+ | :created
90
+ | :deactivated
91
+ | :in_review
92
+ | :pending
93
+ | :rejected
94
+
95
+ module Status
96
+ extend SurgeAPI::Internal::Type::Enum
97
+
98
+ ACTIVE: :active
99
+ CANCELED: :canceled
100
+ CREATED: :created
101
+ DEACTIVATED: :deactivated
102
+ IN_REVIEW: :in_review
103
+ PENDING: :pending
104
+ REJECTED: :rejected
105
+
106
+ def self?.values: -> ::Array[SurgeAPI::Models::Campaign::status]
107
+ end
108
+
81
109
  type use_case =
82
110
  :account_notification
83
111
  | :customer_care
@@ -0,0 +1,15 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type campaign_retrieve_params =
4
+ { } & SurgeAPI::Internal::Type::request_parameters
5
+
6
+ class CampaignRetrieveParams < SurgeAPI::Internal::Type::BaseModel
7
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
+ include SurgeAPI::Internal::Type::RequestParameters
9
+
10
+ def initialize: (?request_options: SurgeAPI::request_opts) -> void
11
+
12
+ def to_hash: -> { request_options: SurgeAPI::RequestOptions }
13
+ end
14
+ end
15
+ end
@@ -4,7 +4,7 @@ module SurgeAPI
4
4
  {
5
5
  id: String,
6
6
  attachments: ::Array[SurgeAPI::Message::Attachment],
7
- blast_id: String,
7
+ blast_id: String?,
8
8
  body: String?,
9
9
  conversation: SurgeAPI::Message::Conversation,
10
10
  metadata: ::Hash[Symbol, String]
@@ -21,9 +21,7 @@ module SurgeAPI
21
21
  ::Array[SurgeAPI::Message::Attachment]
22
22
  ) -> ::Array[SurgeAPI::Message::Attachment]
23
23
 
24
- attr_reader blast_id: String?
25
-
26
- def blast_id=: (String) -> String
24
+ attr_accessor blast_id: String?
27
25
 
28
26
  attr_accessor body: String?
29
27
 
@@ -40,7 +38,7 @@ module SurgeAPI
40
38
  def initialize: (
41
39
  ?id: String,
42
40
  ?attachments: ::Array[SurgeAPI::Message::Attachment],
43
- ?blast_id: String,
41
+ ?blast_id: String?,
44
42
  ?body: String?,
45
43
  ?conversation: SurgeAPI::Message::Conversation,
46
44
  ?metadata: ::Hash[Symbol, String]
@@ -49,7 +47,7 @@ module SurgeAPI
49
47
  def to_hash: -> {
50
48
  id: String,
51
49
  attachments: ::Array[SurgeAPI::Message::Attachment],
52
- blast_id: String,
50
+ blast_id: String?,
53
51
  body: String?,
54
52
  conversation: SurgeAPI::Message::Conversation,
55
53
  metadata: ::Hash[Symbol, String]
@@ -0,0 +1,126 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type recording_completed_webhook_event =
4
+ {
5
+ account_id: String,
6
+ data: SurgeAPI::RecordingCompletedWebhookEvent::Data,
7
+ timestamp: Time,
8
+ type: :"recording.completed"
9
+ }
10
+
11
+ class RecordingCompletedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
12
+ attr_accessor account_id: String
13
+
14
+ attr_accessor data: SurgeAPI::RecordingCompletedWebhookEvent::Data
15
+
16
+ attr_accessor timestamp: Time
17
+
18
+ attr_accessor type: :"recording.completed"
19
+
20
+ def initialize: (
21
+ account_id: String,
22
+ data: SurgeAPI::RecordingCompletedWebhookEvent::Data,
23
+ timestamp: Time,
24
+ ?type: :"recording.completed"
25
+ ) -> void
26
+
27
+ def to_hash: -> {
28
+ account_id: String,
29
+ data: SurgeAPI::RecordingCompletedWebhookEvent::Data,
30
+ timestamp: Time,
31
+ type: :"recording.completed"
32
+ }
33
+
34
+ type data =
35
+ {
36
+ id: String,
37
+ call: SurgeAPI::RecordingCompletedWebhookEvent::Data::Call,
38
+ duration: Integer
39
+ }
40
+
41
+ class Data < SurgeAPI::Internal::Type::BaseModel
42
+ attr_accessor id: String
43
+
44
+ attr_accessor call: SurgeAPI::RecordingCompletedWebhookEvent::Data::Call
45
+
46
+ attr_accessor duration: Integer
47
+
48
+ def initialize: (
49
+ id: String,
50
+ call: SurgeAPI::RecordingCompletedWebhookEvent::Data::Call,
51
+ duration: Integer
52
+ ) -> void
53
+
54
+ def to_hash: -> {
55
+ id: String,
56
+ call: SurgeAPI::RecordingCompletedWebhookEvent::Data::Call,
57
+ duration: Integer
58
+ }
59
+
60
+ type call =
61
+ {
62
+ id: String,
63
+ contact: SurgeAPI::Contact,
64
+ duration: Integer,
65
+ initiated_at: Time,
66
+ status: SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::status
67
+ }
68
+
69
+ class Call < SurgeAPI::Internal::Type::BaseModel
70
+ attr_accessor id: String
71
+
72
+ attr_accessor contact: SurgeAPI::Contact
73
+
74
+ attr_accessor duration: Integer
75
+
76
+ attr_accessor initiated_at: Time
77
+
78
+ attr_accessor status: SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::status
79
+
80
+ def initialize: (
81
+ id: String,
82
+ contact: SurgeAPI::Contact,
83
+ duration: Integer,
84
+ initiated_at: Time,
85
+ status: SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::status
86
+ ) -> void
87
+
88
+ def to_hash: -> {
89
+ id: String,
90
+ contact: SurgeAPI::Contact,
91
+ duration: Integer,
92
+ initiated_at: Time,
93
+ status: SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::status
94
+ }
95
+
96
+ type status =
97
+ :busy
98
+ | :canceled
99
+ | :completed
100
+ | :failed
101
+ | :in_progress
102
+ | :missed
103
+ | :no_answer
104
+ | :queued
105
+ | :ringing
106
+
107
+ module Status
108
+ extend SurgeAPI::Internal::Type::Enum
109
+
110
+ BUSY: :busy
111
+ CANCELED: :canceled
112
+ COMPLETED: :completed
113
+ FAILED: :failed
114
+ IN_PROGRESS: :in_progress
115
+ MISSED: :missed
116
+ NO_ANSWER: :no_answer
117
+ QUEUED: :queued
118
+ RINGING: :ringing
119
+
120
+ def self?.values: -> ::Array[SurgeAPI::Models::RecordingCompletedWebhookEvent::Data::Call::status]
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
@@ -0,0 +1,15 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type recording_get_file_params =
4
+ { } & SurgeAPI::Internal::Type::request_parameters
5
+
6
+ class RecordingGetFileParams < SurgeAPI::Internal::Type::BaseModel
7
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
+ include SurgeAPI::Internal::Type::RequestParameters
9
+
10
+ def initialize: (?request_options: SurgeAPI::request_opts) -> void
11
+
12
+ def to_hash: -> { request_options: SurgeAPI::RequestOptions }
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ module SurgeAPI
2
+ module Models
3
+ type recording_get_file_response = { error: SurgeAPI::Error }
4
+
5
+ class RecordingGetFileResponse < SurgeAPI::Internal::Type::BaseModel
6
+ attr_accessor error: SurgeAPI::Error
7
+
8
+ def initialize: (error: SurgeAPI::Error) -> void
9
+
10
+ def to_hash: -> { error: SurgeAPI::Error }
11
+ end
12
+ end
13
+ end
@@ -11,6 +11,8 @@ module SurgeAPI
11
11
  | SurgeAPI::MessageFailedWebhookEvent
12
12
  | SurgeAPI::MessageReceivedWebhookEvent
13
13
  | SurgeAPI::MessageSentWebhookEvent
14
+ | SurgeAPI::RecordingCompletedWebhookEvent
15
+ | SurgeAPI::VoicemailReceivedWebhookEvent
14
16
 
15
17
  module UnwrapWebhookEvent
16
18
  extend SurgeAPI::Internal::Type::Union