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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +9 -9
- data/lib/surge_api/client.rb +4 -0
- data/lib/surge_api/internal/type/union.rb +2 -2
- data/lib/surge_api/models/call_ended_webhook_event.rb +8 -3
- data/lib/surge_api/models/campaign.rb +15 -7
- data/lib/surge_api/models/campaign_approved_webhook_event.rb +9 -1
- data/lib/surge_api/models/campaign_params.rb +6 -6
- data/lib/surge_api/models/campaign_rejected_webhook_event.rb +135 -0
- data/lib/surge_api/models/campaign_submitted_webhook_event.rb +74 -0
- data/lib/surge_api/models/campaign_update_params.rb +188 -1
- data/lib/surge_api/models/campaign_warning_webhook_event.rb +134 -0
- data/lib/surge_api/models/message.rb +18 -2
- data/lib/surge_api/models/message_delivered_webhook_event.rb +9 -1
- data/lib/surge_api/models/message_failed_webhook_event.rb +5 -4
- data/lib/surge_api/models/message_received_webhook_event.rb +9 -1
- data/lib/surge_api/models/message_sent_webhook_event.rb +9 -1
- data/lib/surge_api/models/phone_number.rb +9 -1
- data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +9 -1
- data/lib/surge_api/models/phone_number_imported_webhook_event.rb +9 -1
- data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
- data/lib/surge_api/models/phone_number_update_params.rb +9 -1
- data/lib/surge_api/models/toll_free_campaign.rb +132 -0
- data/lib/surge_api/models/toll_free_campaign_consent_flow.rb +176 -0
- data/lib/surge_api/models/toll_free_campaign_create_params.rb +22 -0
- data/lib/surge_api/models/toll_free_campaign_list_params.rb +42 -0
- data/lib/surge_api/models/toll_free_campaign_params.rb +286 -0
- data/lib/surge_api/models/toll_free_campaign_retrieve_params.rb +22 -0
- data/lib/surge_api/models/toll_free_campaign_update_params.rb +278 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +7 -1
- data/lib/surge_api/models/user_create_token_params.rb +15 -1
- data/lib/surge_api/models.rb +20 -0
- data/lib/surge_api/resources/accounts.rb +2 -2
- data/lib/surge_api/resources/campaigns.rb +26 -8
- data/lib/surge_api/resources/phone_numbers.rb +6 -2
- data/lib/surge_api/resources/toll_free_campaigns.rb +140 -0
- data/lib/surge_api/resources/users.rb +6 -1
- data/lib/surge_api/resources/webhooks.rb +1 -1
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +11 -0
- data/rbi/surge_api/client.rbi +3 -0
- data/rbi/surge_api/models/call_ended_webhook_event.rbi +6 -3
- data/rbi/surge_api/models/campaign.rbi +17 -9
- data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/campaign_params.rbi +9 -9
- data/rbi/surge_api/models/campaign_rejected_webhook_event.rbi +269 -0
- data/rbi/surge_api/models/campaign_submitted_webhook_event.rbi +149 -0
- data/rbi/surge_api/models/campaign_update_params.rbi +378 -1
- data/rbi/surge_api/models/campaign_warning_webhook_event.rbi +259 -0
- data/rbi/surge_api/models/message.rbi +16 -0
- data/rbi/surge_api/models/message_delivered_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/message_failed_webhook_event.rbi +7 -5
- data/rbi/surge_api/models/message_received_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/message_sent_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/phone_number.rbi +8 -0
- data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/phone_number_imported_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/phone_number_purchase_params.rbi +11 -0
- data/rbi/surge_api/models/phone_number_update_params.rbi +11 -0
- data/rbi/surge_api/models/toll_free_campaign.rbi +230 -0
- data/rbi/surge_api/models/toll_free_campaign_consent_flow.rbi +476 -0
- data/rbi/surge_api/models/toll_free_campaign_create_params.rbi +43 -0
- data/rbi/surge_api/models/toll_free_campaign_list_params.rbi +70 -0
- data/rbi/surge_api/models/toll_free_campaign_params.rbi +711 -0
- data/rbi/surge_api/models/toll_free_campaign_retrieve_params.rbi +43 -0
- data/rbi/surge_api/models/toll_free_campaign_update_params.rbi +760 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +3 -0
- data/rbi/surge_api/models/user_create_token_params.rbi +17 -0
- data/rbi/surge_api/models.rbi +22 -0
- data/rbi/surge_api/resources/accounts.rbi +2 -2
- data/rbi/surge_api/resources/campaigns.rbi +94 -12
- data/rbi/surge_api/resources/phone_numbers.rbi +6 -0
- data/rbi/surge_api/resources/toll_free_campaigns.rbi +129 -0
- data/rbi/surge_api/resources/users.rbi +6 -0
- data/rbi/surge_api/resources/webhooks.rbi +3 -0
- data/sig/surge_api/client.rbs +2 -0
- data/sig/surge_api/models/campaign.rbs +5 -0
- data/sig/surge_api/models/campaign_approved_webhook_event.rbs +5 -0
- data/sig/surge_api/models/campaign_rejected_webhook_event.rbs +115 -0
- data/sig/surge_api/models/campaign_submitted_webhook_event.rbs +67 -0
- data/sig/surge_api/models/campaign_update_params.rbs +128 -2
- data/sig/surge_api/models/campaign_warning_webhook_event.rbs +114 -0
- data/sig/surge_api/models/message.rbs +10 -0
- data/sig/surge_api/models/message_delivered_webhook_event.rbs +5 -0
- data/sig/surge_api/models/message_failed_webhook_event.rbs +4 -4
- data/sig/surge_api/models/message_received_webhook_event.rbs +5 -0
- data/sig/surge_api/models/message_sent_webhook_event.rbs +5 -0
- data/sig/surge_api/models/phone_number.rbs +5 -0
- data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +5 -0
- data/sig/surge_api/models/phone_number_imported_webhook_event.rbs +5 -0
- data/sig/surge_api/models/phone_number_purchase_params.rbs +7 -0
- data/sig/surge_api/models/phone_number_update_params.rbs +12 -1
- data/sig/surge_api/models/toll_free_campaign.rbs +126 -0
- data/sig/surge_api/models/toll_free_campaign_consent_flow.rbs +207 -0
- data/sig/surge_api/models/toll_free_campaign_create_params.rbs +25 -0
- data/sig/surge_api/models/toll_free_campaign_list_params.rbs +36 -0
- data/sig/surge_api/models/toll_free_campaign_params.rbs +321 -0
- data/sig/surge_api/models/toll_free_campaign_retrieve_params.rbs +23 -0
- data/sig/surge_api/models/toll_free_campaign_update_params.rbs +332 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +3 -0
- data/sig/surge_api/models/user_create_token_params.rbs +7 -1
- data/sig/surge_api/models.rbs +20 -0
- data/sig/surge_api/resources/campaigns.rbs +9 -1
- data/sig/surge_api/resources/phone_numbers.rbs +2 -0
- data/sig/surge_api/resources/toll_free_campaigns.rbs +44 -0
- data/sig/surge_api/resources/users.rbs +1 -0
- data/sig/surge_api/resources/webhooks.rbs +3 -0
- metadata +50 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c82e977c1b13f76e76cfdfc5b1923c25d8eb4c93d77004a725f23868a11235ce
|
|
4
|
+
data.tar.gz: c7a23b14a90c1f635c3e4c176e848ccccb5c067eb9a07562292212ea1eb30475
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e04c8bbd80d9e18e0e71ad8b52f177d32e9ba2aa419d6ffb75ba59c7d00f1491eee23174e75869d3631520b6918f6c77a44f64e956ebd8cb021d80ede2c96cc
|
|
7
|
+
data.tar.gz: a329bf6f328a0c740e1b8d68f8e280e7486ea3c1102ccbb07f2f113c16aa8f34691a7891f5365f13b9412485d41340a5406986b3fb1802752fdc688ffc83375d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.25.0](https://github.com/surgeapi/ruby-sdk/compare/v0.24.0...v0.25.0) (2026-10-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update ruby SDK ([27806c1](https://github.com/surgeapi/ruby-sdk/commit/27806c1f6f9e0441c462ff72f95fae52d14b5bf1))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* declare base64 as a runtime dependency ([f5a2435](https://github.com/surgeapi/ruby-sdk/commit/f5a2435d20809bb16fbfee02becb4e4621731841))
|
|
14
|
+
|
|
3
15
|
## 0.24.0 (2026-09-04)
|
|
4
16
|
|
|
5
17
|
Full Changelog: [v0.23.0...v0.24.0](https://github.com/surgeapi/ruby-sdk/compare/v0.23.0...v0.24.0)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "surge_api", "~> 0.
|
|
20
|
+
gem "surge_api", "~> 0.25.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -260,25 +260,25 @@ surge.messages.create("acct_01j9a43avnfqzbjfch6pygv1td", **params)
|
|
|
260
260
|
Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
|
|
261
261
|
|
|
262
262
|
```ruby
|
|
263
|
-
# :
|
|
264
|
-
puts(SurgeAPI::
|
|
263
|
+
# :high
|
|
264
|
+
puts(SurgeAPI::CampaignUpdateParams::Volume::HIGH)
|
|
265
265
|
|
|
266
|
-
# Revealed type: `T.all(SurgeAPI::
|
|
267
|
-
T.reveal_type(SurgeAPI::
|
|
266
|
+
# Revealed type: `T.all(SurgeAPI::CampaignUpdateParams::Volume, Symbol)`
|
|
267
|
+
T.reveal_type(SurgeAPI::CampaignUpdateParams::Volume::HIGH)
|
|
268
268
|
```
|
|
269
269
|
|
|
270
270
|
Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
|
|
271
271
|
|
|
272
272
|
```ruby
|
|
273
273
|
# Using the enum constants preserves the tagged type information:
|
|
274
|
-
surge.
|
|
275
|
-
|
|
274
|
+
surge.campaigns.update(
|
|
275
|
+
volume: SurgeAPI::CampaignUpdateParams::Volume::HIGH,
|
|
276
276
|
# …
|
|
277
277
|
)
|
|
278
278
|
|
|
279
279
|
# Literal values are also permissible:
|
|
280
|
-
surge.
|
|
281
|
-
|
|
280
|
+
surge.campaigns.update(
|
|
281
|
+
volume: :high,
|
|
282
282
|
# …
|
|
283
283
|
)
|
|
284
284
|
```
|
data/lib/surge_api/client.rb
CHANGED
|
@@ -48,6 +48,9 @@ module SurgeAPI
|
|
|
48
48
|
# @return [SurgeAPI::Resources::Recordings]
|
|
49
49
|
attr_reader :recordings
|
|
50
50
|
|
|
51
|
+
# @return [SurgeAPI::Resources::TollFreeCampaigns]
|
|
52
|
+
attr_reader :toll_free_campaigns
|
|
53
|
+
|
|
51
54
|
# @return [SurgeAPI::Resources::Users]
|
|
52
55
|
attr_reader :users
|
|
53
56
|
|
|
@@ -131,6 +134,7 @@ module SurgeAPI
|
|
|
131
134
|
@messages = SurgeAPI::Resources::Messages.new(client: self)
|
|
132
135
|
@phone_numbers = SurgeAPI::Resources::PhoneNumbers.new(client: self)
|
|
133
136
|
@recordings = SurgeAPI::Resources::Recordings.new(client: self)
|
|
137
|
+
@toll_free_campaigns = SurgeAPI::Resources::TollFreeCampaigns.new(client: self)
|
|
134
138
|
@users = SurgeAPI::Resources::Users.new(client: self)
|
|
135
139
|
@verifications = SurgeAPI::Resources::Verifications.new(client: self)
|
|
136
140
|
@webhooks = SurgeAPI::Resources::Webhooks.new(client: self)
|
|
@@ -12,7 +12,7 @@ module SurgeAPI
|
|
|
12
12
|
# puts(unwrap_webhook_event.account_id)
|
|
13
13
|
# when SurgeAPI::CampaignApprovedWebhookEvent
|
|
14
14
|
# puts(unwrap_webhook_event.data)
|
|
15
|
-
# when SurgeAPI::
|
|
15
|
+
# when SurgeAPI::CampaignRejectedWebhookEvent
|
|
16
16
|
# puts(unwrap_webhook_event.timestamp)
|
|
17
17
|
# else
|
|
18
18
|
# puts(unwrap_webhook_event)
|
|
@@ -24,7 +24,7 @@ module SurgeAPI
|
|
|
24
24
|
# puts(account_id)
|
|
25
25
|
# in {type: :"campaign.approved", account_id: account_id, data: data, timestamp: timestamp}
|
|
26
26
|
# puts(data)
|
|
27
|
-
# in {type: :"
|
|
27
|
+
# in {type: :"campaign.rejected", account_id: account_id, data: data, timestamp: timestamp}
|
|
28
28
|
# puts(timestamp)
|
|
29
29
|
# else
|
|
30
30
|
# puts(unwrap_webhook_event)
|
|
@@ -63,7 +63,8 @@ module SurgeAPI
|
|
|
63
63
|
required :initiated_at, Time
|
|
64
64
|
|
|
65
65
|
# @!attribute status
|
|
66
|
-
# The status of the call
|
|
66
|
+
# The status of the call. For inbound embedded-phone calls, `no_answer` means no
|
|
67
|
+
# embedded user answered, even if the caller reached voicemail.
|
|
67
68
|
#
|
|
68
69
|
# @return [Symbol, SurgeAPI::Models::CallEndedWebhookEvent::Data::Status]
|
|
69
70
|
required :status, enum: -> { SurgeAPI::CallEndedWebhookEvent::Data::Status }
|
|
@@ -87,6 +88,9 @@ module SurgeAPI
|
|
|
87
88
|
optional :to, String, nil?: true
|
|
88
89
|
|
|
89
90
|
# @!method initialize(id:, contact:, duration:, initiated_at:, status:, from: nil, phone_number_id: nil, to: nil)
|
|
91
|
+
# Some parameter documentations has been truncated, see
|
|
92
|
+
# {SurgeAPI::Models::CallEndedWebhookEvent::Data} for more details.
|
|
93
|
+
#
|
|
90
94
|
# The data associated with the event
|
|
91
95
|
#
|
|
92
96
|
# @param id [String] The unique identifier for the call
|
|
@@ -97,7 +101,7 @@ module SurgeAPI
|
|
|
97
101
|
#
|
|
98
102
|
# @param initiated_at [Time] When the call was initiated
|
|
99
103
|
#
|
|
100
|
-
# @param status [Symbol, SurgeAPI::Models::CallEndedWebhookEvent::Data::Status] The status of the call
|
|
104
|
+
# @param status [Symbol, SurgeAPI::Models::CallEndedWebhookEvent::Data::Status] The status of the call. For inbound embedded-phone calls, `no_answer` means no e
|
|
101
105
|
#
|
|
102
106
|
# @param from [String, nil] The E.164 phone number of the caller
|
|
103
107
|
#
|
|
@@ -105,7 +109,8 @@ module SurgeAPI
|
|
|
105
109
|
#
|
|
106
110
|
# @param to [String, nil] The E.164 phone number of the callee
|
|
107
111
|
|
|
108
|
-
# The status of the call
|
|
112
|
+
# The status of the call. For inbound embedded-phone calls, `no_answer` means no
|
|
113
|
+
# embedded user answered, even if the caller reached voicemail.
|
|
109
114
|
#
|
|
110
115
|
# @see SurgeAPI::Models::CallEndedWebhookEvent::Data#status
|
|
111
116
|
module Status
|
|
@@ -10,6 +10,12 @@ module SurgeAPI
|
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
12
12
|
|
|
13
|
+
# @!attribute account_id
|
|
14
|
+
# The ID of the account that owns this campaign
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :account_id, String
|
|
18
|
+
|
|
13
19
|
# @!attribute consent_flow
|
|
14
20
|
# A string explaining the method through which end users will opt in to receive
|
|
15
21
|
# messages from the brand. Typically this should include URLs for opt-in forms or
|
|
@@ -101,11 +107,11 @@ module SurgeAPI
|
|
|
101
107
|
# This will be one of the following:
|
|
102
108
|
#
|
|
103
109
|
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
|
104
|
-
# T-Mobile customers each day. In this case your
|
|
105
|
-
#
|
|
110
|
+
# T-Mobile customers each day. In this case your project will be charged for the
|
|
111
|
+
# setup fee for a low volume number upon receipt of the API request.
|
|
106
112
|
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
|
107
113
|
# T-Mobile customers each day, depending on the trust score assigned by The
|
|
108
|
-
# Campaign Registry. Your
|
|
114
|
+
# Campaign Registry. Your project will be charged for the setup fee for a high
|
|
109
115
|
# volume number upon receipt of the API request, and phone numbers will be
|
|
110
116
|
# charged as high volume numbers going forward.
|
|
111
117
|
#
|
|
@@ -130,7 +136,7 @@ module SurgeAPI
|
|
|
130
136
|
# @return [String, nil]
|
|
131
137
|
optional :terms_and_conditions_url, String
|
|
132
138
|
|
|
133
|
-
# @!method initialize(id:, consent_flow:, description:, includes:, message_samples:, privacy_policy_url:, status:, use_cases:, volume:, link_sample: nil, terms_and_conditions_url: nil)
|
|
139
|
+
# @!method initialize(id:, account_id:, consent_flow:, description:, includes:, message_samples:, privacy_policy_url:, status:, use_cases:, volume:, link_sample: nil, terms_and_conditions_url: nil)
|
|
134
140
|
# Some parameter documentations has been truncated, see
|
|
135
141
|
# {SurgeAPI::Models::Campaign} for more details.
|
|
136
142
|
#
|
|
@@ -139,6 +145,8 @@ module SurgeAPI
|
|
|
139
145
|
#
|
|
140
146
|
# @param id [String] The campaign ID
|
|
141
147
|
#
|
|
148
|
+
# @param account_id [String] The ID of the account that owns this campaign
|
|
149
|
+
#
|
|
142
150
|
# @param consent_flow [String] A string explaining the method through which end users will opt in to receive me
|
|
143
151
|
#
|
|
144
152
|
# @param description [String] An explanation of the organization's purpose and how it will be using text messa
|
|
@@ -209,11 +217,11 @@ module SurgeAPI
|
|
|
209
217
|
# This will be one of the following:
|
|
210
218
|
#
|
|
211
219
|
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
|
212
|
-
# T-Mobile customers each day. In this case your
|
|
213
|
-
#
|
|
220
|
+
# T-Mobile customers each day. In this case your project will be charged for the
|
|
221
|
+
# setup fee for a low volume number upon receipt of the API request.
|
|
214
222
|
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
|
215
223
|
# T-Mobile customers each day, depending on the trust score assigned by The
|
|
216
|
-
# Campaign Registry. Your
|
|
224
|
+
# Campaign Registry. Your project will be charged for the setup fee for a high
|
|
217
225
|
# volume number upon receipt of the API request, and phone numbers will be
|
|
218
226
|
# charged as high volume numbers going forward.
|
|
219
227
|
#
|
|
@@ -44,17 +44,25 @@ module SurgeAPI
|
|
|
44
44
|
# @return [String]
|
|
45
45
|
required :id, String
|
|
46
46
|
|
|
47
|
+
# @!attribute account_id
|
|
48
|
+
# The ID of the account that owns this campaign
|
|
49
|
+
#
|
|
50
|
+
# @return [String]
|
|
51
|
+
required :account_id, String
|
|
52
|
+
|
|
47
53
|
# @!attribute status
|
|
48
54
|
# The status of the campaign. Will always be `active` for this event.
|
|
49
55
|
#
|
|
50
56
|
# @return [Symbol, SurgeAPI::Models::CampaignApprovedWebhookEvent::Data::Status]
|
|
51
57
|
required :status, enum: -> { SurgeAPI::CampaignApprovedWebhookEvent::Data::Status }
|
|
52
58
|
|
|
53
|
-
# @!method initialize(id:, status:)
|
|
59
|
+
# @!method initialize(id:, account_id:, status:)
|
|
54
60
|
# The data associated with the event
|
|
55
61
|
#
|
|
56
62
|
# @param id [String] The unique identifier for the campaign
|
|
57
63
|
#
|
|
64
|
+
# @param account_id [String] The ID of the account that owns this campaign
|
|
65
|
+
#
|
|
58
66
|
# @param status [Symbol, SurgeAPI::Models::CampaignApprovedWebhookEvent::Data::Status] The status of the campaign. Will always be `active` for this event.
|
|
59
67
|
|
|
60
68
|
# The status of the campaign. Will always be `active` for this event.
|
|
@@ -95,11 +95,11 @@ module SurgeAPI
|
|
|
95
95
|
# This will be one of the following:
|
|
96
96
|
#
|
|
97
97
|
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
|
98
|
-
# T-Mobile customers each day. In this case your
|
|
99
|
-
#
|
|
98
|
+
# T-Mobile customers each day. In this case your project will be charged for the
|
|
99
|
+
# setup fee for a low volume number upon receipt of the API request.
|
|
100
100
|
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
|
101
101
|
# T-Mobile customers each day, depending on the trust score assigned by The
|
|
102
|
-
# Campaign Registry. Your
|
|
102
|
+
# Campaign Registry. Your project will be charged for the setup fee for a high
|
|
103
103
|
# volume number upon receipt of the API request, and phone numbers will be
|
|
104
104
|
# charged as high volume numbers going forward.
|
|
105
105
|
#
|
|
@@ -175,11 +175,11 @@ module SurgeAPI
|
|
|
175
175
|
# This will be one of the following:
|
|
176
176
|
#
|
|
177
177
|
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
|
178
|
-
# T-Mobile customers each day. In this case your
|
|
179
|
-
#
|
|
178
|
+
# T-Mobile customers each day. In this case your project will be charged for the
|
|
179
|
+
# setup fee for a low volume number upon receipt of the API request.
|
|
180
180
|
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
|
181
181
|
# T-Mobile customers each day, depending on the trust score assigned by The
|
|
182
|
-
# Campaign Registry. Your
|
|
182
|
+
# Campaign Registry. Your project will be charged for the setup fee for a high
|
|
183
183
|
# volume number upon receipt of the API request, and phone numbers will be
|
|
184
184
|
# charged as high volume numbers going forward.
|
|
185
185
|
#
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class CampaignRejectedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute account_id
|
|
7
|
+
# The ID of the account in which this event occurred
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :account_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute data
|
|
13
|
+
# The data associated with the event
|
|
14
|
+
#
|
|
15
|
+
# @return [SurgeAPI::Models::CampaignRejectedWebhookEvent::Data]
|
|
16
|
+
required :data, -> { SurgeAPI::CampaignRejectedWebhookEvent::Data }
|
|
17
|
+
|
|
18
|
+
# @!attribute timestamp
|
|
19
|
+
# The timestamp when this event occurred, in ISO8601 format
|
|
20
|
+
#
|
|
21
|
+
# @return [Time]
|
|
22
|
+
required :timestamp, Time
|
|
23
|
+
|
|
24
|
+
# @!attribute type
|
|
25
|
+
# The type of the event. Always `campaign.rejected` for this event.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :"campaign.rejected"]
|
|
28
|
+
required :type, const: :"campaign.rejected"
|
|
29
|
+
|
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"campaign.rejected")
|
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
|
32
|
+
#
|
|
33
|
+
# @param data [SurgeAPI::Models::CampaignRejectedWebhookEvent::Data] The data associated with the event
|
|
34
|
+
#
|
|
35
|
+
# @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
|
|
36
|
+
#
|
|
37
|
+
# @param type [Symbol, :"campaign.rejected"] The type of the event. Always `campaign.rejected` for this event.
|
|
38
|
+
|
|
39
|
+
# @see SurgeAPI::Models::CampaignRejectedWebhookEvent#data
|
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
|
41
|
+
# @!attribute id
|
|
42
|
+
# The unique identifier for the campaign
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
required :id, String
|
|
46
|
+
|
|
47
|
+
# @!attribute feedback
|
|
48
|
+
# Customer-visible field-level registration feedback. Rejection events may include
|
|
49
|
+
# non-blocking warnings alongside changes-needed items.
|
|
50
|
+
#
|
|
51
|
+
# @return [Array<SurgeAPI::Models::CampaignRejectedWebhookEvent::Data::Feedback>]
|
|
52
|
+
required :feedback,
|
|
53
|
+
-> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback] }
|
|
54
|
+
|
|
55
|
+
# @!attribute status
|
|
56
|
+
# The public campaign status. Always `rejected` for this event.
|
|
57
|
+
#
|
|
58
|
+
# @return [Symbol, SurgeAPI::Models::CampaignRejectedWebhookEvent::Data::Status]
|
|
59
|
+
required :status, enum: -> { SurgeAPI::CampaignRejectedWebhookEvent::Data::Status }
|
|
60
|
+
|
|
61
|
+
# @!method initialize(id:, feedback:, status:)
|
|
62
|
+
# Some parameter documentations has been truncated, see
|
|
63
|
+
# {SurgeAPI::Models::CampaignRejectedWebhookEvent::Data} for more details.
|
|
64
|
+
#
|
|
65
|
+
# The data associated with the event
|
|
66
|
+
#
|
|
67
|
+
# @param id [String] The unique identifier for the campaign
|
|
68
|
+
#
|
|
69
|
+
# @param feedback [Array<SurgeAPI::Models::CampaignRejectedWebhookEvent::Data::Feedback>] Customer-visible field-level registration feedback. Rejection events may include
|
|
70
|
+
#
|
|
71
|
+
# @param status [Symbol, SurgeAPI::Models::CampaignRejectedWebhookEvent::Data::Status] The public campaign status. Always `rejected` for this event.
|
|
72
|
+
|
|
73
|
+
class Feedback < SurgeAPI::Internal::Type::BaseModel
|
|
74
|
+
# @!attribute field
|
|
75
|
+
# The stable registration field key
|
|
76
|
+
#
|
|
77
|
+
# @return [String]
|
|
78
|
+
required :field, String
|
|
79
|
+
|
|
80
|
+
# @!attribute message
|
|
81
|
+
# Actionable review feedback
|
|
82
|
+
#
|
|
83
|
+
# @return [String]
|
|
84
|
+
required :message, String
|
|
85
|
+
|
|
86
|
+
# @!attribute outcome
|
|
87
|
+
# Whether the feedback blocks registration or is a non-blocking warning
|
|
88
|
+
#
|
|
89
|
+
# @return [Symbol, SurgeAPI::Models::CampaignRejectedWebhookEvent::Data::Feedback::Outcome]
|
|
90
|
+
required :outcome, enum: -> { SurgeAPI::CampaignRejectedWebhookEvent::Data::Feedback::Outcome }
|
|
91
|
+
|
|
92
|
+
# @!attribute suggested_value
|
|
93
|
+
# A suggested replacement value, or null when none is suggested
|
|
94
|
+
#
|
|
95
|
+
# @return [String, nil]
|
|
96
|
+
required :suggested_value, String, nil?: true
|
|
97
|
+
|
|
98
|
+
# @!method initialize(field:, message:, outcome:, suggested_value:)
|
|
99
|
+
# @param field [String] The stable registration field key
|
|
100
|
+
#
|
|
101
|
+
# @param message [String] Actionable review feedback
|
|
102
|
+
#
|
|
103
|
+
# @param outcome [Symbol, SurgeAPI::Models::CampaignRejectedWebhookEvent::Data::Feedback::Outcome] Whether the feedback blocks registration or is a non-blocking warning
|
|
104
|
+
#
|
|
105
|
+
# @param suggested_value [String, nil] A suggested replacement value, or null when none is suggested
|
|
106
|
+
|
|
107
|
+
# Whether the feedback blocks registration or is a non-blocking warning
|
|
108
|
+
#
|
|
109
|
+
# @see SurgeAPI::Models::CampaignRejectedWebhookEvent::Data::Feedback#outcome
|
|
110
|
+
module Outcome
|
|
111
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
112
|
+
|
|
113
|
+
CHANGES_NEEDED = :changes_needed
|
|
114
|
+
WARNING = :warning
|
|
115
|
+
|
|
116
|
+
# @!method self.values
|
|
117
|
+
# @return [Array<Symbol>]
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# The public campaign status. Always `rejected` for this event.
|
|
122
|
+
#
|
|
123
|
+
# @see SurgeAPI::Models::CampaignRejectedWebhookEvent::Data#status
|
|
124
|
+
module Status
|
|
125
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
126
|
+
|
|
127
|
+
REJECTED = :rejected
|
|
128
|
+
|
|
129
|
+
# @!method self.values
|
|
130
|
+
# @return [Array<Symbol>]
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class CampaignSubmittedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute account_id
|
|
7
|
+
# The ID of the account in which this event occurred
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :account_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute data
|
|
13
|
+
# The data associated with the event
|
|
14
|
+
#
|
|
15
|
+
# @return [SurgeAPI::Models::CampaignSubmittedWebhookEvent::Data]
|
|
16
|
+
required :data, -> { SurgeAPI::CampaignSubmittedWebhookEvent::Data }
|
|
17
|
+
|
|
18
|
+
# @!attribute timestamp
|
|
19
|
+
# The timestamp when this event occurred, in ISO8601 format
|
|
20
|
+
#
|
|
21
|
+
# @return [Time]
|
|
22
|
+
required :timestamp, Time
|
|
23
|
+
|
|
24
|
+
# @!attribute type
|
|
25
|
+
# The type of the event. Always `campaign.submitted` for this event.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :"campaign.submitted"]
|
|
28
|
+
required :type, const: :"campaign.submitted"
|
|
29
|
+
|
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"campaign.submitted")
|
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
|
32
|
+
#
|
|
33
|
+
# @param data [SurgeAPI::Models::CampaignSubmittedWebhookEvent::Data] The data associated with the event
|
|
34
|
+
#
|
|
35
|
+
# @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
|
|
36
|
+
#
|
|
37
|
+
# @param type [Symbol, :"campaign.submitted"] The type of the event. Always `campaign.submitted` for this event.
|
|
38
|
+
|
|
39
|
+
# @see SurgeAPI::Models::CampaignSubmittedWebhookEvent#data
|
|
40
|
+
class Data < SurgeAPI::Internal::Type::BaseModel
|
|
41
|
+
# @!attribute id
|
|
42
|
+
# The unique identifier for the campaign
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
required :id, String
|
|
46
|
+
|
|
47
|
+
# @!attribute status
|
|
48
|
+
# The public campaign status. Always `in_review` for this event.
|
|
49
|
+
#
|
|
50
|
+
# @return [Symbol, SurgeAPI::Models::CampaignSubmittedWebhookEvent::Data::Status]
|
|
51
|
+
required :status, enum: -> { SurgeAPI::CampaignSubmittedWebhookEvent::Data::Status }
|
|
52
|
+
|
|
53
|
+
# @!method initialize(id:, status:)
|
|
54
|
+
# The data associated with the event
|
|
55
|
+
#
|
|
56
|
+
# @param id [String] The unique identifier for the campaign
|
|
57
|
+
#
|
|
58
|
+
# @param status [Symbol, SurgeAPI::Models::CampaignSubmittedWebhookEvent::Data::Status] The public campaign status. Always `in_review` for this event.
|
|
59
|
+
|
|
60
|
+
# The public campaign status. Always `in_review` for this event.
|
|
61
|
+
#
|
|
62
|
+
# @see SurgeAPI::Models::CampaignSubmittedWebhookEvent::Data#status
|
|
63
|
+
module Status
|
|
64
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
65
|
+
|
|
66
|
+
IN_REVIEW = :in_review
|
|
67
|
+
|
|
68
|
+
# @!method self.values
|
|
69
|
+
# @return [Array<Symbol>]
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|