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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -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/account_retrieve_status_params.rb +1 -0
- data/lib/surge_api/models/call_ended_webhook_event.rb +8 -3
- data/lib/surge_api/models/campaign.rb +21 -13
- data/lib/surge_api/models/campaign_approved_webhook_event.rb +9 -1
- data/lib/surge_api/models/campaign_params.rb +11 -12
- 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 +42 -2
- data/lib/surge_api/models/message_delivered_webhook_event.rb +29 -1
- data/lib/surge_api/models/message_failed_webhook_event.rb +26 -5
- data/lib/surge_api/models/message_received_webhook_event.rb +29 -1
- data/lib/surge_api/models/message_sent_webhook_event.rb +29 -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 +160 -0
- 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 +9 -1
- data/lib/surge_api/models/user_create_token_params.rb +15 -1
- data/lib/surge_api/models.rb +22 -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 +12 -0
- data/rbi/surge_api/client.rbi +3 -0
- data/rbi/surge_api/models/account_retrieve_status_params.rbi +5 -0
- data/rbi/surge_api/models/call_ended_webhook_event.rbi +6 -3
- data/rbi/surge_api/models/campaign.rbi +26 -19
- data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/campaign_params.rbi +17 -19
- 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 +50 -3
- data/rbi/surge_api/models/message_delivered_webhook_event.rbi +52 -0
- data/rbi/surge_api/models/message_failed_webhook_event.rbi +47 -5
- data/rbi/surge_api/models/message_received_webhook_event.rbi +49 -0
- data/rbi/surge_api/models/message_sent_webhook_event.rbi +46 -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 +318 -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 +4 -0
- data/rbi/surge_api/models/user_create_token_params.rbi +17 -0
- data/rbi/surge_api/models.rbi +25 -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 +4 -0
- data/sig/surge_api/client.rbs +2 -0
- data/sig/surge_api/models/account_retrieve_status_params.rbs +2 -1
- data/sig/surge_api/models/campaign.rbs +8 -1
- 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 +36 -3
- data/sig/surge_api/models/message_delivered_webhook_event.rbs +20 -0
- data/sig/surge_api/models/message_failed_webhook_event.rbs +19 -4
- data/sig/surge_api/models/message_received_webhook_event.rbs +20 -0
- data/sig/surge_api/models/message_sent_webhook_event.rbs +20 -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 +130 -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 +4 -0
- data/sig/surge_api/models/user_create_token_params.rbs +7 -1
- data/sig/surge_api/models.rbs +22 -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 +4 -0
- metadata +53 -7
|
@@ -13,10 +13,197 @@ module SurgeAPI
|
|
|
13
13
|
# @return [String]
|
|
14
14
|
required :id, String
|
|
15
15
|
|
|
16
|
-
# @!
|
|
16
|
+
# @!attribute consent_flow
|
|
17
|
+
# A string explaining the method through which end users will opt in to receive
|
|
18
|
+
# messages from the brand. Typically this should include URLs for opt-in forms or
|
|
19
|
+
# screenshots that might be helpful in explaining the flow to someone unfamiliar
|
|
20
|
+
# with the organization's purpose.
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :consent_flow, String
|
|
24
|
+
|
|
25
|
+
# @!attribute description
|
|
26
|
+
# An explanation of the organization's purpose and how it will be using text
|
|
27
|
+
# messaging to accomplish that purpose.
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :description, String
|
|
31
|
+
|
|
32
|
+
# @!attribute includes
|
|
33
|
+
# A list of properties that this campaign should include. These properties can be
|
|
34
|
+
# any of the following values:
|
|
35
|
+
#
|
|
36
|
+
# - `links` - whether the campaign might send links in messages
|
|
37
|
+
# - `phone_numbers` - whether the campaign might send phone numbers in messages
|
|
38
|
+
# - `age_gated` - whether the campaign contains age gated content (controlled
|
|
39
|
+
# substances or adult content)
|
|
40
|
+
# - `direct_lending` - whether the campaign contains content related to direct
|
|
41
|
+
# lending or other loan arrangements
|
|
42
|
+
#
|
|
43
|
+
# @return [Array<Symbol, SurgeAPI::Models::CampaignUpdateParams::Include>, nil]
|
|
44
|
+
optional :includes,
|
|
45
|
+
-> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignUpdateParams::Include] }
|
|
46
|
+
|
|
47
|
+
# @!attribute link_sample
|
|
48
|
+
# A sample link that might be sent by this campaign. This is required when
|
|
49
|
+
# `includes` contains `links`. Provide the same URL or domain that the campaign
|
|
50
|
+
# will use in production. If links from other domains are sent through this
|
|
51
|
+
# campaign, they are much more likely to be filtered by the carriers.
|
|
52
|
+
#
|
|
53
|
+
# @return [String, nil]
|
|
54
|
+
optional :link_sample, String, nil?: true
|
|
55
|
+
|
|
56
|
+
# @!attribute message_samples
|
|
57
|
+
# An array of 2-5 strings with examples of the messages that will be sent from
|
|
58
|
+
# this campaign. Typically the first sample should be a compliance message like
|
|
59
|
+
# `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
|
|
60
|
+
# These samples don't necessarily need to be the only templates that will be used
|
|
61
|
+
# for the campaign, but they should reflect the purpose of the messages that will
|
|
62
|
+
# be sent. Any variable content can be reflected by wrapping it in square brackets
|
|
63
|
+
# like `[customer name]`.
|
|
64
|
+
#
|
|
65
|
+
# @return [Array<String>, nil]
|
|
66
|
+
optional :message_samples, SurgeAPI::Internal::Type::ArrayOf[String]
|
|
67
|
+
|
|
68
|
+
# @!attribute privacy_policy_url
|
|
69
|
+
# The URL of the privacy policy for the brand in question. This may be a shared
|
|
70
|
+
# privacy policy if it's the policy that is displayed to end users when they opt
|
|
71
|
+
# in to messaging.
|
|
72
|
+
#
|
|
73
|
+
# @return [String, nil]
|
|
74
|
+
optional :privacy_policy_url, String
|
|
75
|
+
|
|
76
|
+
# @!attribute terms_and_conditions_url
|
|
77
|
+
# The URL of the terms and conditions presented to end users when they opt in to
|
|
78
|
+
# messaging. These terms and conditions may be shared among all of a platform's
|
|
79
|
+
# customers if they're the terms that are presented to end users when they opt in
|
|
80
|
+
# to messaging.
|
|
81
|
+
#
|
|
82
|
+
# @return [String, nil]
|
|
83
|
+
optional :terms_and_conditions_url, String
|
|
84
|
+
|
|
85
|
+
# @!attribute use_cases
|
|
86
|
+
# A list containing 1-5 types of messages that will be sent with this campaign.
|
|
87
|
+
#
|
|
88
|
+
# The following use cases are typically available to all brands:
|
|
89
|
+
#
|
|
90
|
+
# - `account_notification` - For sending reminders, alerts, and general
|
|
91
|
+
# account-related notifications like booking confirmations or appointment
|
|
92
|
+
# reminders.
|
|
93
|
+
# - `customer_care` - For account support, troubleshooting, and general customer
|
|
94
|
+
# service communication.
|
|
95
|
+
# - `delivery_notification` - For notifying customers about the status of product
|
|
96
|
+
# or service deliveries.
|
|
97
|
+
# - `fraud_alert` - For warning customers about suspicious or potentially
|
|
98
|
+
# fraudulent activity.
|
|
99
|
+
# - `higher_education` - For messaging related to colleges, universities, and
|
|
100
|
+
# school districts outside of K–12.
|
|
101
|
+
# - `marketing` - For promotional or advertising messages intended to market
|
|
102
|
+
# products or services.
|
|
103
|
+
# - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
|
|
104
|
+
# - `public_service_announcement` - For raising awareness about social issues or
|
|
105
|
+
# important public information.
|
|
106
|
+
# - `security_alert` - For alerts related to potential security breaches or
|
|
107
|
+
# compromised systems requiring user action.
|
|
108
|
+
# - `two_factor_authentication` - For sending one-time passwords or verification
|
|
109
|
+
# codes for login or password reset.
|
|
110
|
+
#
|
|
111
|
+
# For access to special use cases not shown here, reach out to support@surge.app.
|
|
112
|
+
#
|
|
113
|
+
# @return [Array<Symbol, SurgeAPI::Models::CampaignUpdateParams::UseCase>, nil]
|
|
114
|
+
optional :use_cases,
|
|
115
|
+
-> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignUpdateParams::UseCase] }
|
|
116
|
+
|
|
117
|
+
# @!attribute volume
|
|
118
|
+
# This will be one of the following:
|
|
119
|
+
#
|
|
120
|
+
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
|
121
|
+
# T-Mobile customers each day. In this case your project will be charged for the
|
|
122
|
+
# setup fee for a low volume number upon receipt of the API request.
|
|
123
|
+
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
|
124
|
+
# T-Mobile customers each day, depending on the trust score assigned by The
|
|
125
|
+
# Campaign Registry. Your project will be charged for the setup fee for a high
|
|
126
|
+
# volume number upon receipt of the API request, and phone numbers will be
|
|
127
|
+
# charged as high volume numbers going forward.
|
|
128
|
+
#
|
|
129
|
+
# @return [Symbol, SurgeAPI::Models::CampaignUpdateParams::Volume, nil]
|
|
130
|
+
optional :volume, enum: -> { SurgeAPI::CampaignUpdateParams::Volume }
|
|
131
|
+
|
|
132
|
+
# @!method initialize(id:, consent_flow: nil, description: nil, includes: nil, link_sample: nil, message_samples: nil, privacy_policy_url: nil, terms_and_conditions_url: nil, use_cases: nil, volume: nil, request_options: {})
|
|
133
|
+
# Some parameter documentations has been truncated, see
|
|
134
|
+
# {SurgeAPI::Models::CampaignUpdateParams} for more details.
|
|
135
|
+
#
|
|
17
136
|
# @param id [String] The ID of the campaign to update.
|
|
18
137
|
#
|
|
138
|
+
# @param consent_flow [String] A string explaining the method through which end users will opt in to receive me
|
|
139
|
+
#
|
|
140
|
+
# @param description [String] An explanation of the organization's purpose and how it will be using text messa
|
|
141
|
+
#
|
|
142
|
+
# @param includes [Array<Symbol, SurgeAPI::Models::CampaignUpdateParams::Include>] A list of properties that this campaign should include. These properties can be
|
|
143
|
+
#
|
|
144
|
+
# @param link_sample [String, nil] A sample link that might be sent by this campaign. This is required when `includ
|
|
145
|
+
#
|
|
146
|
+
# @param message_samples [Array<String>] An array of 2-5 strings with examples of the messages that will be sent from thi
|
|
147
|
+
#
|
|
148
|
+
# @param privacy_policy_url [String] The URL of the privacy policy for the brand in question. This may be a shared pr
|
|
149
|
+
#
|
|
150
|
+
# @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
|
|
151
|
+
#
|
|
152
|
+
# @param use_cases [Array<Symbol, SurgeAPI::Models::CampaignUpdateParams::UseCase>] A list containing 1-5 types of messages that will be sent with this campaign.
|
|
153
|
+
#
|
|
154
|
+
# @param volume [Symbol, SurgeAPI::Models::CampaignUpdateParams::Volume] This will be one of the following:
|
|
155
|
+
#
|
|
19
156
|
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
157
|
+
|
|
158
|
+
module Include
|
|
159
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
160
|
+
|
|
161
|
+
LINKS = :links
|
|
162
|
+
PHONE_NUMBERS = :phone_numbers
|
|
163
|
+
AGE_GATED = :age_gated
|
|
164
|
+
DIRECT_LENDING = :direct_lending
|
|
165
|
+
|
|
166
|
+
# @!method self.values
|
|
167
|
+
# @return [Array<Symbol>]
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
module UseCase
|
|
171
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
172
|
+
|
|
173
|
+
ACCOUNT_NOTIFICATION = :account_notification
|
|
174
|
+
CUSTOMER_CARE = :customer_care
|
|
175
|
+
DELIVERY_NOTIFICATION = :delivery_notification
|
|
176
|
+
FRAUD_ALERT = :fraud_alert
|
|
177
|
+
HIGHER_EDUCATION = :higher_education
|
|
178
|
+
MARKETING = :marketing
|
|
179
|
+
POLLING_VOTING = :polling_voting
|
|
180
|
+
PUBLIC_SERVICE_ANNOUNCEMENT = :public_service_announcement
|
|
181
|
+
SECURITY_ALERT = :security_alert
|
|
182
|
+
TWO_FACTOR_AUTHENTICATION = :two_factor_authentication
|
|
183
|
+
|
|
184
|
+
# @!method self.values
|
|
185
|
+
# @return [Array<Symbol>]
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# This will be one of the following:
|
|
189
|
+
#
|
|
190
|
+
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
|
191
|
+
# T-Mobile customers each day. In this case your project will be charged for the
|
|
192
|
+
# setup fee for a low volume number upon receipt of the API request.
|
|
193
|
+
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
|
194
|
+
# T-Mobile customers each day, depending on the trust score assigned by The
|
|
195
|
+
# Campaign Registry. Your project will be charged for the setup fee for a high
|
|
196
|
+
# volume number upon receipt of the API request, and phone numbers will be
|
|
197
|
+
# charged as high volume numbers going forward.
|
|
198
|
+
module Volume
|
|
199
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
200
|
+
|
|
201
|
+
HIGH = :high
|
|
202
|
+
LOW = :low
|
|
203
|
+
|
|
204
|
+
# @!method self.values
|
|
205
|
+
# @return [Array<Symbol>]
|
|
206
|
+
end
|
|
20
207
|
end
|
|
21
208
|
end
|
|
22
209
|
end
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class CampaignWarningWebhookEvent < 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::CampaignWarningWebhookEvent::Data]
|
|
16
|
+
required :data, -> { SurgeAPI::CampaignWarningWebhookEvent::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.warning` for this event.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :"campaign.warning"]
|
|
28
|
+
required :type, const: :"campaign.warning"
|
|
29
|
+
|
|
30
|
+
# @!method initialize(account_id:, data:, timestamp:, type: :"campaign.warning")
|
|
31
|
+
# @param account_id [String] The ID of the account in which this event occurred
|
|
32
|
+
#
|
|
33
|
+
# @param data [SurgeAPI::Models::CampaignWarningWebhookEvent::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.warning"] The type of the event. Always `campaign.warning` for this event.
|
|
38
|
+
|
|
39
|
+
# @see SurgeAPI::Models::CampaignWarningWebhookEvent#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::CampaignWarningWebhookEvent::Data::Feedback>]
|
|
52
|
+
required :feedback,
|
|
53
|
+
-> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback] }
|
|
54
|
+
|
|
55
|
+
# @!attribute status
|
|
56
|
+
# The public campaign status. Always `in_review` for this event.
|
|
57
|
+
#
|
|
58
|
+
# @return [Symbol, SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Status]
|
|
59
|
+
required :status, enum: -> { SurgeAPI::CampaignWarningWebhookEvent::Data::Status }
|
|
60
|
+
|
|
61
|
+
# @!method initialize(id:, feedback:, status:)
|
|
62
|
+
# Some parameter documentations has been truncated, see
|
|
63
|
+
# {SurgeAPI::Models::CampaignWarningWebhookEvent::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::CampaignWarningWebhookEvent::Data::Feedback>] Customer-visible field-level registration feedback. Rejection events may include
|
|
70
|
+
#
|
|
71
|
+
# @param status [Symbol, SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Status] The public campaign status. Always `in_review` 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::CampaignWarningWebhookEvent::Data::Feedback::Outcome]
|
|
90
|
+
required :outcome, enum: -> { SurgeAPI::CampaignWarningWebhookEvent::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::CampaignWarningWebhookEvent::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::CampaignWarningWebhookEvent::Data::Feedback#outcome
|
|
110
|
+
module Outcome
|
|
111
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
112
|
+
|
|
113
|
+
WARNING = :warning
|
|
114
|
+
|
|
115
|
+
# @!method self.values
|
|
116
|
+
# @return [Array<Symbol>]
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# The public campaign status. Always `in_review` for this event.
|
|
121
|
+
#
|
|
122
|
+
# @see SurgeAPI::Models::CampaignWarningWebhookEvent::Data#status
|
|
123
|
+
module Status
|
|
124
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
125
|
+
|
|
126
|
+
IN_REVIEW = :in_review
|
|
127
|
+
|
|
128
|
+
# @!method self.values
|
|
129
|
+
# @return [Array<Symbol>]
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
@@ -34,13 +34,25 @@ module SurgeAPI
|
|
|
34
34
|
# @return [SurgeAPI::Models::Message::Conversation, nil]
|
|
35
35
|
optional :conversation, -> { SurgeAPI::Message::Conversation }
|
|
36
36
|
|
|
37
|
+
# @!attribute failure_reason
|
|
38
|
+
# The reason the message failed, or null if no failure reason is set.
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :failure_reason, String, nil?: true
|
|
42
|
+
|
|
37
43
|
# @!attribute metadata
|
|
38
44
|
# Set of key-value pairs that will be stored with the object.
|
|
39
45
|
#
|
|
40
46
|
# @return [Hash{Symbol=>String}, nil]
|
|
41
47
|
optional :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
42
48
|
|
|
43
|
-
# @!
|
|
49
|
+
# @!attribute status
|
|
50
|
+
# The current status of the message.
|
|
51
|
+
#
|
|
52
|
+
# @return [Symbol, SurgeAPI::Models::Message::Status, nil]
|
|
53
|
+
optional :status, enum: -> { SurgeAPI::Message::Status }
|
|
54
|
+
|
|
55
|
+
# @!method initialize(id: nil, attachments: nil, blast_id: nil, body: nil, conversation: nil, failure_reason: nil, metadata: nil, status: nil)
|
|
44
56
|
# Some parameter documentations has been truncated, see
|
|
45
57
|
# {SurgeAPI::Models::Message} for more details.
|
|
46
58
|
#
|
|
@@ -56,7 +68,11 @@ module SurgeAPI
|
|
|
56
68
|
#
|
|
57
69
|
# @param conversation [SurgeAPI::Models::Message::Conversation] A conversation with a Contact
|
|
58
70
|
#
|
|
71
|
+
# @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set.
|
|
72
|
+
#
|
|
59
73
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
74
|
+
#
|
|
75
|
+
# @param status [Symbol, SurgeAPI::Models::Message::Status] The current status of the message.
|
|
60
76
|
|
|
61
77
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
62
78
|
# @!attribute id
|
|
@@ -140,6 +156,12 @@ module SurgeAPI
|
|
|
140
156
|
# @return [String]
|
|
141
157
|
required :id, String
|
|
142
158
|
|
|
159
|
+
# @!attribute metadata
|
|
160
|
+
# Set of key-value pairs that will be stored with the object.
|
|
161
|
+
#
|
|
162
|
+
# @return [Hash{Symbol=>String}]
|
|
163
|
+
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
164
|
+
|
|
143
165
|
# @!attribute name
|
|
144
166
|
# A human-readable name for the phone number
|
|
145
167
|
#
|
|
@@ -158,11 +180,13 @@ module SurgeAPI
|
|
|
158
180
|
# @return [Symbol, SurgeAPI::Models::Message::Conversation::PhoneNumber::Type]
|
|
159
181
|
required :type, enum: -> { SurgeAPI::Message::Conversation::PhoneNumber::Type }
|
|
160
182
|
|
|
161
|
-
# @!method initialize(id:, name:, number:, type:)
|
|
183
|
+
# @!method initialize(id:, metadata:, name:, number:, type:)
|
|
162
184
|
# This is the phone number tied to the Surge account.
|
|
163
185
|
#
|
|
164
186
|
# @param id [String] Unique identifier for the phone number
|
|
165
187
|
#
|
|
188
|
+
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
189
|
+
#
|
|
166
190
|
# @param name [String, nil] A human-readable name for the phone number
|
|
167
191
|
#
|
|
168
192
|
# @param number [String] The canonical format of the phone number.
|
|
@@ -185,6 +209,22 @@ module SurgeAPI
|
|
|
185
209
|
end
|
|
186
210
|
end
|
|
187
211
|
end
|
|
212
|
+
|
|
213
|
+
# The current status of the message.
|
|
214
|
+
#
|
|
215
|
+
# @see SurgeAPI::Models::Message#status
|
|
216
|
+
module Status
|
|
217
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
218
|
+
|
|
219
|
+
PENDING = :pending
|
|
220
|
+
RECEIVED = :received
|
|
221
|
+
SENT = :sent
|
|
222
|
+
DELIVERED = :delivered
|
|
223
|
+
FAILED = :failed
|
|
224
|
+
|
|
225
|
+
# @!method self.values
|
|
226
|
+
# @return [Array<Symbol>]
|
|
227
|
+
end
|
|
188
228
|
end
|
|
189
229
|
end
|
|
190
230
|
end
|
|
@@ -62,12 +62,24 @@ module SurgeAPI
|
|
|
62
62
|
# @return [Time]
|
|
63
63
|
required :delivered_at, Time
|
|
64
64
|
|
|
65
|
+
# @!attribute failure_reason
|
|
66
|
+
# The reason the message failed, or null if no failure reason is set
|
|
67
|
+
#
|
|
68
|
+
# @return [String, nil]
|
|
69
|
+
required :failure_reason, String, nil?: true
|
|
70
|
+
|
|
65
71
|
# @!attribute metadata
|
|
66
72
|
# Set of key-value pairs that will be stored with the object.
|
|
67
73
|
#
|
|
68
74
|
# @return [Hash{Symbol=>String}]
|
|
69
75
|
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
70
76
|
|
|
77
|
+
# @!attribute status
|
|
78
|
+
# The message status represented by this event
|
|
79
|
+
#
|
|
80
|
+
# @return [Symbol, SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Status]
|
|
81
|
+
required :status, enum: -> { SurgeAPI::MessageDeliveredWebhookEvent::Data::Status }
|
|
82
|
+
|
|
71
83
|
# @!attribute attachments
|
|
72
84
|
# Attachments included with the message
|
|
73
85
|
#
|
|
@@ -82,7 +94,7 @@ module SurgeAPI
|
|
|
82
94
|
# @return [String, nil]
|
|
83
95
|
optional :blast_id, String
|
|
84
96
|
|
|
85
|
-
# @!method initialize(id:, body:, conversation:, delivered_at:, metadata:, attachments: nil, blast_id: nil)
|
|
97
|
+
# @!method initialize(id:, body:, conversation:, delivered_at:, failure_reason:, metadata:, status:, attachments: nil, blast_id: nil)
|
|
86
98
|
# Some parameter documentations has been truncated, see
|
|
87
99
|
# {SurgeAPI::Models::MessageDeliveredWebhookEvent::Data} for more details.
|
|
88
100
|
#
|
|
@@ -96,8 +108,12 @@ module SurgeAPI
|
|
|
96
108
|
#
|
|
97
109
|
# @param delivered_at [Time] When the message was delivered
|
|
98
110
|
#
|
|
111
|
+
# @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set
|
|
112
|
+
#
|
|
99
113
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
100
114
|
#
|
|
115
|
+
# @param status [Symbol, SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Status] The message status represented by this event
|
|
116
|
+
#
|
|
101
117
|
# @param attachments [Array<SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
102
118
|
#
|
|
103
119
|
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
@@ -132,6 +148,18 @@ module SurgeAPI
|
|
|
132
148
|
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
|
133
149
|
end
|
|
134
150
|
|
|
151
|
+
# The message status represented by this event
|
|
152
|
+
#
|
|
153
|
+
# @see SurgeAPI::Models::MessageDeliveredWebhookEvent::Data#status
|
|
154
|
+
module Status
|
|
155
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
156
|
+
|
|
157
|
+
DELIVERED = :delivered
|
|
158
|
+
|
|
159
|
+
# @!method self.values
|
|
160
|
+
# @return [Array<Symbol>]
|
|
161
|
+
end
|
|
162
|
+
|
|
135
163
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
136
164
|
# @!attribute id
|
|
137
165
|
# The unique identifier for the attachment
|
|
@@ -63,10 +63,11 @@ module SurgeAPI
|
|
|
63
63
|
required :failed_at, Time
|
|
64
64
|
|
|
65
65
|
# @!attribute failure_reason
|
|
66
|
-
# The reason the message failed to be delivered
|
|
66
|
+
# The reason the message failed to be delivered, or null if no failure reason is
|
|
67
|
+
# set
|
|
67
68
|
#
|
|
68
|
-
# @return [String]
|
|
69
|
-
required :failure_reason, String
|
|
69
|
+
# @return [String, nil]
|
|
70
|
+
required :failure_reason, String, nil?: true
|
|
70
71
|
|
|
71
72
|
# @!attribute metadata
|
|
72
73
|
# Set of key-value pairs that will be stored with the object.
|
|
@@ -74,6 +75,12 @@ module SurgeAPI
|
|
|
74
75
|
# @return [Hash{Symbol=>String}]
|
|
75
76
|
required :metadata, SurgeAPI::Internal::Type::HashOf[String]
|
|
76
77
|
|
|
78
|
+
# @!attribute status
|
|
79
|
+
# The message status represented by this event
|
|
80
|
+
#
|
|
81
|
+
# @return [Symbol, SurgeAPI::Models::MessageFailedWebhookEvent::Data::Status]
|
|
82
|
+
required :status, enum: -> { SurgeAPI::MessageFailedWebhookEvent::Data::Status }
|
|
83
|
+
|
|
77
84
|
# @!attribute attachments
|
|
78
85
|
# Attachments included with the message
|
|
79
86
|
#
|
|
@@ -88,7 +95,7 @@ module SurgeAPI
|
|
|
88
95
|
# @return [String, nil]
|
|
89
96
|
optional :blast_id, String
|
|
90
97
|
|
|
91
|
-
# @!method initialize(id:, body:, conversation:, failed_at:, failure_reason:, metadata:, attachments: nil, blast_id: nil)
|
|
98
|
+
# @!method initialize(id:, body:, conversation:, failed_at:, failure_reason:, metadata:, status:, attachments: nil, blast_id: nil)
|
|
92
99
|
# Some parameter documentations has been truncated, see
|
|
93
100
|
# {SurgeAPI::Models::MessageFailedWebhookEvent::Data} for more details.
|
|
94
101
|
#
|
|
@@ -102,10 +109,12 @@ module SurgeAPI
|
|
|
102
109
|
#
|
|
103
110
|
# @param failed_at [Time] When the message failed
|
|
104
111
|
#
|
|
105
|
-
# @param failure_reason [String] The reason the message failed to be delivered
|
|
112
|
+
# @param failure_reason [String, nil] The reason the message failed to be delivered, or null if no failure reason is s
|
|
106
113
|
#
|
|
107
114
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
108
115
|
#
|
|
116
|
+
# @param status [Symbol, SurgeAPI::Models::MessageFailedWebhookEvent::Data::Status] The message status represented by this event
|
|
117
|
+
#
|
|
109
118
|
# @param attachments [Array<SurgeAPI::Models::MessageFailedWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
110
119
|
#
|
|
111
120
|
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
@@ -140,6 +149,18 @@ module SurgeAPI
|
|
|
140
149
|
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
|
141
150
|
end
|
|
142
151
|
|
|
152
|
+
# The message status represented by this event
|
|
153
|
+
#
|
|
154
|
+
# @see SurgeAPI::Models::MessageFailedWebhookEvent::Data#status
|
|
155
|
+
module Status
|
|
156
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
157
|
+
|
|
158
|
+
FAILED = :failed
|
|
159
|
+
|
|
160
|
+
# @!method self.values
|
|
161
|
+
# @return [Array<Symbol>]
|
|
162
|
+
end
|
|
163
|
+
|
|
143
164
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
144
165
|
# @!attribute id
|
|
145
166
|
# The unique identifier for the attachment
|
|
@@ -56,6 +56,12 @@ module SurgeAPI
|
|
|
56
56
|
# @return [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation]
|
|
57
57
|
required :conversation, -> { SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation }
|
|
58
58
|
|
|
59
|
+
# @!attribute failure_reason
|
|
60
|
+
# The reason the message failed, or null if no failure reason is set
|
|
61
|
+
#
|
|
62
|
+
# @return [String, nil]
|
|
63
|
+
required :failure_reason, String, nil?: true
|
|
64
|
+
|
|
59
65
|
# @!attribute metadata
|
|
60
66
|
# Set of key-value pairs that will be stored with the object.
|
|
61
67
|
#
|
|
@@ -68,6 +74,12 @@ module SurgeAPI
|
|
|
68
74
|
# @return [Time]
|
|
69
75
|
required :received_at, Time
|
|
70
76
|
|
|
77
|
+
# @!attribute status
|
|
78
|
+
# The message status represented by this event
|
|
79
|
+
#
|
|
80
|
+
# @return [Symbol, SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Status]
|
|
81
|
+
required :status, enum: -> { SurgeAPI::MessageReceivedWebhookEvent::Data::Status }
|
|
82
|
+
|
|
71
83
|
# @!attribute attachments
|
|
72
84
|
# Attachments included with the message
|
|
73
85
|
#
|
|
@@ -82,7 +94,7 @@ module SurgeAPI
|
|
|
82
94
|
# @return [String, nil]
|
|
83
95
|
optional :blast_id, String
|
|
84
96
|
|
|
85
|
-
# @!method initialize(id:, body:, conversation:, metadata:, received_at:, attachments: nil, blast_id: nil)
|
|
97
|
+
# @!method initialize(id:, body:, conversation:, failure_reason:, metadata:, received_at:, status:, attachments: nil, blast_id: nil)
|
|
86
98
|
# Some parameter documentations has been truncated, see
|
|
87
99
|
# {SurgeAPI::Models::MessageReceivedWebhookEvent::Data} for more details.
|
|
88
100
|
#
|
|
@@ -94,10 +106,14 @@ module SurgeAPI
|
|
|
94
106
|
#
|
|
95
107
|
# @param conversation [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation] The conversation this message belongs to
|
|
96
108
|
#
|
|
109
|
+
# @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set
|
|
110
|
+
#
|
|
97
111
|
# @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
|
|
98
112
|
#
|
|
99
113
|
# @param received_at [Time] When the message was received
|
|
100
114
|
#
|
|
115
|
+
# @param status [Symbol, SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Status] The message status represented by this event
|
|
116
|
+
#
|
|
101
117
|
# @param attachments [Array<SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Attachment>] Attachments included with the message
|
|
102
118
|
#
|
|
103
119
|
# @param blast_id [String] The ID of the blast this message belongs to, if any. This can be used to attribu
|
|
@@ -132,6 +148,18 @@ module SurgeAPI
|
|
|
132
148
|
# @param phone_number [SurgeAPI::Models::PhoneNumber] A phone number that can be used to send and receive messages and calls
|
|
133
149
|
end
|
|
134
150
|
|
|
151
|
+
# The message status represented by this event
|
|
152
|
+
#
|
|
153
|
+
# @see SurgeAPI::Models::MessageReceivedWebhookEvent::Data#status
|
|
154
|
+
module Status
|
|
155
|
+
extend SurgeAPI::Internal::Type::Enum
|
|
156
|
+
|
|
157
|
+
RECEIVED = :received
|
|
158
|
+
|
|
159
|
+
# @!method self.values
|
|
160
|
+
# @return [Array<Symbol>]
|
|
161
|
+
end
|
|
162
|
+
|
|
135
163
|
class Attachment < SurgeAPI::Internal::Type::BaseModel
|
|
136
164
|
# @!attribute id
|
|
137
165
|
# The unique identifier for the attachment
|