surge_api 0.1.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 +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +28 -0
- data/README.md +286 -0
- data/SECURITY.md +27 -0
- data/lib/surge_api/client.rb +106 -0
- data/lib/surge_api/errors.rb +228 -0
- data/lib/surge_api/file_part.rb +55 -0
- data/lib/surge_api/internal/transport/base_client.rb +567 -0
- data/lib/surge_api/internal/transport/pooled_net_requester.rb +201 -0
- data/lib/surge_api/internal/type/array_of.rb +168 -0
- data/lib/surge_api/internal/type/base_model.rb +531 -0
- data/lib/surge_api/internal/type/base_page.rb +55 -0
- data/lib/surge_api/internal/type/boolean.rb +77 -0
- data/lib/surge_api/internal/type/converter.rb +327 -0
- data/lib/surge_api/internal/type/enum.rb +131 -0
- data/lib/surge_api/internal/type/file_input.rb +108 -0
- data/lib/surge_api/internal/type/hash_of.rb +188 -0
- data/lib/surge_api/internal/type/request_parameters.rb +42 -0
- data/lib/surge_api/internal/type/union.rb +250 -0
- data/lib/surge_api/internal/type/unknown.rb +81 -0
- data/lib/surge_api/internal/util.rb +915 -0
- data/lib/surge_api/internal.rb +20 -0
- data/lib/surge_api/models/account.rb +60 -0
- data/lib/surge_api/models/account_create_params.rb +481 -0
- data/lib/surge_api/models/account_retrieve_status_params.rb +32 -0
- data/lib/surge_api/models/account_status.rb +104 -0
- data/lib/surge_api/models/account_update_params.rb +480 -0
- data/lib/surge_api/models/blast.rb +61 -0
- data/lib/surge_api/models/blast_create_params.rb +90 -0
- data/lib/surge_api/models/call_ended_webhook_event.rb +106 -0
- data/lib/surge_api/models/campaign.rb +208 -0
- data/lib/surge_api/models/campaign_approved_webhook_event.rb +74 -0
- data/lib/surge_api/models/campaign_create_params.rb +202 -0
- data/lib/surge_api/models/contact.rb +59 -0
- data/lib/surge_api/models/contact_create_params.rb +54 -0
- data/lib/surge_api/models/contact_retrieve_params.rb +14 -0
- data/lib/surge_api/models/contact_update_params.rb +54 -0
- data/lib/surge_api/models/conversation_created_webhook_event.rb +70 -0
- data/lib/surge_api/models/error.rb +34 -0
- data/lib/surge_api/models/message.rb +146 -0
- data/lib/surge_api/models/message_create_params.rb +153 -0
- data/lib/surge_api/models/message_delivered_webhook_event.rb +159 -0
- data/lib/surge_api/models/message_failed_webhook_event.rb +167 -0
- data/lib/surge_api/models/message_received_webhook_event.rb +159 -0
- data/lib/surge_api/models/message_sent_webhook_event.rb +159 -0
- data/lib/surge_api/models/organization.rb +419 -0
- data/lib/surge_api/models/phone_number.rb +48 -0
- data/lib/surge_api/models/phone_number_purchase_params.rb +65 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +26 -0
- data/lib/surge_api/models/user.rb +51 -0
- data/lib/surge_api/models/user_create_params.rb +46 -0
- data/lib/surge_api/models/user_create_token_params.rb +22 -0
- data/lib/surge_api/models/user_retrieve_params.rb +14 -0
- data/lib/surge_api/models/user_token_response.rb +19 -0
- data/lib/surge_api/models/user_update_params.rb +46 -0
- data/lib/surge_api/models/verification.rb +58 -0
- data/lib/surge_api/models/verification_check.rb +43 -0
- data/lib/surge_api/models/verification_check_params.rb +22 -0
- data/lib/surge_api/models/verification_create_params.rb +22 -0
- data/lib/surge_api/models/webhook_unwrap_params.rb +14 -0
- data/lib/surge_api/models.rb +117 -0
- data/lib/surge_api/request_options.rb +77 -0
- data/lib/surge_api/resources/accounts.rb +102 -0
- data/lib/surge_api/resources/blasts.rb +53 -0
- data/lib/surge_api/resources/campaigns.rb +57 -0
- data/lib/surge_api/resources/contacts.rb +99 -0
- data/lib/surge_api/resources/messages.rb +75 -0
- data/lib/surge_api/resources/phone_numbers.rb +48 -0
- data/lib/surge_api/resources/users.rb +119 -0
- data/lib/surge_api/resources/verifications.rb +60 -0
- data/lib/surge_api/resources/webhooks.rb +22 -0
- data/lib/surge_api/version.rb +5 -0
- data/lib/surge_api.rb +100 -0
- data/manifest.yaml +15 -0
- data/rbi/surge_api/client.rbi +73 -0
- data/rbi/surge_api/errors.rbi +205 -0
- data/rbi/surge_api/file_part.rbi +37 -0
- data/rbi/surge_api/internal/transport/base_client.rbi +292 -0
- data/rbi/surge_api/internal/transport/pooled_net_requester.rbi +79 -0
- data/rbi/surge_api/internal/type/array_of.rbi +104 -0
- data/rbi/surge_api/internal/type/base_model.rbi +302 -0
- data/rbi/surge_api/internal/type/base_page.rbi +42 -0
- data/rbi/surge_api/internal/type/boolean.rbi +58 -0
- data/rbi/surge_api/internal/type/converter.rbi +216 -0
- data/rbi/surge_api/internal/type/enum.rbi +82 -0
- data/rbi/surge_api/internal/type/file_input.rbi +59 -0
- data/rbi/surge_api/internal/type/hash_of.rbi +104 -0
- data/rbi/surge_api/internal/type/request_parameters.rbi +29 -0
- data/rbi/surge_api/internal/type/union.rbi +128 -0
- data/rbi/surge_api/internal/type/unknown.rbi +58 -0
- data/rbi/surge_api/internal/util.rbi +487 -0
- data/rbi/surge_api/internal.rbi +16 -0
- data/rbi/surge_api/models/account.rbi +83 -0
- data/rbi/surge_api/models/account_create_params.rbi +1104 -0
- data/rbi/surge_api/models/account_retrieve_status_params.rbi +96 -0
- data/rbi/surge_api/models/account_status.rbi +185 -0
- data/rbi/surge_api/models/account_update_params.rbi +1105 -0
- data/rbi/surge_api/models/blast.rbi +108 -0
- data/rbi/surge_api/models/blast_create_params.rbi +145 -0
- data/rbi/surge_api/models/call_ended_webhook_event.rbi +205 -0
- data/rbi/surge_api/models/campaign.rbi +331 -0
- data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +149 -0
- data/rbi/surge_api/models/campaign_create_params.rbi +386 -0
- data/rbi/surge_api/models/contact.rbi +88 -0
- data/rbi/surge_api/models/contact_create_params.rbi +87 -0
- data/rbi/surge_api/models/contact_retrieve_params.rbi +27 -0
- data/rbi/surge_api/models/contact_update_params.rbi +87 -0
- data/rbi/surge_api/models/conversation_created_webhook_event.rbi +129 -0
- data/rbi/surge_api/models/error.rbi +51 -0
- data/rbi/surge_api/models/message.rbi +283 -0
- data/rbi/surge_api/models/message_create_params.rbi +281 -0
- data/rbi/surge_api/models/message_delivered_webhook_event.rbi +331 -0
- data/rbi/surge_api/models/message_failed_webhook_event.rbi +335 -0
- data/rbi/surge_api/models/message_received_webhook_event.rbi +331 -0
- data/rbi/surge_api/models/message_sent_webhook_event.rbi +322 -0
- data/rbi/surge_api/models/organization.rbi +649 -0
- data/rbi/surge_api/models/phone_number.rbi +72 -0
- data/rbi/surge_api/models/phone_number_purchase_params.rbi +122 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +26 -0
- data/rbi/surge_api/models/user.rbi +80 -0
- data/rbi/surge_api/models/user_create_params.rbi +76 -0
- data/rbi/surge_api/models/user_create_token_params.rbi +46 -0
- data/rbi/surge_api/models/user_retrieve_params.rbi +27 -0
- data/rbi/surge_api/models/user_token_response.rbi +31 -0
- data/rbi/surge_api/models/user_update_params.rbi +76 -0
- data/rbi/surge_api/models/verification.rbi +86 -0
- data/rbi/surge_api/models/verification_check.rbi +84 -0
- data/rbi/surge_api/models/verification_check_params.rbi +40 -0
- data/rbi/surge_api/models/verification_create_params.rbi +40 -0
- data/rbi/surge_api/models/webhook_unwrap_params.rbi +27 -0
- data/rbi/surge_api/models.rbi +80 -0
- data/rbi/surge_api/request_options.rbi +59 -0
- data/rbi/surge_api/resources/accounts.rbi +94 -0
- data/rbi/surge_api/resources/blasts.rbi +48 -0
- data/rbi/surge_api/resources/campaigns.rbi +115 -0
- data/rbi/surge_api/resources/contacts.rbi +85 -0
- data/rbi/surge_api/resources/messages.rbi +72 -0
- data/rbi/surge_api/resources/phone_numbers.rbi +43 -0
- data/rbi/surge_api/resources/users.rbi +96 -0
- data/rbi/surge_api/resources/verifications.rbi +43 -0
- data/rbi/surge_api/resources/webhooks.rbi +31 -0
- data/rbi/surge_api/version.rbi +5 -0
- data/sig/surge_api/client.rbs +42 -0
- data/sig/surge_api/errors.rbs +117 -0
- data/sig/surge_api/file_part.rbs +21 -0
- data/sig/surge_api/internal/transport/base_client.rbs +131 -0
- data/sig/surge_api/internal/transport/pooled_net_requester.rbs +45 -0
- data/sig/surge_api/internal/type/array_of.rbs +48 -0
- data/sig/surge_api/internal/type/base_model.rbs +102 -0
- data/sig/surge_api/internal/type/base_page.rbs +24 -0
- data/sig/surge_api/internal/type/boolean.rbs +26 -0
- data/sig/surge_api/internal/type/converter.rbs +79 -0
- data/sig/surge_api/internal/type/enum.rbs +32 -0
- data/sig/surge_api/internal/type/file_input.rbs +25 -0
- data/sig/surge_api/internal/type/hash_of.rbs +48 -0
- data/sig/surge_api/internal/type/request_parameters.rbs +17 -0
- data/sig/surge_api/internal/type/union.rbs +52 -0
- data/sig/surge_api/internal/type/unknown.rbs +26 -0
- data/sig/surge_api/internal/util.rbs +185 -0
- data/sig/surge_api/internal.rbs +9 -0
- data/sig/surge_api/models/account.rbs +40 -0
- data/sig/surge_api/models/account_create_params.rbs +433 -0
- data/sig/surge_api/models/account_retrieve_status_params.rbs +40 -0
- data/sig/surge_api/models/account_status.rbs +71 -0
- data/sig/surge_api/models/account_update_params.rbs +435 -0
- data/sig/surge_api/models/blast.rbs +64 -0
- data/sig/surge_api/models/blast_create_params.rbs +82 -0
- data/sig/surge_api/models/call_ended_webhook_event.rbs +99 -0
- data/sig/surge_api/models/campaign.rbs +122 -0
- data/sig/surge_api/models/campaign_approved_webhook_event.rbs +67 -0
- data/sig/surge_api/models/campaign_create_params.rbs +127 -0
- data/sig/surge_api/models/contact.rbs +53 -0
- data/sig/surge_api/models/contact_create_params.rbs +54 -0
- data/sig/surge_api/models/contact_retrieve_params.rbs +15 -0
- data/sig/surge_api/models/contact_update_params.rbs +54 -0
- data/sig/surge_api/models/conversation_created_webhook_event.rbs +62 -0
- data/sig/surge_api/models/error.rbs +27 -0
- data/sig/surge_api/models/message.rbs +138 -0
- data/sig/surge_api/models/message_create_params.rbs +140 -0
- data/sig/surge_api/models/message_delivered_webhook_event.rbs +143 -0
- data/sig/surge_api/models/message_failed_webhook_event.rbs +148 -0
- data/sig/surge_api/models/message_received_webhook_event.rbs +143 -0
- data/sig/surge_api/models/message_sent_webhook_event.rbs +143 -0
- data/sig/surge_api/models/organization.rbs +385 -0
- data/sig/surge_api/models/phone_number.rbs +37 -0
- data/sig/surge_api/models/phone_number_purchase_params.rbs +62 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +18 -0
- data/sig/surge_api/models/user.rbs +48 -0
- data/sig/surge_api/models/user_create_params.rbs +47 -0
- data/sig/surge_api/models/user_create_token_params.rbs +26 -0
- data/sig/surge_api/models/user_retrieve_params.rbs +15 -0
- data/sig/surge_api/models/user_token_response.rbs +15 -0
- data/sig/surge_api/models/user_update_params.rbs +47 -0
- data/sig/surge_api/models/verification.rbs +48 -0
- data/sig/surge_api/models/verification_check.rbs +45 -0
- data/sig/surge_api/models/verification_check_params.rbs +23 -0
- data/sig/surge_api/models/verification_create_params.rbs +23 -0
- data/sig/surge_api/models/webhook_unwrap_params.rbs +15 -0
- data/sig/surge_api/models.rbs +77 -0
- data/sig/surge_api/request_options.rbs +34 -0
- data/sig/surge_api/resources/accounts.rbs +30 -0
- data/sig/surge_api/resources/blasts.rbs +19 -0
- data/sig/surge_api/resources/campaigns.rbs +21 -0
- data/sig/surge_api/resources/contacts.rbs +32 -0
- data/sig/surge_api/resources/messages.rbs +18 -0
- data/sig/surge_api/resources/phone_numbers.rbs +16 -0
- data/sig/surge_api/resources/users.rbs +36 -0
- data/sig/surge_api/resources/verifications.rbs +18 -0
- data/sig/surge_api/resources/webhooks.rbs +17 -0
- data/sig/surge_api/version.rbs +3 -0
- metadata +269 -0
@@ -0,0 +1,331 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module SurgeAPI
|
4
|
+
module Models
|
5
|
+
class Campaign < SurgeAPI::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias { T.any(SurgeAPI::Campaign, SurgeAPI::Internal::AnyHash) }
|
8
|
+
|
9
|
+
# The campaign ID
|
10
|
+
sig { returns(String) }
|
11
|
+
attr_accessor :id
|
12
|
+
|
13
|
+
# A string explaining the method through which end users will opt in to receive
|
14
|
+
# messages from the brand. Typically this should include URLs for opt-in forms or
|
15
|
+
# screenshots that might be helpful in explaining the flow to someone unfamiliar
|
16
|
+
# with the organization's purpose.
|
17
|
+
sig { returns(String) }
|
18
|
+
attr_accessor :consent_flow
|
19
|
+
|
20
|
+
# An explanation of the organization's purpose and how it will be using text
|
21
|
+
# messaging to accomplish that purpose.
|
22
|
+
sig { returns(String) }
|
23
|
+
attr_accessor :description
|
24
|
+
|
25
|
+
# A list of properties that this campaign should include. These properties can be
|
26
|
+
# any of the following values:
|
27
|
+
#
|
28
|
+
# - `links` - whether the campaign might send links in messages
|
29
|
+
# - `phone_numbers` - whether the campaign might send phone numbers in messages
|
30
|
+
# - `age_gated` - whether the campaign contains age gated content (controlled
|
31
|
+
# substances or adult content)
|
32
|
+
# - `direct_lending` - whether the campaign contains content related to direct
|
33
|
+
# lending or other loan arrangements
|
34
|
+
sig { returns(T::Array[SurgeAPI::Campaign::Include::TaggedSymbol]) }
|
35
|
+
attr_accessor :includes
|
36
|
+
|
37
|
+
# An array of 2-5 strings with examples of the messages that will be sent from
|
38
|
+
# this campaign. Typically the first sample should be a compliance message like
|
39
|
+
# `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
|
40
|
+
# These samples don't necessarily need to be the only templates that will be used
|
41
|
+
# for the campaign, but they should reflect the purpose of the messages that will
|
42
|
+
# be sent. Any variable content can be reflected by wrapping it in square brackets
|
43
|
+
# like `[customer name]`.
|
44
|
+
sig { returns(T::Array[String]) }
|
45
|
+
attr_accessor :message_samples
|
46
|
+
|
47
|
+
# The URL of the privacy policy for the brand in question. This may be a shared
|
48
|
+
# privacy policy if it's the policy that is displayed to end users when they opt
|
49
|
+
# in to messaging.
|
50
|
+
sig { returns(String) }
|
51
|
+
attr_accessor :privacy_policy_url
|
52
|
+
|
53
|
+
# A list containing 1-5 types of messages that will be sent with this campaign.
|
54
|
+
#
|
55
|
+
# The following use cases are typically available to all brands:
|
56
|
+
#
|
57
|
+
# - `account_notification` - For sending reminders, alerts, and general
|
58
|
+
# account-related notifications like booking confirmations or appointment
|
59
|
+
# reminders.
|
60
|
+
# - `customer_care` - For account support, troubleshooting, and general customer
|
61
|
+
# service communication.
|
62
|
+
# - `delivery_notification` - For notifying customers about the status of product
|
63
|
+
# or service deliveries.
|
64
|
+
# - `fraud_alert` - For warning customers about suspicious or potentially
|
65
|
+
# fraudulent activity.
|
66
|
+
# - `higher_education` - For messaging related to colleges, universities, and
|
67
|
+
# school districts outside of K–12.
|
68
|
+
# - `marketing` - For promotional or advertising messages intended to market
|
69
|
+
# products or services.
|
70
|
+
# - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
|
71
|
+
# - `public_service_announcement` - For raising awareness about social issues or
|
72
|
+
# important public information.
|
73
|
+
# - `security_alert` - For alerts related to potential security breaches or
|
74
|
+
# compromised systems requiring user action.
|
75
|
+
# - `two_factor_authentication` - For sending one-time passwords or verification
|
76
|
+
# codes for login or password reset.
|
77
|
+
#
|
78
|
+
# For access to special use cases not shown here, reach out to support@surge.app.
|
79
|
+
sig { returns(T::Array[SurgeAPI::Campaign::UseCase::TaggedSymbol]) }
|
80
|
+
attr_accessor :use_cases
|
81
|
+
|
82
|
+
# This will be one of the following:
|
83
|
+
#
|
84
|
+
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
85
|
+
# T-Mobile customers each day. In this case your platform will be charged for
|
86
|
+
# the setup fee for a low volume number upon receipt of the API request.
|
87
|
+
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
88
|
+
# T-Mobile customers each day, depending on the trust score assigned by The
|
89
|
+
# Campaign Registry. Your platform will be charged for the setup fee for a high
|
90
|
+
# volume number upon receipt of the API request, and phone numbers will be
|
91
|
+
# charged as high volume numbers going forward.
|
92
|
+
sig { returns(SurgeAPI::Campaign::Volume::TaggedSymbol) }
|
93
|
+
attr_accessor :volume
|
94
|
+
|
95
|
+
# A sample link that might be sent by this campaign. If links from other domains
|
96
|
+
# are sent through this campaign, they are much more likely to be filtered by the
|
97
|
+
# carriers. If link shortening is enabled for the account, the link shortener URL
|
98
|
+
# will be used instead of what is provided. Reach out to support if you would like
|
99
|
+
# to disable automatic link shortening.
|
100
|
+
sig { returns(T.nilable(String)) }
|
101
|
+
attr_reader :link_sample
|
102
|
+
|
103
|
+
sig { params(link_sample: String).void }
|
104
|
+
attr_writer :link_sample
|
105
|
+
|
106
|
+
# The URL of the terms and conditions presented to end users when they opt in to
|
107
|
+
# messaging. These terms and conditions may be shared among all of a platform's
|
108
|
+
# customers if they're the terms that are presented to end users when they opt in
|
109
|
+
# to messaging.
|
110
|
+
sig { returns(T.nilable(String)) }
|
111
|
+
attr_reader :terms_and_conditions_url
|
112
|
+
|
113
|
+
sig { params(terms_and_conditions_url: String).void }
|
114
|
+
attr_writer :terms_and_conditions_url
|
115
|
+
|
116
|
+
# A campaign represents the context in which one or more of your phone numbers
|
117
|
+
# communicates with your contacts. Consent and opt-outs are tied to the campaign.
|
118
|
+
sig do
|
119
|
+
params(
|
120
|
+
id: String,
|
121
|
+
consent_flow: String,
|
122
|
+
description: String,
|
123
|
+
includes: T::Array[SurgeAPI::Campaign::Include::OrSymbol],
|
124
|
+
message_samples: T::Array[String],
|
125
|
+
privacy_policy_url: String,
|
126
|
+
use_cases: T::Array[SurgeAPI::Campaign::UseCase::OrSymbol],
|
127
|
+
volume: SurgeAPI::Campaign::Volume::OrSymbol,
|
128
|
+
link_sample: String,
|
129
|
+
terms_and_conditions_url: String
|
130
|
+
).returns(T.attached_class)
|
131
|
+
end
|
132
|
+
def self.new(
|
133
|
+
# The campaign ID
|
134
|
+
id:,
|
135
|
+
# A string explaining the method through which end users will opt in to receive
|
136
|
+
# messages from the brand. Typically this should include URLs for opt-in forms or
|
137
|
+
# screenshots that might be helpful in explaining the flow to someone unfamiliar
|
138
|
+
# with the organization's purpose.
|
139
|
+
consent_flow:,
|
140
|
+
# An explanation of the organization's purpose and how it will be using text
|
141
|
+
# messaging to accomplish that purpose.
|
142
|
+
description:,
|
143
|
+
# A list of properties that this campaign should include. These properties can be
|
144
|
+
# any of the following values:
|
145
|
+
#
|
146
|
+
# - `links` - whether the campaign might send links in messages
|
147
|
+
# - `phone_numbers` - whether the campaign might send phone numbers in messages
|
148
|
+
# - `age_gated` - whether the campaign contains age gated content (controlled
|
149
|
+
# substances or adult content)
|
150
|
+
# - `direct_lending` - whether the campaign contains content related to direct
|
151
|
+
# lending or other loan arrangements
|
152
|
+
includes:,
|
153
|
+
# An array of 2-5 strings with examples of the messages that will be sent from
|
154
|
+
# this campaign. Typically the first sample should be a compliance message like
|
155
|
+
# `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
|
156
|
+
# These samples don't necessarily need to be the only templates that will be used
|
157
|
+
# for the campaign, but they should reflect the purpose of the messages that will
|
158
|
+
# be sent. Any variable content can be reflected by wrapping it in square brackets
|
159
|
+
# like `[customer name]`.
|
160
|
+
message_samples:,
|
161
|
+
# The URL of the privacy policy for the brand in question. This may be a shared
|
162
|
+
# privacy policy if it's the policy that is displayed to end users when they opt
|
163
|
+
# in to messaging.
|
164
|
+
privacy_policy_url:,
|
165
|
+
# A list containing 1-5 types of messages that will be sent with this campaign.
|
166
|
+
#
|
167
|
+
# The following use cases are typically available to all brands:
|
168
|
+
#
|
169
|
+
# - `account_notification` - For sending reminders, alerts, and general
|
170
|
+
# account-related notifications like booking confirmations or appointment
|
171
|
+
# reminders.
|
172
|
+
# - `customer_care` - For account support, troubleshooting, and general customer
|
173
|
+
# service communication.
|
174
|
+
# - `delivery_notification` - For notifying customers about the status of product
|
175
|
+
# or service deliveries.
|
176
|
+
# - `fraud_alert` - For warning customers about suspicious or potentially
|
177
|
+
# fraudulent activity.
|
178
|
+
# - `higher_education` - For messaging related to colleges, universities, and
|
179
|
+
# school districts outside of K–12.
|
180
|
+
# - `marketing` - For promotional or advertising messages intended to market
|
181
|
+
# products or services.
|
182
|
+
# - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
|
183
|
+
# - `public_service_announcement` - For raising awareness about social issues or
|
184
|
+
# important public information.
|
185
|
+
# - `security_alert` - For alerts related to potential security breaches or
|
186
|
+
# compromised systems requiring user action.
|
187
|
+
# - `two_factor_authentication` - For sending one-time passwords or verification
|
188
|
+
# codes for login or password reset.
|
189
|
+
#
|
190
|
+
# For access to special use cases not shown here, reach out to support@surge.app.
|
191
|
+
use_cases:,
|
192
|
+
# This will be one of the following:
|
193
|
+
#
|
194
|
+
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
195
|
+
# T-Mobile customers each day. In this case your platform will be charged for
|
196
|
+
# the setup fee for a low volume number upon receipt of the API request.
|
197
|
+
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
198
|
+
# T-Mobile customers each day, depending on the trust score assigned by The
|
199
|
+
# Campaign Registry. Your platform will be charged for the setup fee for a high
|
200
|
+
# volume number upon receipt of the API request, and phone numbers will be
|
201
|
+
# charged as high volume numbers going forward.
|
202
|
+
volume:,
|
203
|
+
# A sample link that might be sent by this campaign. If links from other domains
|
204
|
+
# are sent through this campaign, they are much more likely to be filtered by the
|
205
|
+
# carriers. If link shortening is enabled for the account, the link shortener URL
|
206
|
+
# will be used instead of what is provided. Reach out to support if you would like
|
207
|
+
# to disable automatic link shortening.
|
208
|
+
link_sample: nil,
|
209
|
+
# The URL of the terms and conditions presented to end users when they opt in to
|
210
|
+
# messaging. These terms and conditions may be shared among all of a platform's
|
211
|
+
# customers if they're the terms that are presented to end users when they opt in
|
212
|
+
# to messaging.
|
213
|
+
terms_and_conditions_url: nil
|
214
|
+
)
|
215
|
+
end
|
216
|
+
|
217
|
+
sig do
|
218
|
+
override.returns(
|
219
|
+
{
|
220
|
+
id: String,
|
221
|
+
consent_flow: String,
|
222
|
+
description: String,
|
223
|
+
includes: T::Array[SurgeAPI::Campaign::Include::TaggedSymbol],
|
224
|
+
message_samples: T::Array[String],
|
225
|
+
privacy_policy_url: String,
|
226
|
+
use_cases: T::Array[SurgeAPI::Campaign::UseCase::TaggedSymbol],
|
227
|
+
volume: SurgeAPI::Campaign::Volume::TaggedSymbol,
|
228
|
+
link_sample: String,
|
229
|
+
terms_and_conditions_url: String
|
230
|
+
}
|
231
|
+
)
|
232
|
+
end
|
233
|
+
def to_hash
|
234
|
+
end
|
235
|
+
|
236
|
+
module Include
|
237
|
+
extend SurgeAPI::Internal::Type::Enum
|
238
|
+
|
239
|
+
TaggedSymbol =
|
240
|
+
T.type_alias { T.all(Symbol, SurgeAPI::Campaign::Include) }
|
241
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
242
|
+
|
243
|
+
LINKS = T.let(:links, SurgeAPI::Campaign::Include::TaggedSymbol)
|
244
|
+
PHONE_NUMBERS =
|
245
|
+
T.let(:phone_numbers, SurgeAPI::Campaign::Include::TaggedSymbol)
|
246
|
+
AGE_GATED = T.let(:age_gated, SurgeAPI::Campaign::Include::TaggedSymbol)
|
247
|
+
DIRECT_LENDING =
|
248
|
+
T.let(:direct_lending, SurgeAPI::Campaign::Include::TaggedSymbol)
|
249
|
+
|
250
|
+
sig do
|
251
|
+
override.returns(T::Array[SurgeAPI::Campaign::Include::TaggedSymbol])
|
252
|
+
end
|
253
|
+
def self.values
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
module UseCase
|
258
|
+
extend SurgeAPI::Internal::Type::Enum
|
259
|
+
|
260
|
+
TaggedSymbol =
|
261
|
+
T.type_alias { T.all(Symbol, SurgeAPI::Campaign::UseCase) }
|
262
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
263
|
+
|
264
|
+
ACCOUNT_NOTIFICATION =
|
265
|
+
T.let(
|
266
|
+
:account_notification,
|
267
|
+
SurgeAPI::Campaign::UseCase::TaggedSymbol
|
268
|
+
)
|
269
|
+
CUSTOMER_CARE =
|
270
|
+
T.let(:customer_care, SurgeAPI::Campaign::UseCase::TaggedSymbol)
|
271
|
+
DELIVERY_NOTIFICATION =
|
272
|
+
T.let(
|
273
|
+
:delivery_notification,
|
274
|
+
SurgeAPI::Campaign::UseCase::TaggedSymbol
|
275
|
+
)
|
276
|
+
FRAUD_ALERT =
|
277
|
+
T.let(:fraud_alert, SurgeAPI::Campaign::UseCase::TaggedSymbol)
|
278
|
+
HIGHER_EDUCATION =
|
279
|
+
T.let(:higher_education, SurgeAPI::Campaign::UseCase::TaggedSymbol)
|
280
|
+
MARKETING = T.let(:marketing, SurgeAPI::Campaign::UseCase::TaggedSymbol)
|
281
|
+
POLLING_VOTING =
|
282
|
+
T.let(:polling_voting, SurgeAPI::Campaign::UseCase::TaggedSymbol)
|
283
|
+
PUBLIC_SERVICE_ANNOUNCEMENT =
|
284
|
+
T.let(
|
285
|
+
:public_service_announcement,
|
286
|
+
SurgeAPI::Campaign::UseCase::TaggedSymbol
|
287
|
+
)
|
288
|
+
SECURITY_ALERT =
|
289
|
+
T.let(:security_alert, SurgeAPI::Campaign::UseCase::TaggedSymbol)
|
290
|
+
TWO_FACTOR_AUTHENTICATION =
|
291
|
+
T.let(
|
292
|
+
:two_factor_authentication,
|
293
|
+
SurgeAPI::Campaign::UseCase::TaggedSymbol
|
294
|
+
)
|
295
|
+
|
296
|
+
sig do
|
297
|
+
override.returns(T::Array[SurgeAPI::Campaign::UseCase::TaggedSymbol])
|
298
|
+
end
|
299
|
+
def self.values
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
# This will be one of the following:
|
304
|
+
#
|
305
|
+
# - `low` - The campaign will be allowed to send up to 2000 SMS segments to
|
306
|
+
# T-Mobile customers each day. In this case your platform will be charged for
|
307
|
+
# the setup fee for a low volume number upon receipt of the API request.
|
308
|
+
# - `high` - The campaign will be allowed to send up to 200k SMS segments to
|
309
|
+
# T-Mobile customers each day, depending on the trust score assigned by The
|
310
|
+
# Campaign Registry. Your platform will be charged for the setup fee for a high
|
311
|
+
# volume number upon receipt of the API request, and phone numbers will be
|
312
|
+
# charged as high volume numbers going forward.
|
313
|
+
module Volume
|
314
|
+
extend SurgeAPI::Internal::Type::Enum
|
315
|
+
|
316
|
+
TaggedSymbol =
|
317
|
+
T.type_alias { T.all(Symbol, SurgeAPI::Campaign::Volume) }
|
318
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
319
|
+
|
320
|
+
HIGH = T.let(:high, SurgeAPI::Campaign::Volume::TaggedSymbol)
|
321
|
+
LOW = T.let(:low, SurgeAPI::Campaign::Volume::TaggedSymbol)
|
322
|
+
|
323
|
+
sig do
|
324
|
+
override.returns(T::Array[SurgeAPI::Campaign::Volume::TaggedSymbol])
|
325
|
+
end
|
326
|
+
def self.values
|
327
|
+
end
|
328
|
+
end
|
329
|
+
end
|
330
|
+
end
|
331
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module SurgeAPI
|
4
|
+
module Models
|
5
|
+
class CampaignApprovedWebhookEvent < SurgeAPI::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
SurgeAPI::CampaignApprovedWebhookEvent,
|
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::CampaignApprovedWebhookEvent::Data) }
|
20
|
+
attr_reader :data
|
21
|
+
|
22
|
+
sig do
|
23
|
+
params(data: SurgeAPI::CampaignApprovedWebhookEvent::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.approved` for this event.
|
32
|
+
sig { returns(Symbol) }
|
33
|
+
attr_accessor :type
|
34
|
+
|
35
|
+
sig do
|
36
|
+
params(
|
37
|
+
account_id: String,
|
38
|
+
data: SurgeAPI::CampaignApprovedWebhookEvent::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.approved` for this event.
|
51
|
+
type: :"campaign.approved"
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
sig do
|
56
|
+
override.returns(
|
57
|
+
{
|
58
|
+
account_id: String,
|
59
|
+
data: SurgeAPI::CampaignApprovedWebhookEvent::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::CampaignApprovedWebhookEvent::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 status of the campaign. Will always be `active` for this event.
|
82
|
+
sig do
|
83
|
+
returns(
|
84
|
+
SurgeAPI::CampaignApprovedWebhookEvent::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::CampaignApprovedWebhookEvent::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 status of the campaign. Will always be `active` for this event.
|
101
|
+
status:
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
sig do
|
106
|
+
override.returns(
|
107
|
+
{
|
108
|
+
id: String,
|
109
|
+
status:
|
110
|
+
SurgeAPI::CampaignApprovedWebhookEvent::Data::Status::TaggedSymbol
|
111
|
+
}
|
112
|
+
)
|
113
|
+
end
|
114
|
+
def to_hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# The status of the campaign. Will always be `active` 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::CampaignApprovedWebhookEvent::Data::Status
|
126
|
+
)
|
127
|
+
end
|
128
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
129
|
+
|
130
|
+
ACTIVE =
|
131
|
+
T.let(
|
132
|
+
:active,
|
133
|
+
SurgeAPI::CampaignApprovedWebhookEvent::Data::Status::TaggedSymbol
|
134
|
+
)
|
135
|
+
|
136
|
+
sig do
|
137
|
+
override.returns(
|
138
|
+
T::Array[
|
139
|
+
SurgeAPI::CampaignApprovedWebhookEvent::Data::Status::TaggedSymbol
|
140
|
+
]
|
141
|
+
)
|
142
|
+
end
|
143
|
+
def self.values
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|