surge_api 0.23.0 → 0.25.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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +9 -9
  4. data/lib/surge_api/client.rb +4 -0
  5. data/lib/surge_api/internal/type/union.rb +2 -2
  6. data/lib/surge_api/models/account_retrieve_status_params.rb +1 -0
  7. data/lib/surge_api/models/call_ended_webhook_event.rb +8 -3
  8. data/lib/surge_api/models/campaign.rb +21 -13
  9. data/lib/surge_api/models/campaign_approved_webhook_event.rb +9 -1
  10. data/lib/surge_api/models/campaign_params.rb +11 -12
  11. data/lib/surge_api/models/campaign_rejected_webhook_event.rb +135 -0
  12. data/lib/surge_api/models/campaign_submitted_webhook_event.rb +74 -0
  13. data/lib/surge_api/models/campaign_update_params.rb +188 -1
  14. data/lib/surge_api/models/campaign_warning_webhook_event.rb +134 -0
  15. data/lib/surge_api/models/message.rb +42 -2
  16. data/lib/surge_api/models/message_delivered_webhook_event.rb +29 -1
  17. data/lib/surge_api/models/message_failed_webhook_event.rb +26 -5
  18. data/lib/surge_api/models/message_received_webhook_event.rb +29 -1
  19. data/lib/surge_api/models/message_sent_webhook_event.rb +29 -1
  20. data/lib/surge_api/models/phone_number.rb +9 -1
  21. data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +9 -1
  22. data/lib/surge_api/models/phone_number_imported_webhook_event.rb +160 -0
  23. data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
  24. data/lib/surge_api/models/phone_number_update_params.rb +9 -1
  25. data/lib/surge_api/models/toll_free_campaign.rb +132 -0
  26. data/lib/surge_api/models/toll_free_campaign_consent_flow.rb +176 -0
  27. data/lib/surge_api/models/toll_free_campaign_create_params.rb +22 -0
  28. data/lib/surge_api/models/toll_free_campaign_list_params.rb +42 -0
  29. data/lib/surge_api/models/toll_free_campaign_params.rb +286 -0
  30. data/lib/surge_api/models/toll_free_campaign_retrieve_params.rb +22 -0
  31. data/lib/surge_api/models/toll_free_campaign_update_params.rb +278 -0
  32. data/lib/surge_api/models/unwrap_webhook_event.rb +9 -1
  33. data/lib/surge_api/models/user_create_token_params.rb +15 -1
  34. data/lib/surge_api/models.rb +22 -0
  35. data/lib/surge_api/resources/accounts.rb +2 -2
  36. data/lib/surge_api/resources/campaigns.rb +26 -8
  37. data/lib/surge_api/resources/phone_numbers.rb +6 -2
  38. data/lib/surge_api/resources/toll_free_campaigns.rb +140 -0
  39. data/lib/surge_api/resources/users.rb +6 -1
  40. data/lib/surge_api/resources/webhooks.rb +1 -1
  41. data/lib/surge_api/version.rb +1 -1
  42. data/lib/surge_api.rb +12 -0
  43. data/rbi/surge_api/client.rbi +3 -0
  44. data/rbi/surge_api/models/account_retrieve_status_params.rbi +5 -0
  45. data/rbi/surge_api/models/call_ended_webhook_event.rbi +6 -3
  46. data/rbi/surge_api/models/campaign.rbi +26 -19
  47. data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +8 -0
  48. data/rbi/surge_api/models/campaign_params.rbi +17 -19
  49. data/rbi/surge_api/models/campaign_rejected_webhook_event.rbi +269 -0
  50. data/rbi/surge_api/models/campaign_submitted_webhook_event.rbi +149 -0
  51. data/rbi/surge_api/models/campaign_update_params.rbi +378 -1
  52. data/rbi/surge_api/models/campaign_warning_webhook_event.rbi +259 -0
  53. data/rbi/surge_api/models/message.rbi +50 -3
  54. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +52 -0
  55. data/rbi/surge_api/models/message_failed_webhook_event.rbi +47 -5
  56. data/rbi/surge_api/models/message_received_webhook_event.rbi +49 -0
  57. data/rbi/surge_api/models/message_sent_webhook_event.rbi +46 -0
  58. data/rbi/surge_api/models/phone_number.rbi +8 -0
  59. data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +8 -0
  60. data/rbi/surge_api/models/phone_number_imported_webhook_event.rbi +318 -0
  61. data/rbi/surge_api/models/phone_number_purchase_params.rbi +11 -0
  62. data/rbi/surge_api/models/phone_number_update_params.rbi +11 -0
  63. data/rbi/surge_api/models/toll_free_campaign.rbi +230 -0
  64. data/rbi/surge_api/models/toll_free_campaign_consent_flow.rbi +476 -0
  65. data/rbi/surge_api/models/toll_free_campaign_create_params.rbi +43 -0
  66. data/rbi/surge_api/models/toll_free_campaign_list_params.rbi +70 -0
  67. data/rbi/surge_api/models/toll_free_campaign_params.rbi +711 -0
  68. data/rbi/surge_api/models/toll_free_campaign_retrieve_params.rbi +43 -0
  69. data/rbi/surge_api/models/toll_free_campaign_update_params.rbi +760 -0
  70. data/rbi/surge_api/models/unwrap_webhook_event.rbi +4 -0
  71. data/rbi/surge_api/models/user_create_token_params.rbi +17 -0
  72. data/rbi/surge_api/models.rbi +25 -0
  73. data/rbi/surge_api/resources/accounts.rbi +2 -2
  74. data/rbi/surge_api/resources/campaigns.rbi +94 -12
  75. data/rbi/surge_api/resources/phone_numbers.rbi +6 -0
  76. data/rbi/surge_api/resources/toll_free_campaigns.rbi +129 -0
  77. data/rbi/surge_api/resources/users.rbi +6 -0
  78. data/rbi/surge_api/resources/webhooks.rbi +4 -0
  79. data/sig/surge_api/client.rbs +2 -0
  80. data/sig/surge_api/models/account_retrieve_status_params.rbs +2 -1
  81. data/sig/surge_api/models/campaign.rbs +8 -1
  82. data/sig/surge_api/models/campaign_approved_webhook_event.rbs +5 -0
  83. data/sig/surge_api/models/campaign_rejected_webhook_event.rbs +115 -0
  84. data/sig/surge_api/models/campaign_submitted_webhook_event.rbs +67 -0
  85. data/sig/surge_api/models/campaign_update_params.rbs +128 -2
  86. data/sig/surge_api/models/campaign_warning_webhook_event.rbs +114 -0
  87. data/sig/surge_api/models/message.rbs +36 -3
  88. data/sig/surge_api/models/message_delivered_webhook_event.rbs +20 -0
  89. data/sig/surge_api/models/message_failed_webhook_event.rbs +19 -4
  90. data/sig/surge_api/models/message_received_webhook_event.rbs +20 -0
  91. data/sig/surge_api/models/message_sent_webhook_event.rbs +20 -0
  92. data/sig/surge_api/models/phone_number.rbs +5 -0
  93. data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +5 -0
  94. data/sig/surge_api/models/phone_number_imported_webhook_event.rbs +130 -0
  95. data/sig/surge_api/models/phone_number_purchase_params.rbs +7 -0
  96. data/sig/surge_api/models/phone_number_update_params.rbs +12 -1
  97. data/sig/surge_api/models/toll_free_campaign.rbs +126 -0
  98. data/sig/surge_api/models/toll_free_campaign_consent_flow.rbs +207 -0
  99. data/sig/surge_api/models/toll_free_campaign_create_params.rbs +25 -0
  100. data/sig/surge_api/models/toll_free_campaign_list_params.rbs +36 -0
  101. data/sig/surge_api/models/toll_free_campaign_params.rbs +321 -0
  102. data/sig/surge_api/models/toll_free_campaign_retrieve_params.rbs +23 -0
  103. data/sig/surge_api/models/toll_free_campaign_update_params.rbs +332 -0
  104. data/sig/surge_api/models/unwrap_webhook_event.rbs +4 -0
  105. data/sig/surge_api/models/user_create_token_params.rbs +7 -1
  106. data/sig/surge_api/models.rbs +22 -0
  107. data/sig/surge_api/resources/campaigns.rbs +9 -1
  108. data/sig/surge_api/resources/phone_numbers.rbs +2 -0
  109. data/sig/surge_api/resources/toll_free_campaigns.rbs +44 -0
  110. data/sig/surge_api/resources/users.rbs +1 -0
  111. data/sig/surge_api/resources/webhooks.rbs +4 -0
  112. metadata +53 -7
@@ -15,26 +15,403 @@ module SurgeAPI
15
15
  sig { returns(String) }
16
16
  attr_accessor :id
17
17
 
18
+ # A string explaining the method through which end users will opt in to receive
19
+ # messages from the brand. Typically this should include URLs for opt-in forms or
20
+ # screenshots that might be helpful in explaining the flow to someone unfamiliar
21
+ # with the organization's purpose.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :consent_flow
24
+
25
+ sig { params(consent_flow: String).void }
26
+ attr_writer :consent_flow
27
+
28
+ # An explanation of the organization's purpose and how it will be using text
29
+ # messaging to accomplish that purpose.
30
+ sig { returns(T.nilable(String)) }
31
+ attr_reader :description
32
+
33
+ sig { params(description: String).void }
34
+ attr_writer :description
35
+
36
+ # A list of properties that this campaign should include. These properties can be
37
+ # any of the following values:
38
+ #
39
+ # - `links` - whether the campaign might send links in messages
40
+ # - `phone_numbers` - whether the campaign might send phone numbers in messages
41
+ # - `age_gated` - whether the campaign contains age gated content (controlled
42
+ # substances or adult content)
43
+ # - `direct_lending` - whether the campaign contains content related to direct
44
+ # lending or other loan arrangements
45
+ sig do
46
+ returns(
47
+ T.nilable(T::Array[SurgeAPI::CampaignUpdateParams::Include::OrSymbol])
48
+ )
49
+ end
50
+ attr_reader :includes
51
+
52
+ sig do
53
+ params(
54
+ includes: T::Array[SurgeAPI::CampaignUpdateParams::Include::OrSymbol]
55
+ ).void
56
+ end
57
+ attr_writer :includes
58
+
59
+ # A sample link that might be sent by this campaign. This is required when
60
+ # `includes` contains `links`. Provide the same URL or domain that the campaign
61
+ # will use in production. If links from other domains are sent through this
62
+ # campaign, they are much more likely to be filtered by the carriers.
63
+ sig { returns(T.nilable(String)) }
64
+ attr_accessor :link_sample
65
+
66
+ # An array of 2-5 strings with examples of the messages that will be sent from
67
+ # this campaign. Typically the first sample should be a compliance message like
68
+ # `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
69
+ # These samples don't necessarily need to be the only templates that will be used
70
+ # for the campaign, but they should reflect the purpose of the messages that will
71
+ # be sent. Any variable content can be reflected by wrapping it in square brackets
72
+ # like `[customer name]`.
73
+ sig { returns(T.nilable(T::Array[String])) }
74
+ attr_reader :message_samples
75
+
76
+ sig { params(message_samples: T::Array[String]).void }
77
+ attr_writer :message_samples
78
+
79
+ # The URL of the privacy policy for the brand in question. This may be a shared
80
+ # privacy policy if it's the policy that is displayed to end users when they opt
81
+ # in to messaging.
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :privacy_policy_url
84
+
85
+ sig { params(privacy_policy_url: String).void }
86
+ attr_writer :privacy_policy_url
87
+
88
+ # The URL of the terms and conditions presented to end users when they opt in to
89
+ # messaging. These terms and conditions may be shared among all of a platform's
90
+ # customers if they're the terms that are presented to end users when they opt in
91
+ # to messaging.
92
+ sig { returns(T.nilable(String)) }
93
+ attr_reader :terms_and_conditions_url
94
+
95
+ sig { params(terms_and_conditions_url: String).void }
96
+ attr_writer :terms_and_conditions_url
97
+
98
+ # A list containing 1-5 types of messages that will be sent with this campaign.
99
+ #
100
+ # The following use cases are typically available to all brands:
101
+ #
102
+ # - `account_notification` - For sending reminders, alerts, and general
103
+ # account-related notifications like booking confirmations or appointment
104
+ # reminders.
105
+ # - `customer_care` - For account support, troubleshooting, and general customer
106
+ # service communication.
107
+ # - `delivery_notification` - For notifying customers about the status of product
108
+ # or service deliveries.
109
+ # - `fraud_alert` - For warning customers about suspicious or potentially
110
+ # fraudulent activity.
111
+ # - `higher_education` - For messaging related to colleges, universities, and
112
+ # school districts outside of K–12.
113
+ # - `marketing` - For promotional or advertising messages intended to market
114
+ # products or services.
115
+ # - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
116
+ # - `public_service_announcement` - For raising awareness about social issues or
117
+ # important public information.
118
+ # - `security_alert` - For alerts related to potential security breaches or
119
+ # compromised systems requiring user action.
120
+ # - `two_factor_authentication` - For sending one-time passwords or verification
121
+ # codes for login or password reset.
122
+ #
123
+ # For access to special use cases not shown here, reach out to support@surge.app.
124
+ sig do
125
+ returns(
126
+ T.nilable(T::Array[SurgeAPI::CampaignUpdateParams::UseCase::OrSymbol])
127
+ )
128
+ end
129
+ attr_reader :use_cases
130
+
131
+ sig do
132
+ params(
133
+ use_cases: T::Array[SurgeAPI::CampaignUpdateParams::UseCase::OrSymbol]
134
+ ).void
135
+ end
136
+ attr_writer :use_cases
137
+
138
+ # This will be one of the following:
139
+ #
140
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
141
+ # T-Mobile customers each day. In this case your project will be charged for the
142
+ # setup fee for a low volume number upon receipt of the API request.
143
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
144
+ # T-Mobile customers each day, depending on the trust score assigned by The
145
+ # Campaign Registry. Your project will be charged for the setup fee for a high
146
+ # volume number upon receipt of the API request, and phone numbers will be
147
+ # charged as high volume numbers going forward.
148
+ sig do
149
+ returns(T.nilable(SurgeAPI::CampaignUpdateParams::Volume::OrSymbol))
150
+ end
151
+ attr_reader :volume
152
+
153
+ sig do
154
+ params(volume: SurgeAPI::CampaignUpdateParams::Volume::OrSymbol).void
155
+ end
156
+ attr_writer :volume
157
+
18
158
  sig do
19
159
  params(
20
160
  id: String,
161
+ consent_flow: String,
162
+ description: String,
163
+ includes: T::Array[SurgeAPI::CampaignUpdateParams::Include::OrSymbol],
164
+ link_sample: T.nilable(String),
165
+ message_samples: T::Array[String],
166
+ privacy_policy_url: String,
167
+ terms_and_conditions_url: String,
168
+ use_cases:
169
+ T::Array[SurgeAPI::CampaignUpdateParams::UseCase::OrSymbol],
170
+ volume: SurgeAPI::CampaignUpdateParams::Volume::OrSymbol,
21
171
  request_options: SurgeAPI::RequestOptions::OrHash
22
172
  ).returns(T.attached_class)
23
173
  end
24
174
  def self.new(
25
175
  # The ID of the campaign to update.
26
176
  id:,
177
+ # A string explaining the method through which end users will opt in to receive
178
+ # messages from the brand. Typically this should include URLs for opt-in forms or
179
+ # screenshots that might be helpful in explaining the flow to someone unfamiliar
180
+ # with the organization's purpose.
181
+ consent_flow: nil,
182
+ # An explanation of the organization's purpose and how it will be using text
183
+ # messaging to accomplish that purpose.
184
+ description: nil,
185
+ # A list of properties that this campaign should include. These properties can be
186
+ # any of the following values:
187
+ #
188
+ # - `links` - whether the campaign might send links in messages
189
+ # - `phone_numbers` - whether the campaign might send phone numbers in messages
190
+ # - `age_gated` - whether the campaign contains age gated content (controlled
191
+ # substances or adult content)
192
+ # - `direct_lending` - whether the campaign contains content related to direct
193
+ # lending or other loan arrangements
194
+ includes: nil,
195
+ # A sample link that might be sent by this campaign. This is required when
196
+ # `includes` contains `links`. Provide the same URL or domain that the campaign
197
+ # will use in production. If links from other domains are sent through this
198
+ # campaign, they are much more likely to be filtered by the carriers.
199
+ link_sample: nil,
200
+ # An array of 2-5 strings with examples of the messages that will be sent from
201
+ # this campaign. Typically the first sample should be a compliance message like
202
+ # `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
203
+ # These samples don't necessarily need to be the only templates that will be used
204
+ # for the campaign, but they should reflect the purpose of the messages that will
205
+ # be sent. Any variable content can be reflected by wrapping it in square brackets
206
+ # like `[customer name]`.
207
+ message_samples: nil,
208
+ # The URL of the privacy policy for the brand in question. This may be a shared
209
+ # privacy policy if it's the policy that is displayed to end users when they opt
210
+ # in to messaging.
211
+ privacy_policy_url: nil,
212
+ # The URL of the terms and conditions presented to end users when they opt in to
213
+ # messaging. These terms and conditions may be shared among all of a platform's
214
+ # customers if they're the terms that are presented to end users when they opt in
215
+ # to messaging.
216
+ terms_and_conditions_url: nil,
217
+ # A list containing 1-5 types of messages that will be sent with this campaign.
218
+ #
219
+ # The following use cases are typically available to all brands:
220
+ #
221
+ # - `account_notification` - For sending reminders, alerts, and general
222
+ # account-related notifications like booking confirmations or appointment
223
+ # reminders.
224
+ # - `customer_care` - For account support, troubleshooting, and general customer
225
+ # service communication.
226
+ # - `delivery_notification` - For notifying customers about the status of product
227
+ # or service deliveries.
228
+ # - `fraud_alert` - For warning customers about suspicious or potentially
229
+ # fraudulent activity.
230
+ # - `higher_education` - For messaging related to colleges, universities, and
231
+ # school districts outside of K–12.
232
+ # - `marketing` - For promotional or advertising messages intended to market
233
+ # products or services.
234
+ # - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
235
+ # - `public_service_announcement` - For raising awareness about social issues or
236
+ # important public information.
237
+ # - `security_alert` - For alerts related to potential security breaches or
238
+ # compromised systems requiring user action.
239
+ # - `two_factor_authentication` - For sending one-time passwords or verification
240
+ # codes for login or password reset.
241
+ #
242
+ # For access to special use cases not shown here, reach out to support@surge.app.
243
+ use_cases: nil,
244
+ # This will be one of the following:
245
+ #
246
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
247
+ # T-Mobile customers each day. In this case your project will be charged for the
248
+ # setup fee for a low volume number upon receipt of the API request.
249
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
250
+ # T-Mobile customers each day, depending on the trust score assigned by The
251
+ # Campaign Registry. Your project will be charged for the setup fee for a high
252
+ # volume number upon receipt of the API request, and phone numbers will be
253
+ # charged as high volume numbers going forward.
254
+ volume: nil,
27
255
  request_options: {}
28
256
  )
29
257
  end
30
258
 
31
259
  sig do
32
260
  override.returns(
33
- { id: String, request_options: SurgeAPI::RequestOptions }
261
+ {
262
+ id: String,
263
+ consent_flow: String,
264
+ description: String,
265
+ includes:
266
+ T::Array[SurgeAPI::CampaignUpdateParams::Include::OrSymbol],
267
+ link_sample: T.nilable(String),
268
+ message_samples: T::Array[String],
269
+ privacy_policy_url: String,
270
+ terms_and_conditions_url: String,
271
+ use_cases:
272
+ T::Array[SurgeAPI::CampaignUpdateParams::UseCase::OrSymbol],
273
+ volume: SurgeAPI::CampaignUpdateParams::Volume::OrSymbol,
274
+ request_options: SurgeAPI::RequestOptions
275
+ }
34
276
  )
35
277
  end
36
278
  def to_hash
37
279
  end
280
+
281
+ module Include
282
+ extend SurgeAPI::Internal::Type::Enum
283
+
284
+ TaggedSymbol =
285
+ T.type_alias do
286
+ T.all(Symbol, SurgeAPI::CampaignUpdateParams::Include)
287
+ end
288
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
289
+
290
+ LINKS =
291
+ T.let(:links, SurgeAPI::CampaignUpdateParams::Include::TaggedSymbol)
292
+ PHONE_NUMBERS =
293
+ T.let(
294
+ :phone_numbers,
295
+ SurgeAPI::CampaignUpdateParams::Include::TaggedSymbol
296
+ )
297
+ AGE_GATED =
298
+ T.let(
299
+ :age_gated,
300
+ SurgeAPI::CampaignUpdateParams::Include::TaggedSymbol
301
+ )
302
+ DIRECT_LENDING =
303
+ T.let(
304
+ :direct_lending,
305
+ SurgeAPI::CampaignUpdateParams::Include::TaggedSymbol
306
+ )
307
+
308
+ sig do
309
+ override.returns(
310
+ T::Array[SurgeAPI::CampaignUpdateParams::Include::TaggedSymbol]
311
+ )
312
+ end
313
+ def self.values
314
+ end
315
+ end
316
+
317
+ module UseCase
318
+ extend SurgeAPI::Internal::Type::Enum
319
+
320
+ TaggedSymbol =
321
+ T.type_alias do
322
+ T.all(Symbol, SurgeAPI::CampaignUpdateParams::UseCase)
323
+ end
324
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
325
+
326
+ ACCOUNT_NOTIFICATION =
327
+ T.let(
328
+ :account_notification,
329
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
330
+ )
331
+ CUSTOMER_CARE =
332
+ T.let(
333
+ :customer_care,
334
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
335
+ )
336
+ DELIVERY_NOTIFICATION =
337
+ T.let(
338
+ :delivery_notification,
339
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
340
+ )
341
+ FRAUD_ALERT =
342
+ T.let(
343
+ :fraud_alert,
344
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
345
+ )
346
+ HIGHER_EDUCATION =
347
+ T.let(
348
+ :higher_education,
349
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
350
+ )
351
+ MARKETING =
352
+ T.let(
353
+ :marketing,
354
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
355
+ )
356
+ POLLING_VOTING =
357
+ T.let(
358
+ :polling_voting,
359
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
360
+ )
361
+ PUBLIC_SERVICE_ANNOUNCEMENT =
362
+ T.let(
363
+ :public_service_announcement,
364
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
365
+ )
366
+ SECURITY_ALERT =
367
+ T.let(
368
+ :security_alert,
369
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
370
+ )
371
+ TWO_FACTOR_AUTHENTICATION =
372
+ T.let(
373
+ :two_factor_authentication,
374
+ SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol
375
+ )
376
+
377
+ sig do
378
+ override.returns(
379
+ T::Array[SurgeAPI::CampaignUpdateParams::UseCase::TaggedSymbol]
380
+ )
381
+ end
382
+ def self.values
383
+ end
384
+ end
385
+
386
+ # This will be one of the following:
387
+ #
388
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
389
+ # T-Mobile customers each day. In this case your project will be charged for the
390
+ # setup fee for a low volume number upon receipt of the API request.
391
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
392
+ # T-Mobile customers each day, depending on the trust score assigned by The
393
+ # Campaign Registry. Your project will be charged for the setup fee for a high
394
+ # volume number upon receipt of the API request, and phone numbers will be
395
+ # charged as high volume numbers going forward.
396
+ module Volume
397
+ extend SurgeAPI::Internal::Type::Enum
398
+
399
+ TaggedSymbol =
400
+ T.type_alias { T.all(Symbol, SurgeAPI::CampaignUpdateParams::Volume) }
401
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
402
+
403
+ HIGH =
404
+ T.let(:high, SurgeAPI::CampaignUpdateParams::Volume::TaggedSymbol)
405
+ LOW = T.let(:low, SurgeAPI::CampaignUpdateParams::Volume::TaggedSymbol)
406
+
407
+ sig do
408
+ override.returns(
409
+ T::Array[SurgeAPI::CampaignUpdateParams::Volume::TaggedSymbol]
410
+ )
411
+ end
412
+ def self.values
413
+ end
414
+ end
38
415
  end
39
416
  end
40
417
  end
@@ -0,0 +1,259 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class CampaignWarningWebhookEvent < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ SurgeAPI::CampaignWarningWebhookEvent,
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::CampaignWarningWebhookEvent::Data) }
20
+ attr_reader :data
21
+
22
+ sig do
23
+ params(data: SurgeAPI::CampaignWarningWebhookEvent::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 `campaign.warning` for this event.
32
+ sig { returns(Symbol) }
33
+ attr_accessor :type
34
+
35
+ sig do
36
+ params(
37
+ account_id: String,
38
+ data: SurgeAPI::CampaignWarningWebhookEvent::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 `campaign.warning` for this event.
51
+ type: :"campaign.warning"
52
+ )
53
+ end
54
+
55
+ sig do
56
+ override.returns(
57
+ {
58
+ account_id: String,
59
+ data: SurgeAPI::CampaignWarningWebhookEvent::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::CampaignWarningWebhookEvent::Data,
73
+ SurgeAPI::Internal::AnyHash
74
+ )
75
+ end
76
+
77
+ # The unique identifier for the campaign
78
+ sig { returns(String) }
79
+ attr_accessor :id
80
+
81
+ # Customer-visible field-level registration feedback. Rejection events may include
82
+ # non-blocking warnings alongside changes-needed items.
83
+ sig do
84
+ returns(
85
+ T::Array[SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback]
86
+ )
87
+ end
88
+ attr_accessor :feedback
89
+
90
+ # The public campaign status. Always `in_review` for this event.
91
+ sig do
92
+ returns(
93
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Status::TaggedSymbol
94
+ )
95
+ end
96
+ attr_accessor :status
97
+
98
+ # The data associated with the event
99
+ sig do
100
+ params(
101
+ id: String,
102
+ feedback:
103
+ T::Array[
104
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback::OrHash
105
+ ],
106
+ status:
107
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Status::OrSymbol
108
+ ).returns(T.attached_class)
109
+ end
110
+ def self.new(
111
+ # The unique identifier for the campaign
112
+ id:,
113
+ # Customer-visible field-level registration feedback. Rejection events may include
114
+ # non-blocking warnings alongside changes-needed items.
115
+ feedback:,
116
+ # The public campaign status. Always `in_review` for this event.
117
+ status:
118
+ )
119
+ end
120
+
121
+ sig do
122
+ override.returns(
123
+ {
124
+ id: String,
125
+ feedback:
126
+ T::Array[SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback],
127
+ status:
128
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Status::TaggedSymbol
129
+ }
130
+ )
131
+ end
132
+ def to_hash
133
+ end
134
+
135
+ class Feedback < SurgeAPI::Internal::Type::BaseModel
136
+ OrHash =
137
+ T.type_alias do
138
+ T.any(
139
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback,
140
+ SurgeAPI::Internal::AnyHash
141
+ )
142
+ end
143
+
144
+ # The stable registration field key
145
+ sig { returns(String) }
146
+ attr_accessor :field
147
+
148
+ # Actionable review feedback
149
+ sig { returns(String) }
150
+ attr_accessor :message
151
+
152
+ # Whether the feedback blocks registration or is a non-blocking warning
153
+ sig do
154
+ returns(
155
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback::Outcome::TaggedSymbol
156
+ )
157
+ end
158
+ attr_accessor :outcome
159
+
160
+ # A suggested replacement value, or null when none is suggested
161
+ sig { returns(T.nilable(String)) }
162
+ attr_accessor :suggested_value
163
+
164
+ sig do
165
+ params(
166
+ field: String,
167
+ message: String,
168
+ outcome:
169
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback::Outcome::OrSymbol,
170
+ suggested_value: T.nilable(String)
171
+ ).returns(T.attached_class)
172
+ end
173
+ def self.new(
174
+ # The stable registration field key
175
+ field:,
176
+ # Actionable review feedback
177
+ message:,
178
+ # Whether the feedback blocks registration or is a non-blocking warning
179
+ outcome:,
180
+ # A suggested replacement value, or null when none is suggested
181
+ suggested_value:
182
+ )
183
+ end
184
+
185
+ sig do
186
+ override.returns(
187
+ {
188
+ field: String,
189
+ message: String,
190
+ outcome:
191
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback::Outcome::TaggedSymbol,
192
+ suggested_value: T.nilable(String)
193
+ }
194
+ )
195
+ end
196
+ def to_hash
197
+ end
198
+
199
+ # Whether the feedback blocks registration or is a non-blocking warning
200
+ module Outcome
201
+ extend SurgeAPI::Internal::Type::Enum
202
+
203
+ TaggedSymbol =
204
+ T.type_alias do
205
+ T.all(
206
+ Symbol,
207
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback::Outcome
208
+ )
209
+ end
210
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
211
+
212
+ WARNING =
213
+ T.let(
214
+ :warning,
215
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback::Outcome::TaggedSymbol
216
+ )
217
+
218
+ sig do
219
+ override.returns(
220
+ T::Array[
221
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback::Outcome::TaggedSymbol
222
+ ]
223
+ )
224
+ end
225
+ def self.values
226
+ end
227
+ end
228
+ end
229
+
230
+ # The public campaign status. Always `in_review` for this event.
231
+ module Status
232
+ extend SurgeAPI::Internal::Type::Enum
233
+
234
+ TaggedSymbol =
235
+ T.type_alias do
236
+ T.all(Symbol, SurgeAPI::CampaignWarningWebhookEvent::Data::Status)
237
+ end
238
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
239
+
240
+ IN_REVIEW =
241
+ T.let(
242
+ :in_review,
243
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Status::TaggedSymbol
244
+ )
245
+
246
+ sig do
247
+ override.returns(
248
+ T::Array[
249
+ SurgeAPI::CampaignWarningWebhookEvent::Data::Status::TaggedSymbol
250
+ ]
251
+ )
252
+ end
253
+ def self.values
254
+ end
255
+ end
256
+ end
257
+ end
258
+ end
259
+ end