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