surge_api 0.22.0 → 0.24.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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/surge_api/models/account_create_params.rb +8 -4
  5. data/lib/surge_api/models/account_retrieve_status_params.rb +1 -0
  6. data/lib/surge_api/models/account_update_params.rb +8 -4
  7. data/lib/surge_api/models/campaign.rb +6 -6
  8. data/lib/surge_api/models/campaign_params.rb +5 -6
  9. data/lib/surge_api/models/contact.rb +9 -1
  10. data/lib/surge_api/models/contact_create_params.rb +9 -1
  11. data/lib/surge_api/models/contact_update_params.rb +9 -1
  12. data/lib/surge_api/models/message.rb +25 -1
  13. data/lib/surge_api/models/message_delivered_webhook_event.rb +21 -1
  14. data/lib/surge_api/models/message_failed_webhook_event.rb +21 -1
  15. data/lib/surge_api/models/message_params.rb +9 -1
  16. data/lib/surge_api/models/message_received_webhook_event.rb +21 -1
  17. data/lib/surge_api/models/message_sent_webhook_event.rb +21 -1
  18. data/lib/surge_api/models/organization.rb +8 -4
  19. data/lib/surge_api/models/phone_number_imported_webhook_event.rb +152 -0
  20. data/lib/surge_api/models/unwrap_webhook_event.rb +3 -1
  21. data/lib/surge_api/models.rb +2 -0
  22. data/lib/surge_api/resources/contacts.rb +6 -2
  23. data/lib/surge_api/resources/webhooks.rb +1 -1
  24. data/lib/surge_api/version.rb +1 -1
  25. data/lib/surge_api.rb +1 -0
  26. data/rbi/surge_api/models/account_create_params.rbi +15 -5
  27. data/rbi/surge_api/models/account_retrieve_status_params.rbi +5 -0
  28. data/rbi/surge_api/models/account_update_params.rbi +15 -5
  29. data/rbi/surge_api/models/campaign.rbi +9 -10
  30. data/rbi/surge_api/models/campaign_params.rbi +8 -10
  31. data/rbi/surge_api/models/contact.rbi +14 -3
  32. data/rbi/surge_api/models/contact_create_params.rbi +11 -0
  33. data/rbi/surge_api/models/contact_update_params.rbi +11 -0
  34. data/rbi/surge_api/models/message.rbi +34 -3
  35. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +44 -0
  36. data/rbi/surge_api/models/message_failed_webhook_event.rbi +40 -0
  37. data/rbi/surge_api/models/message_params.rbi +14 -3
  38. data/rbi/surge_api/models/message_received_webhook_event.rbi +41 -0
  39. data/rbi/surge_api/models/message_sent_webhook_event.rbi +38 -0
  40. data/rbi/surge_api/models/organization.rbi +11 -5
  41. data/rbi/surge_api/models/phone_number_imported_webhook_event.rbi +310 -0
  42. data/rbi/surge_api/models/unwrap_webhook_event.rbi +1 -0
  43. data/rbi/surge_api/models.rbi +3 -0
  44. data/rbi/surge_api/resources/contacts.rbi +6 -0
  45. data/rbi/surge_api/resources/webhooks.rbi +1 -0
  46. data/sig/surge_api/models/account_create_params.rbs +2 -1
  47. data/sig/surge_api/models/account_retrieve_status_params.rbs +2 -1
  48. data/sig/surge_api/models/account_update_params.rbs +2 -1
  49. data/sig/surge_api/models/campaign.rbs +3 -1
  50. data/sig/surge_api/models/contact.rbs +10 -3
  51. data/sig/surge_api/models/contact_create_params.rbs +8 -1
  52. data/sig/surge_api/models/contact_update_params.rbs +8 -1
  53. data/sig/surge_api/models/message.rbs +26 -3
  54. data/sig/surge_api/models/message_delivered_webhook_event.rbs +15 -0
  55. data/sig/surge_api/models/message_failed_webhook_event.rbs +15 -0
  56. data/sig/surge_api/models/message_params.rbs +10 -3
  57. data/sig/surge_api/models/message_received_webhook_event.rbs +15 -0
  58. data/sig/surge_api/models/message_sent_webhook_event.rbs +15 -0
  59. data/sig/surge_api/models/organization.rbs +2 -1
  60. data/sig/surge_api/models/phone_number_imported_webhook_event.rbs +125 -0
  61. data/sig/surge_api/models/unwrap_webhook_event.rbs +1 -0
  62. data/sig/surge_api/models.rbs +2 -0
  63. data/sig/surge_api/resources/contacts.rbs +2 -0
  64. data/sig/surge_api/resources/webhooks.rbs +1 -0
  65. metadata +5 -2
@@ -104,6 +104,14 @@ module SurgeAPI
104
104
  sig { returns(T::Hash[Symbol, String]) }
105
105
  attr_accessor :metadata
106
106
 
107
+ # The message status represented by this event
108
+ sig do
109
+ returns(
110
+ SurgeAPI::MessageDeliveredWebhookEvent::Data::Status::TaggedSymbol
111
+ )
112
+ end
113
+ attr_accessor :status
114
+
107
115
  # Attachments included with the message
108
116
  sig do
109
117
  returns(
@@ -141,6 +149,8 @@ module SurgeAPI
141
149
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Conversation::OrHash,
142
150
  delivered_at: Time,
143
151
  metadata: T::Hash[Symbol, String],
152
+ status:
153
+ SurgeAPI::MessageDeliveredWebhookEvent::Data::Status::OrSymbol,
144
154
  attachments:
145
155
  T::Array[
146
156
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Attachment::OrHash
@@ -159,6 +169,8 @@ module SurgeAPI
159
169
  delivered_at:,
160
170
  # Set of key-value pairs that will be stored with the object.
161
171
  metadata:,
172
+ # The message status represented by this event
173
+ status:,
162
174
  # Attachments included with the message
163
175
  attachments: nil,
164
176
  # The ID of the blast this message belongs to, if any. This can be used to
@@ -176,6 +188,8 @@ module SurgeAPI
176
188
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Conversation,
177
189
  delivered_at: Time,
178
190
  metadata: T::Hash[Symbol, String],
191
+ status:
192
+ SurgeAPI::MessageDeliveredWebhookEvent::Data::Status::TaggedSymbol,
179
193
  attachments:
180
194
  T::Array[
181
195
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Attachment
@@ -245,6 +259,36 @@ module SurgeAPI
245
259
  end
246
260
  end
247
261
 
262
+ # The message status represented by this event
263
+ module Status
264
+ extend SurgeAPI::Internal::Type::Enum
265
+
266
+ TaggedSymbol =
267
+ T.type_alias do
268
+ T.all(
269
+ Symbol,
270
+ SurgeAPI::MessageDeliveredWebhookEvent::Data::Status
271
+ )
272
+ end
273
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
274
+
275
+ DELIVERED =
276
+ T.let(
277
+ :delivered,
278
+ SurgeAPI::MessageDeliveredWebhookEvent::Data::Status::TaggedSymbol
279
+ )
280
+
281
+ sig do
282
+ override.returns(
283
+ T::Array[
284
+ SurgeAPI::MessageDeliveredWebhookEvent::Data::Status::TaggedSymbol
285
+ ]
286
+ )
287
+ end
288
+ def self.values
289
+ end
290
+ end
291
+
248
292
  class Attachment < SurgeAPI::Internal::Type::BaseModel
249
293
  OrHash =
250
294
  T.type_alias do
@@ -106,6 +106,14 @@ module SurgeAPI
106
106
  sig { returns(T::Hash[Symbol, String]) }
107
107
  attr_accessor :metadata
108
108
 
109
+ # The message status represented by this event
110
+ sig do
111
+ returns(
112
+ SurgeAPI::MessageFailedWebhookEvent::Data::Status::TaggedSymbol
113
+ )
114
+ end
115
+ attr_accessor :status
116
+
109
117
  # Attachments included with the message
110
118
  sig do
111
119
  returns(
@@ -144,6 +152,7 @@ module SurgeAPI
144
152
  failed_at: Time,
145
153
  failure_reason: String,
146
154
  metadata: T::Hash[Symbol, String],
155
+ status: SurgeAPI::MessageFailedWebhookEvent::Data::Status::OrSymbol,
147
156
  attachments:
148
157
  T::Array[
149
158
  SurgeAPI::MessageFailedWebhookEvent::Data::Attachment::OrHash
@@ -164,6 +173,8 @@ module SurgeAPI
164
173
  failure_reason:,
165
174
  # Set of key-value pairs that will be stored with the object.
166
175
  metadata:,
176
+ # The message status represented by this event
177
+ status:,
167
178
  # Attachments included with the message
168
179
  attachments: nil,
169
180
  # The ID of the blast this message belongs to, if any. This can be used to
@@ -182,6 +193,8 @@ module SurgeAPI
182
193
  failed_at: Time,
183
194
  failure_reason: String,
184
195
  metadata: T::Hash[Symbol, String],
196
+ status:
197
+ SurgeAPI::MessageFailedWebhookEvent::Data::Status::TaggedSymbol,
185
198
  attachments:
186
199
  T::Array[SurgeAPI::MessageFailedWebhookEvent::Data::Attachment],
187
200
  blast_id: String
@@ -249,6 +262,33 @@ module SurgeAPI
249
262
  end
250
263
  end
251
264
 
265
+ # The message status represented by this event
266
+ module Status
267
+ extend SurgeAPI::Internal::Type::Enum
268
+
269
+ TaggedSymbol =
270
+ T.type_alias do
271
+ T.all(Symbol, SurgeAPI::MessageFailedWebhookEvent::Data::Status)
272
+ end
273
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
274
+
275
+ FAILED =
276
+ T.let(
277
+ :failed,
278
+ SurgeAPI::MessageFailedWebhookEvent::Data::Status::TaggedSymbol
279
+ )
280
+
281
+ sig do
282
+ override.returns(
283
+ T::Array[
284
+ SurgeAPI::MessageFailedWebhookEvent::Data::Status::TaggedSymbol
285
+ ]
286
+ )
287
+ end
288
+ def self.values
289
+ end
290
+ end
291
+
252
292
  class Attachment < SurgeAPI::Internal::Type::BaseModel
253
293
  OrHash =
254
294
  T.type_alias do
@@ -261,6 +261,13 @@ module SurgeAPI
261
261
  sig { params(metadata: T::Hash[Symbol, String]).void }
262
262
  attr_writer :metadata
263
263
 
264
+ # Whether outbound messaging should be manually disabled for the contact.
265
+ sig { returns(T.nilable(T::Boolean)) }
266
+ attr_reader :outbound_disabled
267
+
268
+ sig { params(outbound_disabled: T::Boolean).void }
269
+ attr_writer :outbound_disabled
270
+
264
271
  # Parameters for creating a contact
265
272
  sig do
266
273
  params(
@@ -268,7 +275,8 @@ module SurgeAPI
268
275
  email: String,
269
276
  first_name: String,
270
277
  last_name: String,
271
- metadata: T::Hash[Symbol, String]
278
+ metadata: T::Hash[Symbol, String],
279
+ outbound_disabled: T::Boolean
272
280
  ).returns(T.attached_class)
273
281
  end
274
282
  def self.new(
@@ -281,7 +289,9 @@ module SurgeAPI
281
289
  # The contact's last name.
282
290
  last_name: nil,
283
291
  # Set of key-value pairs that will be stored with the object.
284
- metadata: nil
292
+ metadata: nil,
293
+ # Whether outbound messaging should be manually disabled for the contact.
294
+ outbound_disabled: nil
285
295
  )
286
296
  end
287
297
 
@@ -292,7 +302,8 @@ module SurgeAPI
292
302
  email: String,
293
303
  first_name: String,
294
304
  last_name: String,
295
- metadata: T::Hash[Symbol, String]
305
+ metadata: T::Hash[Symbol, String],
306
+ outbound_disabled: T::Boolean
296
307
  }
297
308
  )
298
309
  end
@@ -104,6 +104,14 @@ module SurgeAPI
104
104
  sig { returns(Time) }
105
105
  attr_accessor :received_at
106
106
 
107
+ # The message status represented by this event
108
+ sig do
109
+ returns(
110
+ SurgeAPI::MessageReceivedWebhookEvent::Data::Status::TaggedSymbol
111
+ )
112
+ end
113
+ attr_accessor :status
114
+
107
115
  # Attachments included with the message
108
116
  sig do
109
117
  returns(
@@ -141,6 +149,8 @@ module SurgeAPI
141
149
  SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation::OrHash,
142
150
  metadata: T::Hash[Symbol, String],
143
151
  received_at: Time,
152
+ status:
153
+ SurgeAPI::MessageReceivedWebhookEvent::Data::Status::OrSymbol,
144
154
  attachments:
145
155
  T::Array[
146
156
  SurgeAPI::MessageReceivedWebhookEvent::Data::Attachment::OrHash
@@ -159,6 +169,8 @@ module SurgeAPI
159
169
  metadata:,
160
170
  # When the message was received
161
171
  received_at:,
172
+ # The message status represented by this event
173
+ status:,
162
174
  # Attachments included with the message
163
175
  attachments: nil,
164
176
  # The ID of the blast this message belongs to, if any. This can be used to
@@ -176,6 +188,8 @@ module SurgeAPI
176
188
  SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation,
177
189
  metadata: T::Hash[Symbol, String],
178
190
  received_at: Time,
191
+ status:
192
+ SurgeAPI::MessageReceivedWebhookEvent::Data::Status::TaggedSymbol,
179
193
  attachments:
180
194
  T::Array[
181
195
  SurgeAPI::MessageReceivedWebhookEvent::Data::Attachment
@@ -245,6 +259,33 @@ module SurgeAPI
245
259
  end
246
260
  end
247
261
 
262
+ # The message status represented by this event
263
+ module Status
264
+ extend SurgeAPI::Internal::Type::Enum
265
+
266
+ TaggedSymbol =
267
+ T.type_alias do
268
+ T.all(Symbol, SurgeAPI::MessageReceivedWebhookEvent::Data::Status)
269
+ end
270
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
271
+
272
+ RECEIVED =
273
+ T.let(
274
+ :received,
275
+ SurgeAPI::MessageReceivedWebhookEvent::Data::Status::TaggedSymbol
276
+ )
277
+
278
+ sig do
279
+ override.returns(
280
+ T::Array[
281
+ SurgeAPI::MessageReceivedWebhookEvent::Data::Status::TaggedSymbol
282
+ ]
283
+ )
284
+ end
285
+ def self.values
286
+ end
287
+ end
288
+
248
289
  class Attachment < SurgeAPI::Internal::Type::BaseModel
249
290
  OrHash =
250
291
  T.type_alias do
@@ -97,6 +97,12 @@ module SurgeAPI
97
97
  sig { returns(Time) }
98
98
  attr_accessor :sent_at
99
99
 
100
+ # The message status represented by this event
101
+ sig do
102
+ returns(SurgeAPI::MessageSentWebhookEvent::Data::Status::TaggedSymbol)
103
+ end
104
+ attr_accessor :status
105
+
100
106
  # Attachments included with the message
101
107
  sig do
102
108
  returns(
@@ -134,6 +140,7 @@ module SurgeAPI
134
140
  SurgeAPI::MessageSentWebhookEvent::Data::Conversation::OrHash,
135
141
  metadata: T::Hash[Symbol, String],
136
142
  sent_at: Time,
143
+ status: SurgeAPI::MessageSentWebhookEvent::Data::Status::OrSymbol,
137
144
  attachments:
138
145
  T::Array[
139
146
  SurgeAPI::MessageSentWebhookEvent::Data::Attachment::OrHash
@@ -152,6 +159,8 @@ module SurgeAPI
152
159
  metadata:,
153
160
  # When the message was sent
154
161
  sent_at:,
162
+ # The message status represented by this event
163
+ status:,
155
164
  # Attachments included with the message
156
165
  attachments: nil,
157
166
  # The ID of the blast this message belongs to, if any. This can be used to
@@ -169,6 +178,8 @@ module SurgeAPI
169
178
  SurgeAPI::MessageSentWebhookEvent::Data::Conversation,
170
179
  metadata: T::Hash[Symbol, String],
171
180
  sent_at: Time,
181
+ status:
182
+ SurgeAPI::MessageSentWebhookEvent::Data::Status::TaggedSymbol,
172
183
  attachments:
173
184
  T::Array[SurgeAPI::MessageSentWebhookEvent::Data::Attachment],
174
185
  blast_id: String
@@ -236,6 +247,33 @@ module SurgeAPI
236
247
  end
237
248
  end
238
249
 
250
+ # The message status represented by this event
251
+ module Status
252
+ extend SurgeAPI::Internal::Type::Enum
253
+
254
+ TaggedSymbol =
255
+ T.type_alias do
256
+ T.all(Symbol, SurgeAPI::MessageSentWebhookEvent::Data::Status)
257
+ end
258
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
259
+
260
+ SENT =
261
+ T.let(
262
+ :sent,
263
+ SurgeAPI::MessageSentWebhookEvent::Data::Status::TaggedSymbol
264
+ )
265
+
266
+ sig do
267
+ override.returns(
268
+ T::Array[
269
+ SurgeAPI::MessageSentWebhookEvent::Data::Status::TaggedSymbol
270
+ ]
271
+ )
272
+ end
273
+ def self.values
274
+ end
275
+ end
276
+
239
277
  class Attachment < SurgeAPI::Internal::Type::BaseModel
240
278
  OrHash =
241
279
  T.type_alias do
@@ -38,12 +38,14 @@ module SurgeAPI
38
38
 
39
39
  # The value of the identifier whose type is specified in the identifier_type
40
40
  # field. For EIN, can be formatted with or without the hyphen. For CBN, must be
41
- # exactly 9 digits.
41
+ # exactly 9 digits. For VAT, provide only the numeric portion, between 2 and 20
42
+ # digits.
42
43
  sig { returns(T.nilable(String)) }
43
44
  attr_accessor :identifier
44
45
 
45
46
  # The type of identifier being provided for the organization. Use "ein" for US
46
- # businesses or "cbn" for Canadian businesses.
47
+ # organizations, "cbn" for Canadian organizations, or "vat" for supported
48
+ # international organizations.
47
49
  sig do
48
50
  returns(T.nilable(SurgeAPI::Organization::IdentifierType::TaggedSymbol))
49
51
  end
@@ -136,10 +138,12 @@ module SurgeAPI
136
138
  email:,
137
139
  # The value of the identifier whose type is specified in the identifier_type
138
140
  # field. For EIN, can be formatted with or without the hyphen. For CBN, must be
139
- # exactly 9 digits.
141
+ # exactly 9 digits. For VAT, provide only the numeric portion, between 2 and 20
142
+ # digits.
140
143
  identifier:,
141
144
  # The type of identifier being provided for the organization. Use "ein" for US
142
- # businesses or "cbn" for Canadian businesses.
145
+ # organizations, "cbn" for Canadian organizations, or "vat" for supported
146
+ # international organizations.
143
147
  identifier_type:,
144
148
  # The industry in which the organization operates.
145
149
  industry:,
@@ -409,7 +413,8 @@ module SurgeAPI
409
413
  end
410
414
 
411
415
  # The type of identifier being provided for the organization. Use "ein" for US
412
- # businesses or "cbn" for Canadian businesses.
416
+ # organizations, "cbn" for Canadian organizations, or "vat" for supported
417
+ # international organizations.
413
418
  module IdentifierType
414
419
  extend SurgeAPI::Internal::Type::Enum
415
420
 
@@ -419,6 +424,7 @@ module SurgeAPI
419
424
 
420
425
  EIN = T.let(:ein, SurgeAPI::Organization::IdentifierType::TaggedSymbol)
421
426
  CBN = T.let(:cbn, SurgeAPI::Organization::IdentifierType::TaggedSymbol)
427
+ VAT = T.let(:vat, SurgeAPI::Organization::IdentifierType::TaggedSymbol)
422
428
 
423
429
  sig do
424
430
  override.returns(
@@ -0,0 +1,310 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class PhoneNumberImportedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ SurgeAPI::PhoneNumberImportedWebhookEvent,
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::PhoneNumberImportedWebhookEvent::Data) }
20
+ attr_reader :data
21
+
22
+ sig do
23
+ params(
24
+ data: SurgeAPI::PhoneNumberImportedWebhookEvent::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 `phone_number.imported` for this event.
34
+ sig { returns(Symbol) }
35
+ attr_accessor :type
36
+
37
+ sig do
38
+ params(
39
+ account_id: String,
40
+ data: SurgeAPI::PhoneNumberImportedWebhookEvent::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 `phone_number.imported` for this event.
53
+ type: :"phone_number.imported"
54
+ )
55
+ end
56
+
57
+ sig do
58
+ override.returns(
59
+ {
60
+ account_id: String,
61
+ data: SurgeAPI::PhoneNumberImportedWebhookEvent::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::PhoneNumberImportedWebhookEvent::Data,
75
+ SurgeAPI::Internal::AnyHash
76
+ )
77
+ end
78
+
79
+ # The unique identifier for the phone number
80
+ sig { returns(String) }
81
+ attr_accessor :id
82
+
83
+ # Campaign attachment details for a domestic local phone number
84
+ sig do
85
+ returns(
86
+ T.nilable(SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign)
87
+ )
88
+ end
89
+ attr_reader :campaign
90
+
91
+ sig do
92
+ params(
93
+ campaign:
94
+ T.nilable(
95
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::OrHash
96
+ )
97
+ ).void
98
+ end
99
+ attr_writer :campaign
100
+
101
+ # Deprecated. The unique identifier of the campaign this phone number is attached
102
+ # to
103
+ sig { returns(T.nilable(String)) }
104
+ attr_accessor :campaign_id
105
+
106
+ # A human-readable name for the phone number
107
+ sig { returns(T.nilable(String)) }
108
+ attr_accessor :name
109
+
110
+ # The phone number in E.164 format
111
+ sig { returns(String) }
112
+ attr_accessor :number
113
+
114
+ # Whether the phone number is local, toll-free, or short code
115
+ sig do
116
+ returns(
117
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type::TaggedSymbol
118
+ )
119
+ end
120
+ attr_accessor :type
121
+
122
+ # The data associated with the event
123
+ sig do
124
+ params(
125
+ id: String,
126
+ campaign:
127
+ T.nilable(
128
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::OrHash
129
+ ),
130
+ campaign_id: T.nilable(String),
131
+ name: T.nilable(String),
132
+ number: String,
133
+ type:
134
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type::OrSymbol
135
+ ).returns(T.attached_class)
136
+ end
137
+ def self.new(
138
+ # The unique identifier for the phone number
139
+ id:,
140
+ # Campaign attachment details for a domestic local phone number
141
+ campaign:,
142
+ # Deprecated. The unique identifier of the campaign this phone number is attached
143
+ # to
144
+ campaign_id:,
145
+ # A human-readable name for the phone number
146
+ name:,
147
+ # The phone number in E.164 format
148
+ number:,
149
+ # Whether the phone number is local, toll-free, or short code
150
+ type:
151
+ )
152
+ end
153
+
154
+ sig do
155
+ override.returns(
156
+ {
157
+ id: String,
158
+ campaign:
159
+ T.nilable(
160
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign
161
+ ),
162
+ campaign_id: T.nilable(String),
163
+ name: T.nilable(String),
164
+ number: String,
165
+ type:
166
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type::TaggedSymbol
167
+ }
168
+ )
169
+ end
170
+ def to_hash
171
+ end
172
+
173
+ class Campaign < SurgeAPI::Internal::Type::BaseModel
174
+ OrHash =
175
+ T.type_alias do
176
+ T.any(
177
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign,
178
+ SurgeAPI::Internal::AnyHash
179
+ )
180
+ end
181
+
182
+ # The unique identifier of the campaign this phone number is attached to
183
+ sig { returns(String) }
184
+ attr_accessor :id
185
+
186
+ # The current campaign attachment status for this phone number.
187
+ sig do
188
+ returns(
189
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
190
+ )
191
+ end
192
+ attr_accessor :attachment_status
193
+
194
+ # Campaign attachment details for a domestic local phone number
195
+ sig do
196
+ params(
197
+ id: String,
198
+ attachment_status:
199
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus::OrSymbol
200
+ ).returns(T.attached_class)
201
+ end
202
+ def self.new(
203
+ # The unique identifier of the campaign this phone number is attached to
204
+ id:,
205
+ # The current campaign attachment status for this phone number.
206
+ attachment_status:
207
+ )
208
+ end
209
+
210
+ sig do
211
+ override.returns(
212
+ {
213
+ id: String,
214
+ attachment_status:
215
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
216
+ }
217
+ )
218
+ end
219
+ def to_hash
220
+ end
221
+
222
+ # The current campaign attachment status for this phone number.
223
+ module AttachmentStatus
224
+ extend SurgeAPI::Internal::Type::Enum
225
+
226
+ TaggedSymbol =
227
+ T.type_alias do
228
+ T.all(
229
+ Symbol,
230
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus
231
+ )
232
+ end
233
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
234
+
235
+ ATTACHED =
236
+ T.let(
237
+ :attached,
238
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
239
+ )
240
+ ATTACHMENT_PENDING =
241
+ T.let(
242
+ :attachment_pending,
243
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
244
+ )
245
+ DETACHED =
246
+ T.let(
247
+ :detached,
248
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
249
+ )
250
+ DETACHMENT_PENDING =
251
+ T.let(
252
+ :detachment_pending,
253
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
254
+ )
255
+
256
+ sig do
257
+ override.returns(
258
+ T::Array[
259
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Campaign::AttachmentStatus::TaggedSymbol
260
+ ]
261
+ )
262
+ end
263
+ def self.values
264
+ end
265
+ end
266
+ end
267
+
268
+ # Whether the phone number is local, toll-free, or short code
269
+ module Type
270
+ extend SurgeAPI::Internal::Type::Enum
271
+
272
+ TaggedSymbol =
273
+ T.type_alias do
274
+ T.all(
275
+ Symbol,
276
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type
277
+ )
278
+ end
279
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
280
+
281
+ LOCAL =
282
+ T.let(
283
+ :local,
284
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type::TaggedSymbol
285
+ )
286
+ SHORT_CODE =
287
+ T.let(
288
+ :short_code,
289
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type::TaggedSymbol
290
+ )
291
+ TOLL_FREE =
292
+ T.let(
293
+ :toll_free,
294
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type::TaggedSymbol
295
+ )
296
+
297
+ sig do
298
+ override.returns(
299
+ T::Array[
300
+ SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type::TaggedSymbol
301
+ ]
302
+ )
303
+ end
304
+ def self.values
305
+ end
306
+ end
307
+ end
308
+ end
309
+ end
310
+ end