surge_api 0.24.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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -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/call_ended_webhook_event.rb +8 -3
  7. data/lib/surge_api/models/campaign.rb +15 -7
  8. data/lib/surge_api/models/campaign_approved_webhook_event.rb +9 -1
  9. data/lib/surge_api/models/campaign_params.rb +6 -6
  10. data/lib/surge_api/models/campaign_rejected_webhook_event.rb +135 -0
  11. data/lib/surge_api/models/campaign_submitted_webhook_event.rb +74 -0
  12. data/lib/surge_api/models/campaign_update_params.rb +188 -1
  13. data/lib/surge_api/models/campaign_warning_webhook_event.rb +134 -0
  14. data/lib/surge_api/models/message.rb +18 -2
  15. data/lib/surge_api/models/message_delivered_webhook_event.rb +9 -1
  16. data/lib/surge_api/models/message_failed_webhook_event.rb +5 -4
  17. data/lib/surge_api/models/message_received_webhook_event.rb +9 -1
  18. data/lib/surge_api/models/message_sent_webhook_event.rb +9 -1
  19. data/lib/surge_api/models/phone_number.rb +9 -1
  20. data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +9 -1
  21. data/lib/surge_api/models/phone_number_imported_webhook_event.rb +9 -1
  22. data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
  23. data/lib/surge_api/models/phone_number_update_params.rb +9 -1
  24. data/lib/surge_api/models/toll_free_campaign.rb +132 -0
  25. data/lib/surge_api/models/toll_free_campaign_consent_flow.rb +176 -0
  26. data/lib/surge_api/models/toll_free_campaign_create_params.rb +22 -0
  27. data/lib/surge_api/models/toll_free_campaign_list_params.rb +42 -0
  28. data/lib/surge_api/models/toll_free_campaign_params.rb +286 -0
  29. data/lib/surge_api/models/toll_free_campaign_retrieve_params.rb +22 -0
  30. data/lib/surge_api/models/toll_free_campaign_update_params.rb +278 -0
  31. data/lib/surge_api/models/unwrap_webhook_event.rb +7 -1
  32. data/lib/surge_api/models/user_create_token_params.rb +15 -1
  33. data/lib/surge_api/models.rb +20 -0
  34. data/lib/surge_api/resources/accounts.rb +2 -2
  35. data/lib/surge_api/resources/campaigns.rb +26 -8
  36. data/lib/surge_api/resources/phone_numbers.rb +6 -2
  37. data/lib/surge_api/resources/toll_free_campaigns.rb +140 -0
  38. data/lib/surge_api/resources/users.rb +6 -1
  39. data/lib/surge_api/resources/webhooks.rb +1 -1
  40. data/lib/surge_api/version.rb +1 -1
  41. data/lib/surge_api.rb +11 -0
  42. data/rbi/surge_api/client.rbi +3 -0
  43. data/rbi/surge_api/models/call_ended_webhook_event.rbi +6 -3
  44. data/rbi/surge_api/models/campaign.rbi +17 -9
  45. data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +8 -0
  46. data/rbi/surge_api/models/campaign_params.rbi +9 -9
  47. data/rbi/surge_api/models/campaign_rejected_webhook_event.rbi +269 -0
  48. data/rbi/surge_api/models/campaign_submitted_webhook_event.rbi +149 -0
  49. data/rbi/surge_api/models/campaign_update_params.rbi +378 -1
  50. data/rbi/surge_api/models/campaign_warning_webhook_event.rbi +259 -0
  51. data/rbi/surge_api/models/message.rbi +16 -0
  52. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +8 -0
  53. data/rbi/surge_api/models/message_failed_webhook_event.rbi +7 -5
  54. data/rbi/surge_api/models/message_received_webhook_event.rbi +8 -0
  55. data/rbi/surge_api/models/message_sent_webhook_event.rbi +8 -0
  56. data/rbi/surge_api/models/phone_number.rbi +8 -0
  57. data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +8 -0
  58. data/rbi/surge_api/models/phone_number_imported_webhook_event.rbi +8 -0
  59. data/rbi/surge_api/models/phone_number_purchase_params.rbi +11 -0
  60. data/rbi/surge_api/models/phone_number_update_params.rbi +11 -0
  61. data/rbi/surge_api/models/toll_free_campaign.rbi +230 -0
  62. data/rbi/surge_api/models/toll_free_campaign_consent_flow.rbi +476 -0
  63. data/rbi/surge_api/models/toll_free_campaign_create_params.rbi +43 -0
  64. data/rbi/surge_api/models/toll_free_campaign_list_params.rbi +70 -0
  65. data/rbi/surge_api/models/toll_free_campaign_params.rbi +711 -0
  66. data/rbi/surge_api/models/toll_free_campaign_retrieve_params.rbi +43 -0
  67. data/rbi/surge_api/models/toll_free_campaign_update_params.rbi +760 -0
  68. data/rbi/surge_api/models/unwrap_webhook_event.rbi +3 -0
  69. data/rbi/surge_api/models/user_create_token_params.rbi +17 -0
  70. data/rbi/surge_api/models.rbi +22 -0
  71. data/rbi/surge_api/resources/accounts.rbi +2 -2
  72. data/rbi/surge_api/resources/campaigns.rbi +94 -12
  73. data/rbi/surge_api/resources/phone_numbers.rbi +6 -0
  74. data/rbi/surge_api/resources/toll_free_campaigns.rbi +129 -0
  75. data/rbi/surge_api/resources/users.rbi +6 -0
  76. data/rbi/surge_api/resources/webhooks.rbi +3 -0
  77. data/sig/surge_api/client.rbs +2 -0
  78. data/sig/surge_api/models/campaign.rbs +5 -0
  79. data/sig/surge_api/models/campaign_approved_webhook_event.rbs +5 -0
  80. data/sig/surge_api/models/campaign_rejected_webhook_event.rbs +115 -0
  81. data/sig/surge_api/models/campaign_submitted_webhook_event.rbs +67 -0
  82. data/sig/surge_api/models/campaign_update_params.rbs +128 -2
  83. data/sig/surge_api/models/campaign_warning_webhook_event.rbs +114 -0
  84. data/sig/surge_api/models/message.rbs +10 -0
  85. data/sig/surge_api/models/message_delivered_webhook_event.rbs +5 -0
  86. data/sig/surge_api/models/message_failed_webhook_event.rbs +4 -4
  87. data/sig/surge_api/models/message_received_webhook_event.rbs +5 -0
  88. data/sig/surge_api/models/message_sent_webhook_event.rbs +5 -0
  89. data/sig/surge_api/models/phone_number.rbs +5 -0
  90. data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +5 -0
  91. data/sig/surge_api/models/phone_number_imported_webhook_event.rbs +5 -0
  92. data/sig/surge_api/models/phone_number_purchase_params.rbs +7 -0
  93. data/sig/surge_api/models/phone_number_update_params.rbs +12 -1
  94. data/sig/surge_api/models/toll_free_campaign.rbs +126 -0
  95. data/sig/surge_api/models/toll_free_campaign_consent_flow.rbs +207 -0
  96. data/sig/surge_api/models/toll_free_campaign_create_params.rbs +25 -0
  97. data/sig/surge_api/models/toll_free_campaign_list_params.rbs +36 -0
  98. data/sig/surge_api/models/toll_free_campaign_params.rbs +321 -0
  99. data/sig/surge_api/models/toll_free_campaign_retrieve_params.rbs +23 -0
  100. data/sig/surge_api/models/toll_free_campaign_update_params.rbs +332 -0
  101. data/sig/surge_api/models/unwrap_webhook_event.rbs +3 -0
  102. data/sig/surge_api/models/user_create_token_params.rbs +7 -1
  103. data/sig/surge_api/models.rbs +20 -0
  104. data/sig/surge_api/resources/campaigns.rbs +9 -1
  105. data/sig/surge_api/resources/phone_numbers.rbs +2 -0
  106. data/sig/surge_api/resources/toll_free_campaigns.rbs +44 -0
  107. data/sig/surge_api/resources/users.rbs +1 -0
  108. data/sig/surge_api/resources/webhooks.rbs +3 -0
  109. metadata +50 -7
data/lib/surge_api.rb CHANGED
@@ -56,6 +56,7 @@ require_relative "surge_api/client"
56
56
  require_relative "surge_api/internal/cursor"
57
57
  require_relative "surge_api/models/campaign_params"
58
58
  require_relative "surge_api/models/message_params"
59
+ require_relative "surge_api/models/toll_free_campaign_params"
59
60
  require_relative "surge_api/models/account"
60
61
  require_relative "surge_api/models/account_archive_params"
61
62
  require_relative "surge_api/models/account_create_params"
@@ -77,10 +78,13 @@ require_relative "surge_api/models/campaign"
77
78
  require_relative "surge_api/models/campaign_approved_webhook_event"
78
79
  require_relative "surge_api/models/campaign_create_params"
79
80
  require_relative "surge_api/models/campaign_list_params"
81
+ require_relative "surge_api/models/campaign_rejected_webhook_event"
80
82
  require_relative "surge_api/models/campaign_resend_brand_verification_message_params"
81
83
  require_relative "surge_api/models/campaign_resend_brand_verification_message_response"
82
84
  require_relative "surge_api/models/campaign_retrieve_params"
85
+ require_relative "surge_api/models/campaign_submitted_webhook_event"
83
86
  require_relative "surge_api/models/campaign_update_params"
87
+ require_relative "surge_api/models/campaign_warning_webhook_event"
84
88
  require_relative "surge_api/models/contact"
85
89
  require_relative "surge_api/models/contact_create_params"
86
90
  require_relative "surge_api/models/contact_list_params"
@@ -119,6 +123,12 @@ require_relative "surge_api/models/recording_list_params"
119
123
  require_relative "surge_api/models/recording_list_response"
120
124
  require_relative "surge_api/models/recording_retrieve_params"
121
125
  require_relative "surge_api/models/recording_retrieve_response"
126
+ require_relative "surge_api/models/toll_free_campaign"
127
+ require_relative "surge_api/models/toll_free_campaign_consent_flow"
128
+ require_relative "surge_api/models/toll_free_campaign_create_params"
129
+ require_relative "surge_api/models/toll_free_campaign_list_params"
130
+ require_relative "surge_api/models/toll_free_campaign_retrieve_params"
131
+ require_relative "surge_api/models/toll_free_campaign_update_params"
122
132
  require_relative "surge_api/models/unwrap_webhook_event"
123
133
  require_relative "surge_api/models/user"
124
134
  require_relative "surge_api/models/user_create_params"
@@ -144,6 +154,7 @@ require_relative "surge_api/resources/contacts"
144
154
  require_relative "surge_api/resources/messages"
145
155
  require_relative "surge_api/resources/phone_numbers"
146
156
  require_relative "surge_api/resources/recordings"
157
+ require_relative "surge_api/resources/toll_free_campaigns"
147
158
  require_relative "surge_api/resources/users"
148
159
  require_relative "surge_api/resources/verifications"
149
160
  require_relative "surge_api/resources/webhooks"
@@ -43,6 +43,9 @@ module SurgeAPI
43
43
  sig { returns(SurgeAPI::Resources::Recordings) }
44
44
  attr_reader :recordings
45
45
 
46
+ sig { returns(SurgeAPI::Resources::TollFreeCampaigns) }
47
+ attr_reader :toll_free_campaigns
48
+
46
49
  sig { returns(SurgeAPI::Resources::Users) }
47
50
  attr_reader :users
48
51
 
@@ -88,7 +88,8 @@ module SurgeAPI
88
88
  sig { returns(Time) }
89
89
  attr_accessor :initiated_at
90
90
 
91
- # The status of the call
91
+ # The status of the call. For inbound embedded-phone calls, `no_answer` means no
92
+ # embedded user answered, even if the caller reached voicemail.
92
93
  sig do
93
94
  returns(SurgeAPI::CallEndedWebhookEvent::Data::Status::TaggedSymbol)
94
95
  end
@@ -128,7 +129,8 @@ module SurgeAPI
128
129
  duration:,
129
130
  # When the call was initiated
130
131
  initiated_at:,
131
- # The status of the call
132
+ # The status of the call. For inbound embedded-phone calls, `no_answer` means no
133
+ # embedded user answered, even if the caller reached voicemail.
132
134
  status:,
133
135
  # The E.164 phone number of the caller
134
136
  from: nil,
@@ -157,7 +159,8 @@ module SurgeAPI
157
159
  def to_hash
158
160
  end
159
161
 
160
- # The status of the call
162
+ # The status of the call. For inbound embedded-phone calls, `no_answer` means no
163
+ # embedded user answered, even if the caller reached voicemail.
161
164
  module Status
162
165
  extend SurgeAPI::Internal::Type::Enum
163
166
 
@@ -10,6 +10,10 @@ module SurgeAPI
10
10
  sig { returns(String) }
11
11
  attr_accessor :id
12
12
 
13
+ # The ID of the account that owns this campaign
14
+ sig { returns(String) }
15
+ attr_accessor :account_id
16
+
13
17
  # A string explaining the method through which end users will opt in to receive
14
18
  # messages from the brand. Typically this should include URLs for opt-in forms or
15
19
  # screenshots that might be helpful in explaining the flow to someone unfamiliar
@@ -86,11 +90,11 @@ module SurgeAPI
86
90
  # This will be one of the following:
87
91
  #
88
92
  # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
89
- # T-Mobile customers each day. In this case your platform will be charged for
90
- # the setup fee for a low volume number upon receipt of the API request.
93
+ # T-Mobile customers each day. In this case your project will be charged for the
94
+ # setup fee for a low volume number upon receipt of the API request.
91
95
  # - `high` - The campaign will be allowed to send up to 200k SMS segments to
92
96
  # T-Mobile customers each day, depending on the trust score assigned by The
93
- # Campaign Registry. Your platform will be charged for the setup fee for a high
97
+ # Campaign Registry. Your project will be charged for the setup fee for a high
94
98
  # volume number upon receipt of the API request, and phone numbers will be
95
99
  # charged as high volume numbers going forward.
96
100
  sig { returns(SurgeAPI::Campaign::Volume::TaggedSymbol) }
@@ -121,6 +125,7 @@ module SurgeAPI
121
125
  sig do
122
126
  params(
123
127
  id: String,
128
+ account_id: String,
124
129
  consent_flow: String,
125
130
  description: String,
126
131
  includes: T::Array[SurgeAPI::Campaign::Include::OrSymbol],
@@ -136,6 +141,8 @@ module SurgeAPI
136
141
  def self.new(
137
142
  # The campaign ID
138
143
  id:,
144
+ # The ID of the account that owns this campaign
145
+ account_id:,
139
146
  # A string explaining the method through which end users will opt in to receive
140
147
  # messages from the brand. Typically this should include URLs for opt-in forms or
141
148
  # screenshots that might be helpful in explaining the flow to someone unfamiliar
@@ -198,11 +205,11 @@ module SurgeAPI
198
205
  # This will be one of the following:
199
206
  #
200
207
  # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
201
- # T-Mobile customers each day. In this case your platform will be charged for
202
- # the setup fee for a low volume number upon receipt of the API request.
208
+ # T-Mobile customers each day. In this case your project will be charged for the
209
+ # setup fee for a low volume number upon receipt of the API request.
203
210
  # - `high` - The campaign will be allowed to send up to 200k SMS segments to
204
211
  # T-Mobile customers each day, depending on the trust score assigned by The
205
- # Campaign Registry. Your platform will be charged for the setup fee for a high
212
+ # Campaign Registry. Your project will be charged for the setup fee for a high
206
213
  # volume number upon receipt of the API request, and phone numbers will be
207
214
  # charged as high volume numbers going forward.
208
215
  volume:,
@@ -223,6 +230,7 @@ module SurgeAPI
223
230
  override.returns(
224
231
  {
225
232
  id: String,
233
+ account_id: String,
226
234
  consent_flow: String,
227
235
  description: String,
228
236
  includes: T::Array[SurgeAPI::Campaign::Include::TaggedSymbol],
@@ -332,11 +340,11 @@ module SurgeAPI
332
340
  # This will be one of the following:
333
341
  #
334
342
  # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
335
- # T-Mobile customers each day. In this case your platform will be charged for
336
- # the setup fee for a low volume number upon receipt of the API request.
343
+ # T-Mobile customers each day. In this case your project will be charged for the
344
+ # setup fee for a low volume number upon receipt of the API request.
337
345
  # - `high` - The campaign will be allowed to send up to 200k SMS segments to
338
346
  # T-Mobile customers each day, depending on the trust score assigned by The
339
- # Campaign Registry. Your platform will be charged for the setup fee for a high
347
+ # Campaign Registry. Your project will be charged for the setup fee for a high
340
348
  # volume number upon receipt of the API request, and phone numbers will be
341
349
  # charged as high volume numbers going forward.
342
350
  module Volume
@@ -78,6 +78,10 @@ module SurgeAPI
78
78
  sig { returns(String) }
79
79
  attr_accessor :id
80
80
 
81
+ # The ID of the account that owns this campaign
82
+ sig { returns(String) }
83
+ attr_accessor :account_id
84
+
81
85
  # The status of the campaign. Will always be `active` for this event.
82
86
  sig do
83
87
  returns(
@@ -90,6 +94,7 @@ module SurgeAPI
90
94
  sig do
91
95
  params(
92
96
  id: String,
97
+ account_id: String,
93
98
  status:
94
99
  SurgeAPI::CampaignApprovedWebhookEvent::Data::Status::OrSymbol
95
100
  ).returns(T.attached_class)
@@ -97,6 +102,8 @@ module SurgeAPI
97
102
  def self.new(
98
103
  # The unique identifier for the campaign
99
104
  id:,
105
+ # The ID of the account that owns this campaign
106
+ account_id:,
100
107
  # The status of the campaign. Will always be `active` for this event.
101
108
  status:
102
109
  )
@@ -106,6 +113,7 @@ module SurgeAPI
106
113
  override.returns(
107
114
  {
108
115
  id: String,
116
+ account_id: String,
109
117
  status:
110
118
  SurgeAPI::CampaignApprovedWebhookEvent::Data::Status::TaggedSymbol
111
119
  }
@@ -97,11 +97,11 @@ module SurgeAPI
97
97
  # This will be one of the following:
98
98
  #
99
99
  # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
100
- # T-Mobile customers each day. In this case your platform will be charged for
101
- # the setup fee for a low volume number upon receipt of the API request.
100
+ # T-Mobile customers each day. In this case your project will be charged for the
101
+ # setup fee for a low volume number upon receipt of the API request.
102
102
  # - `high` - The campaign will be allowed to send up to 200k SMS segments to
103
103
  # T-Mobile customers each day, depending on the trust score assigned by The
104
- # Campaign Registry. Your platform will be charged for the setup fee for a high
104
+ # Campaign Registry. Your project will be charged for the setup fee for a high
105
105
  # volume number upon receipt of the API request, and phone numbers will be
106
106
  # charged as high volume numbers going forward.
107
107
  sig do
@@ -228,11 +228,11 @@ module SurgeAPI
228
228
  # This will be one of the following:
229
229
  #
230
230
  # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
231
- # T-Mobile customers each day. In this case your platform will be charged for
232
- # the setup fee for a low volume number upon receipt of the API request.
231
+ # T-Mobile customers each day. In this case your project will be charged for the
232
+ # setup fee for a low volume number upon receipt of the API request.
233
233
  # - `high` - The campaign will be allowed to send up to 200k SMS segments to
234
234
  # T-Mobile customers each day, depending on the trust score assigned by The
235
- # Campaign Registry. Your platform will be charged for the setup fee for a high
235
+ # Campaign Registry. Your project will be charged for the setup fee for a high
236
236
  # volume number upon receipt of the API request, and phone numbers will be
237
237
  # charged as high volume numbers going forward.
238
238
  volume:,
@@ -356,11 +356,11 @@ module SurgeAPI
356
356
  # This will be one of the following:
357
357
  #
358
358
  # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
359
- # T-Mobile customers each day. In this case your platform will be charged for
360
- # the setup fee for a low volume number upon receipt of the API request.
359
+ # T-Mobile customers each day. In this case your project will be charged for the
360
+ # setup fee for a low volume number upon receipt of the API request.
361
361
  # - `high` - The campaign will be allowed to send up to 200k SMS segments to
362
362
  # T-Mobile customers each day, depending on the trust score assigned by The
363
- # Campaign Registry. Your platform will be charged for the setup fee for a high
363
+ # Campaign Registry. Your project will be charged for the setup fee for a high
364
364
  # volume number upon receipt of the API request, and phone numbers will be
365
365
  # charged as high volume numbers going forward.
366
366
  module Volume
@@ -0,0 +1,269 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class CampaignRejectedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ SurgeAPI::CampaignRejectedWebhookEvent,
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::CampaignRejectedWebhookEvent::Data) }
20
+ attr_reader :data
21
+
22
+ sig do
23
+ params(data: SurgeAPI::CampaignRejectedWebhookEvent::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.rejected` for this event.
32
+ sig { returns(Symbol) }
33
+ attr_accessor :type
34
+
35
+ sig do
36
+ params(
37
+ account_id: String,
38
+ data: SurgeAPI::CampaignRejectedWebhookEvent::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.rejected` for this event.
51
+ type: :"campaign.rejected"
52
+ )
53
+ end
54
+
55
+ sig do
56
+ override.returns(
57
+ {
58
+ account_id: String,
59
+ data: SurgeAPI::CampaignRejectedWebhookEvent::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::CampaignRejectedWebhookEvent::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::CampaignRejectedWebhookEvent::Data::Feedback]
86
+ )
87
+ end
88
+ attr_accessor :feedback
89
+
90
+ # The public campaign status. Always `rejected` for this event.
91
+ sig do
92
+ returns(
93
+ SurgeAPI::CampaignRejectedWebhookEvent::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::CampaignRejectedWebhookEvent::Data::Feedback::OrHash
105
+ ],
106
+ status:
107
+ SurgeAPI::CampaignRejectedWebhookEvent::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 `rejected` for this event.
117
+ status:
118
+ )
119
+ end
120
+
121
+ sig do
122
+ override.returns(
123
+ {
124
+ id: String,
125
+ feedback:
126
+ T::Array[
127
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback
128
+ ],
129
+ status:
130
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Status::TaggedSymbol
131
+ }
132
+ )
133
+ end
134
+ def to_hash
135
+ end
136
+
137
+ class Feedback < SurgeAPI::Internal::Type::BaseModel
138
+ OrHash =
139
+ T.type_alias do
140
+ T.any(
141
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback,
142
+ SurgeAPI::Internal::AnyHash
143
+ )
144
+ end
145
+
146
+ # The stable registration field key
147
+ sig { returns(String) }
148
+ attr_accessor :field
149
+
150
+ # Actionable review feedback
151
+ sig { returns(String) }
152
+ attr_accessor :message
153
+
154
+ # Whether the feedback blocks registration or is a non-blocking warning
155
+ sig do
156
+ returns(
157
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback::Outcome::TaggedSymbol
158
+ )
159
+ end
160
+ attr_accessor :outcome
161
+
162
+ # A suggested replacement value, or null when none is suggested
163
+ sig { returns(T.nilable(String)) }
164
+ attr_accessor :suggested_value
165
+
166
+ sig do
167
+ params(
168
+ field: String,
169
+ message: String,
170
+ outcome:
171
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback::Outcome::OrSymbol,
172
+ suggested_value: T.nilable(String)
173
+ ).returns(T.attached_class)
174
+ end
175
+ def self.new(
176
+ # The stable registration field key
177
+ field:,
178
+ # Actionable review feedback
179
+ message:,
180
+ # Whether the feedback blocks registration or is a non-blocking warning
181
+ outcome:,
182
+ # A suggested replacement value, or null when none is suggested
183
+ suggested_value:
184
+ )
185
+ end
186
+
187
+ sig do
188
+ override.returns(
189
+ {
190
+ field: String,
191
+ message: String,
192
+ outcome:
193
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback::Outcome::TaggedSymbol,
194
+ suggested_value: T.nilable(String)
195
+ }
196
+ )
197
+ end
198
+ def to_hash
199
+ end
200
+
201
+ # Whether the feedback blocks registration or is a non-blocking warning
202
+ module Outcome
203
+ extend SurgeAPI::Internal::Type::Enum
204
+
205
+ TaggedSymbol =
206
+ T.type_alias do
207
+ T.all(
208
+ Symbol,
209
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback::Outcome
210
+ )
211
+ end
212
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
213
+
214
+ CHANGES_NEEDED =
215
+ T.let(
216
+ :changes_needed,
217
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback::Outcome::TaggedSymbol
218
+ )
219
+ WARNING =
220
+ T.let(
221
+ :warning,
222
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback::Outcome::TaggedSymbol
223
+ )
224
+
225
+ sig do
226
+ override.returns(
227
+ T::Array[
228
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback::Outcome::TaggedSymbol
229
+ ]
230
+ )
231
+ end
232
+ def self.values
233
+ end
234
+ end
235
+ end
236
+
237
+ # The public campaign status. Always `rejected` for this event.
238
+ module Status
239
+ extend SurgeAPI::Internal::Type::Enum
240
+
241
+ TaggedSymbol =
242
+ T.type_alias do
243
+ T.all(
244
+ Symbol,
245
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Status
246
+ )
247
+ end
248
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
249
+
250
+ REJECTED =
251
+ T.let(
252
+ :rejected,
253
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Status::TaggedSymbol
254
+ )
255
+
256
+ sig do
257
+ override.returns(
258
+ T::Array[
259
+ SurgeAPI::CampaignRejectedWebhookEvent::Data::Status::TaggedSymbol
260
+ ]
261
+ )
262
+ end
263
+ def self.values
264
+ end
265
+ end
266
+ end
267
+ end
268
+ end
269
+ end
@@ -0,0 +1,149 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class CampaignSubmittedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ SurgeAPI::CampaignSubmittedWebhookEvent,
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::CampaignSubmittedWebhookEvent::Data) }
20
+ attr_reader :data
21
+
22
+ sig do
23
+ params(data: SurgeAPI::CampaignSubmittedWebhookEvent::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.submitted` for this event.
32
+ sig { returns(Symbol) }
33
+ attr_accessor :type
34
+
35
+ sig do
36
+ params(
37
+ account_id: String,
38
+ data: SurgeAPI::CampaignSubmittedWebhookEvent::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.submitted` for this event.
51
+ type: :"campaign.submitted"
52
+ )
53
+ end
54
+
55
+ sig do
56
+ override.returns(
57
+ {
58
+ account_id: String,
59
+ data: SurgeAPI::CampaignSubmittedWebhookEvent::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::CampaignSubmittedWebhookEvent::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
+ # The public campaign status. Always `in_review` for this event.
82
+ sig do
83
+ returns(
84
+ SurgeAPI::CampaignSubmittedWebhookEvent::Data::Status::TaggedSymbol
85
+ )
86
+ end
87
+ attr_accessor :status
88
+
89
+ # The data associated with the event
90
+ sig do
91
+ params(
92
+ id: String,
93
+ status:
94
+ SurgeAPI::CampaignSubmittedWebhookEvent::Data::Status::OrSymbol
95
+ ).returns(T.attached_class)
96
+ end
97
+ def self.new(
98
+ # The unique identifier for the campaign
99
+ id:,
100
+ # The public campaign status. Always `in_review` for this event.
101
+ status:
102
+ )
103
+ end
104
+
105
+ sig do
106
+ override.returns(
107
+ {
108
+ id: String,
109
+ status:
110
+ SurgeAPI::CampaignSubmittedWebhookEvent::Data::Status::TaggedSymbol
111
+ }
112
+ )
113
+ end
114
+ def to_hash
115
+ end
116
+
117
+ # The public campaign status. Always `in_review` for this event.
118
+ module Status
119
+ extend SurgeAPI::Internal::Type::Enum
120
+
121
+ TaggedSymbol =
122
+ T.type_alias do
123
+ T.all(
124
+ Symbol,
125
+ SurgeAPI::CampaignSubmittedWebhookEvent::Data::Status
126
+ )
127
+ end
128
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
129
+
130
+ IN_REVIEW =
131
+ T.let(
132
+ :in_review,
133
+ SurgeAPI::CampaignSubmittedWebhookEvent::Data::Status::TaggedSymbol
134
+ )
135
+
136
+ sig do
137
+ override.returns(
138
+ T::Array[
139
+ SurgeAPI::CampaignSubmittedWebhookEvent::Data::Status::TaggedSymbol
140
+ ]
141
+ )
142
+ end
143
+ def self.values
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
149
+ end