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,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::Blasts#create
6
+ class BlastCreateParams < SurgeAPI::Internal::Type::BaseModel
7
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
+ include SurgeAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute attachments
11
+ #
12
+ # @return [Array<SurgeAPI::Models::BlastCreateParams::Attachment>, nil]
13
+ optional :attachments, -> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::BlastCreateParams::Attachment] }
14
+
15
+ # @!attribute body
16
+ # The message body.
17
+ #
18
+ # @return [String, nil]
19
+ optional :body, String
20
+
21
+ # @!attribute contacts
22
+ # @deprecated
23
+ #
24
+ # Deprecated. Use `to` instead.
25
+ #
26
+ # @return [Array<String>, nil]
27
+ optional :contacts, SurgeAPI::Internal::Type::ArrayOf[String]
28
+
29
+ # @!attribute name
30
+ # Optional name for the blast.
31
+ #
32
+ # @return [String, nil]
33
+ optional :name, String
34
+
35
+ # @!attribute segments
36
+ # @deprecated
37
+ #
38
+ # Deprecated. Use `to` instead.
39
+ #
40
+ # @return [Array<String>, nil]
41
+ optional :segments, SurgeAPI::Internal::Type::ArrayOf[String]
42
+
43
+ # @!attribute send_at
44
+ # When to send the blast. If not provided, sends immediately.
45
+ #
46
+ # @return [Time, nil]
47
+ optional :send_at, Time
48
+
49
+ # @!attribute to
50
+ # List of recipients to whom the blast should be sent. This can be a combination
51
+ # of contact IDs, segment IDs, and phone numbers.
52
+ #
53
+ # @return [Array<String>, nil]
54
+ optional :to, SurgeAPI::Internal::Type::ArrayOf[String]
55
+
56
+ # @!method initialize(attachments: nil, body: nil, contacts: nil, name: nil, segments: nil, send_at: nil, to: nil, request_options: {})
57
+ # Some parameter documentations has been truncated, see
58
+ # {SurgeAPI::Models::BlastCreateParams} for more details.
59
+ #
60
+ # @param attachments [Array<SurgeAPI::Models::BlastCreateParams::Attachment>]
61
+ #
62
+ # @param body [String] The message body.
63
+ #
64
+ # @param contacts [Array<String>] Deprecated. Use `to` instead.
65
+ #
66
+ # @param name [String] Optional name for the blast.
67
+ #
68
+ # @param segments [Array<String>] Deprecated. Use `to` instead.
69
+ #
70
+ # @param send_at [Time] When to send the blast. If not provided, sends immediately.
71
+ #
72
+ # @param to [Array<String>] List of recipients to whom the blast should be sent. This can be a combination o
73
+ #
74
+ # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
75
+
76
+ class Attachment < SurgeAPI::Internal::Type::BaseModel
77
+ # @!attribute url
78
+ # The URL of the attachment.
79
+ #
80
+ # @return [String]
81
+ required :url, String
82
+
83
+ # @!method initialize(url:)
84
+ # Params for creating an attachment
85
+ #
86
+ # @param url [String] The URL of the attachment.
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class CallEndedWebhookEvent < 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::CallEndedWebhookEvent::Data]
16
+ required :data, -> { SurgeAPI::CallEndedWebhookEvent::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 `call.ended` for this event.
26
+ #
27
+ # @return [Symbol, :"call.ended"]
28
+ required :type, const: :"call.ended"
29
+
30
+ # @!method initialize(account_id:, data:, timestamp:, type: :"call.ended")
31
+ # @param account_id [String] The ID of the account in which this event occurred
32
+ #
33
+ # @param data [SurgeAPI::Models::CallEndedWebhookEvent::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, :"call.ended"] The type of the event. Always `call.ended` for this event.
38
+
39
+ # @see SurgeAPI::Models::CallEndedWebhookEvent#data
40
+ class Data < SurgeAPI::Internal::Type::BaseModel
41
+ # @!attribute id
42
+ # The unique identifier for the call
43
+ #
44
+ # @return [String]
45
+ required :id, String
46
+
47
+ # @!attribute contact
48
+ # A contact who has consented to receive messages
49
+ #
50
+ # @return [SurgeAPI::Models::Contact]
51
+ required :contact, -> { SurgeAPI::Contact }
52
+
53
+ # @!attribute duration
54
+ # The duration of the call in seconds
55
+ #
56
+ # @return [Integer]
57
+ required :duration, Integer
58
+
59
+ # @!attribute initiated_at
60
+ # When the call was initiated
61
+ #
62
+ # @return [Time]
63
+ required :initiated_at, Time
64
+
65
+ # @!attribute status
66
+ # The status of the call
67
+ #
68
+ # @return [Symbol, SurgeAPI::Models::CallEndedWebhookEvent::Data::Status]
69
+ required :status, enum: -> { SurgeAPI::CallEndedWebhookEvent::Data::Status }
70
+
71
+ # @!method initialize(id:, contact:, duration:, initiated_at:, status:)
72
+ # The data associated with the event
73
+ #
74
+ # @param id [String] The unique identifier for the call
75
+ #
76
+ # @param contact [SurgeAPI::Models::Contact] A contact who has consented to receive messages
77
+ #
78
+ # @param duration [Integer] The duration of the call in seconds
79
+ #
80
+ # @param initiated_at [Time] When the call was initiated
81
+ #
82
+ # @param status [Symbol, SurgeAPI::Models::CallEndedWebhookEvent::Data::Status] The status of the call
83
+
84
+ # The status of the call
85
+ #
86
+ # @see SurgeAPI::Models::CallEndedWebhookEvent::Data#status
87
+ module Status
88
+ extend SurgeAPI::Internal::Type::Enum
89
+
90
+ BUSY = :busy
91
+ CANCELED = :canceled
92
+ COMPLETED = :completed
93
+ FAILED = :failed
94
+ IN_PROGRESS = :in_progress
95
+ MISSED = :missed
96
+ NO_ANSWER = :no_answer
97
+ QUEUED = :queued
98
+ RINGING = :ringing
99
+
100
+ # @!method self.values
101
+ # @return [Array<Symbol>]
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,208 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::Campaigns#create
6
+ class Campaign < SurgeAPI::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The campaign ID
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute consent_flow
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
+ #
19
+ # @return [String]
20
+ required :consent_flow, String
21
+
22
+ # @!attribute description
23
+ # An explanation of the organization's purpose and how it will be using text
24
+ # messaging to accomplish that purpose.
25
+ #
26
+ # @return [String]
27
+ required :description, String
28
+
29
+ # @!attribute includes
30
+ # A list of properties that this campaign should include. These properties can be
31
+ # any of the following values:
32
+ #
33
+ # - `links` - whether the campaign might send links in messages
34
+ # - `phone_numbers` - whether the campaign might send phone numbers in messages
35
+ # - `age_gated` - whether the campaign contains age gated content (controlled
36
+ # substances or adult content)
37
+ # - `direct_lending` - whether the campaign contains content related to direct
38
+ # lending or other loan arrangements
39
+ #
40
+ # @return [Array<Symbol, SurgeAPI::Models::Campaign::Include>]
41
+ required :includes, -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::Campaign::Include] }
42
+
43
+ # @!attribute message_samples
44
+ # An array of 2-5 strings with examples of the messages that will be sent from
45
+ # this campaign. Typically the first sample should be a compliance message like
46
+ # `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
47
+ # These samples don't necessarily need to be the only templates that will be used
48
+ # for the campaign, but they should reflect the purpose of the messages that will
49
+ # be sent. Any variable content can be reflected by wrapping it in square brackets
50
+ # like `[customer name]`.
51
+ #
52
+ # @return [Array<String>]
53
+ required :message_samples, SurgeAPI::Internal::Type::ArrayOf[String]
54
+
55
+ # @!attribute privacy_policy_url
56
+ # The URL of the privacy policy for the brand in question. This may be a shared
57
+ # privacy policy if it's the policy that is displayed to end users when they opt
58
+ # in to messaging.
59
+ #
60
+ # @return [String]
61
+ required :privacy_policy_url, String
62
+
63
+ # @!attribute use_cases
64
+ # A list containing 1-5 types of messages that will be sent with this campaign.
65
+ #
66
+ # The following use cases are typically available to all brands:
67
+ #
68
+ # - `account_notification` - For sending reminders, alerts, and general
69
+ # account-related notifications like booking confirmations or appointment
70
+ # reminders.
71
+ # - `customer_care` - For account support, troubleshooting, and general customer
72
+ # service communication.
73
+ # - `delivery_notification` - For notifying customers about the status of product
74
+ # or service deliveries.
75
+ # - `fraud_alert` - For warning customers about suspicious or potentially
76
+ # fraudulent activity.
77
+ # - `higher_education` - For messaging related to colleges, universities, and
78
+ # school districts outside of K–12.
79
+ # - `marketing` - For promotional or advertising messages intended to market
80
+ # products or services.
81
+ # - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
82
+ # - `public_service_announcement` - For raising awareness about social issues or
83
+ # important public information.
84
+ # - `security_alert` - For alerts related to potential security breaches or
85
+ # compromised systems requiring user action.
86
+ # - `two_factor_authentication` - For sending one-time passwords or verification
87
+ # codes for login or password reset.
88
+ #
89
+ # For access to special use cases not shown here, reach out to support@surge.app.
90
+ #
91
+ # @return [Array<Symbol, SurgeAPI::Models::Campaign::UseCase>]
92
+ required :use_cases, -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::Campaign::UseCase] }
93
+
94
+ # @!attribute volume
95
+ # This will be one of the following:
96
+ #
97
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
98
+ # T-Mobile customers each day. In this case your platform will be charged for
99
+ # the setup fee for a low volume number upon receipt of the API request.
100
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
101
+ # T-Mobile customers each day, depending on the trust score assigned by The
102
+ # Campaign Registry. Your platform will be charged for the setup fee for a high
103
+ # volume number upon receipt of the API request, and phone numbers will be
104
+ # charged as high volume numbers going forward.
105
+ #
106
+ # @return [Symbol, SurgeAPI::Models::Campaign::Volume]
107
+ required :volume, enum: -> { SurgeAPI::Campaign::Volume }
108
+
109
+ # @!attribute link_sample
110
+ # A sample link that might be sent by this campaign. If links from other domains
111
+ # are sent through this campaign, they are much more likely to be filtered by the
112
+ # carriers. If link shortening is enabled for the account, the link shortener URL
113
+ # will be used instead of what is provided. Reach out to support if you would like
114
+ # to disable automatic link shortening.
115
+ #
116
+ # @return [String, nil]
117
+ optional :link_sample, String
118
+
119
+ # @!attribute terms_and_conditions_url
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
+ #
125
+ # @return [String, nil]
126
+ optional :terms_and_conditions_url, String
127
+
128
+ # @!method initialize(id:, consent_flow:, description:, includes:, message_samples:, privacy_policy_url:, use_cases:, volume:, link_sample: nil, terms_and_conditions_url: nil)
129
+ # Some parameter documentations has been truncated, see
130
+ # {SurgeAPI::Models::Campaign} for more details.
131
+ #
132
+ # A campaign represents the context in which one or more of your phone numbers
133
+ # communicates with your contacts. Consent and opt-outs are tied to the campaign.
134
+ #
135
+ # @param id [String] The campaign ID
136
+ #
137
+ # @param consent_flow [String] A string explaining the method through which end users will opt in to receive me
138
+ #
139
+ # @param description [String] An explanation of the organization's purpose and how it will be using text messa
140
+ #
141
+ # @param includes [Array<Symbol, SurgeAPI::Models::Campaign::Include>] A list of properties that this campaign should include. These properties can be
142
+ #
143
+ # @param message_samples [Array<String>] An array of 2-5 strings with examples of the messages that will be sent from thi
144
+ #
145
+ # @param privacy_policy_url [String] The URL of the privacy policy for the brand in question. This may be a shared pr
146
+ #
147
+ # @param use_cases [Array<Symbol, SurgeAPI::Models::Campaign::UseCase>] A list containing 1-5 types of messages that will be sent with this campaign.
148
+ #
149
+ # @param volume [Symbol, SurgeAPI::Models::Campaign::Volume] This will be one of the following:
150
+ #
151
+ # @param link_sample [String] A sample link that might be sent by this campaign. If links from other domains a
152
+ #
153
+ # @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
154
+
155
+ module Include
156
+ extend SurgeAPI::Internal::Type::Enum
157
+
158
+ LINKS = :links
159
+ PHONE_NUMBERS = :phone_numbers
160
+ AGE_GATED = :age_gated
161
+ DIRECT_LENDING = :direct_lending
162
+
163
+ # @!method self.values
164
+ # @return [Array<Symbol>]
165
+ end
166
+
167
+ module UseCase
168
+ extend SurgeAPI::Internal::Type::Enum
169
+
170
+ ACCOUNT_NOTIFICATION = :account_notification
171
+ CUSTOMER_CARE = :customer_care
172
+ DELIVERY_NOTIFICATION = :delivery_notification
173
+ FRAUD_ALERT = :fraud_alert
174
+ HIGHER_EDUCATION = :higher_education
175
+ MARKETING = :marketing
176
+ POLLING_VOTING = :polling_voting
177
+ PUBLIC_SERVICE_ANNOUNCEMENT = :public_service_announcement
178
+ SECURITY_ALERT = :security_alert
179
+ TWO_FACTOR_AUTHENTICATION = :two_factor_authentication
180
+
181
+ # @!method self.values
182
+ # @return [Array<Symbol>]
183
+ end
184
+
185
+ # This will be one of the following:
186
+ #
187
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
188
+ # T-Mobile customers each day. In this case your platform will be charged for
189
+ # the setup fee for a low volume number upon receipt of the API request.
190
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
191
+ # T-Mobile customers each day, depending on the trust score assigned by The
192
+ # Campaign Registry. Your platform will be charged for the setup fee for a high
193
+ # volume number upon receipt of the API request, and phone numbers will be
194
+ # charged as high volume numbers going forward.
195
+ #
196
+ # @see SurgeAPI::Models::Campaign#volume
197
+ module Volume
198
+ extend SurgeAPI::Internal::Type::Enum
199
+
200
+ HIGH = :high
201
+ LOW = :low
202
+
203
+ # @!method self.values
204
+ # @return [Array<Symbol>]
205
+ end
206
+ end
207
+ end
208
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class CampaignApprovedWebhookEvent < 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::CampaignApprovedWebhookEvent::Data]
16
+ required :data, -> { SurgeAPI::CampaignApprovedWebhookEvent::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.approved` for this event.
26
+ #
27
+ # @return [Symbol, :"campaign.approved"]
28
+ required :type, const: :"campaign.approved"
29
+
30
+ # @!method initialize(account_id:, data:, timestamp:, type: :"campaign.approved")
31
+ # @param account_id [String] The ID of the account in which this event occurred
32
+ #
33
+ # @param data [SurgeAPI::Models::CampaignApprovedWebhookEvent::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.approved"] The type of the event. Always `campaign.approved` for this event.
38
+
39
+ # @see SurgeAPI::Models::CampaignApprovedWebhookEvent#data
40
+ class Data < SurgeAPI::Internal::Type::BaseModel
41
+ # @!attribute id
42
+ # The unique identifier for the campaign
43
+ #
44
+ # @return [String]
45
+ required :id, String
46
+
47
+ # @!attribute status
48
+ # The status of the campaign. Will always be `active` for this event.
49
+ #
50
+ # @return [Symbol, SurgeAPI::Models::CampaignApprovedWebhookEvent::Data::Status]
51
+ required :status, enum: -> { SurgeAPI::CampaignApprovedWebhookEvent::Data::Status }
52
+
53
+ # @!method initialize(id:, status:)
54
+ # The data associated with the event
55
+ #
56
+ # @param id [String] The unique identifier for the campaign
57
+ #
58
+ # @param status [Symbol, SurgeAPI::Models::CampaignApprovedWebhookEvent::Data::Status] The status of the campaign. Will always be `active` for this event.
59
+
60
+ # The status of the campaign. Will always be `active` for this event.
61
+ #
62
+ # @see SurgeAPI::Models::CampaignApprovedWebhookEvent::Data#status
63
+ module Status
64
+ extend SurgeAPI::Internal::Type::Enum
65
+
66
+ ACTIVE = :active
67
+
68
+ # @!method self.values
69
+ # @return [Array<Symbol>]
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,202 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # @see SurgeAPI::Resources::Campaigns#create
6
+ class CampaignCreateParams < SurgeAPI::Internal::Type::BaseModel
7
+ extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
+ include SurgeAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute consent_flow
11
+ # A string explaining the method through which end users will opt in to receive
12
+ # messages from the brand. Typically this should include URLs for opt-in forms or
13
+ # screenshots that might be helpful in explaining the flow to someone unfamiliar
14
+ # with the organization's purpose.
15
+ #
16
+ # @return [String]
17
+ required :consent_flow, String
18
+
19
+ # @!attribute description
20
+ # An explanation of the organization's purpose and how it will be using text
21
+ # messaging to accomplish that purpose.
22
+ #
23
+ # @return [String]
24
+ required :description, String
25
+
26
+ # @!attribute message_samples
27
+ # An array of 2-5 strings with examples of the messages that will be sent from
28
+ # this campaign. Typically the first sample should be a compliance message like
29
+ # `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
30
+ # These samples don't necessarily need to be the only templates that will be used
31
+ # for the campaign, but they should reflect the purpose of the messages that will
32
+ # be sent. Any variable content can be reflected by wrapping it in square brackets
33
+ # like `[customer name]`.
34
+ #
35
+ # @return [Array<String>]
36
+ required :message_samples, SurgeAPI::Internal::Type::ArrayOf[String]
37
+
38
+ # @!attribute privacy_policy_url
39
+ # The URL of the privacy policy for the brand in question. This may be a shared
40
+ # privacy policy if it's the policy that is displayed to end users when they opt
41
+ # in to messaging.
42
+ #
43
+ # @return [String]
44
+ required :privacy_policy_url, String
45
+
46
+ # @!attribute use_cases
47
+ # A list containing 1-5 types of messages that will be sent with this campaign.
48
+ #
49
+ # The following use cases are typically available to all brands:
50
+ #
51
+ # - `account_notification` - For sending reminders, alerts, and general
52
+ # account-related notifications like booking confirmations or appointment
53
+ # reminders.
54
+ # - `customer_care` - For account support, troubleshooting, and general customer
55
+ # service communication.
56
+ # - `delivery_notification` - For notifying customers about the status of product
57
+ # or service deliveries.
58
+ # - `fraud_alert` - For warning customers about suspicious or potentially
59
+ # fraudulent activity.
60
+ # - `higher_education` - For messaging related to colleges, universities, and
61
+ # school districts outside of K–12.
62
+ # - `marketing` - For promotional or advertising messages intended to market
63
+ # products or services.
64
+ # - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
65
+ # - `public_service_announcement` - For raising awareness about social issues or
66
+ # important public information.
67
+ # - `security_alert` - For alerts related to potential security breaches or
68
+ # compromised systems requiring user action.
69
+ # - `two_factor_authentication` - For sending one-time passwords or verification
70
+ # codes for login or password reset.
71
+ #
72
+ # For access to special use cases not shown here, reach out to support@surge.app.
73
+ #
74
+ # @return [Array<Symbol, SurgeAPI::Models::CampaignCreateParams::UseCase>]
75
+ required :use_cases,
76
+ -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignCreateParams::UseCase] }
77
+
78
+ # @!attribute volume
79
+ # This will be one of the following:
80
+ #
81
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
82
+ # T-Mobile customers each day. In this case your platform will be charged for
83
+ # the setup fee for a low volume number upon receipt of the API request.
84
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
85
+ # T-Mobile customers each day, depending on the trust score assigned by The
86
+ # Campaign Registry. Your platform will be charged for the setup fee for a high
87
+ # volume number upon receipt of the API request, and phone numbers will be
88
+ # charged as high volume numbers going forward.
89
+ #
90
+ # @return [Symbol, SurgeAPI::Models::CampaignCreateParams::Volume]
91
+ required :volume, enum: -> { SurgeAPI::CampaignCreateParams::Volume }
92
+
93
+ # @!attribute includes
94
+ # A list of properties that this campaign should include. These properties can be
95
+ # any of the following values:
96
+ #
97
+ # - `links` - whether the campaign might send links in messages
98
+ # - `phone_numbers` - whether the campaign might send phone numbers in messages
99
+ # - `age_gated` - whether the campaign contains age gated content (controlled
100
+ # substances or adult content)
101
+ # - `direct_lending` - whether the campaign contains content related to direct
102
+ # lending or other loan arrangements
103
+ #
104
+ # @return [Array<Symbol, SurgeAPI::Models::CampaignCreateParams::Include>, nil]
105
+ optional :includes,
106
+ -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignCreateParams::Include] }
107
+
108
+ # @!attribute link_sample
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
+ #
115
+ # @return [String, nil]
116
+ optional :link_sample, String
117
+
118
+ # @!attribute terms_and_conditions_url
119
+ # The URL of the terms and conditions presented to end users when they opt in to
120
+ # messaging. These terms and conditions may be shared among all of a platform's
121
+ # customers if they're the terms that are presented to end users when they opt in
122
+ # to messaging.
123
+ #
124
+ # @return [String, nil]
125
+ optional :terms_and_conditions_url, String
126
+
127
+ # @!method initialize(consent_flow:, description:, message_samples:, privacy_policy_url:, use_cases:, volume:, includes: nil, link_sample: nil, terms_and_conditions_url: nil, request_options: {})
128
+ # Some parameter documentations has been truncated, see
129
+ # {SurgeAPI::Models::CampaignCreateParams} for more details.
130
+ #
131
+ # @param consent_flow [String] A string explaining the method through which end users will opt in to receive me
132
+ #
133
+ # @param description [String] An explanation of the organization's purpose and how it will be using text messa
134
+ #
135
+ # @param message_samples [Array<String>] An array of 2-5 strings with examples of the messages that will be sent from thi
136
+ #
137
+ # @param privacy_policy_url [String] The URL of the privacy policy for the brand in question. This may be a shared pr
138
+ #
139
+ # @param use_cases [Array<Symbol, SurgeAPI::Models::CampaignCreateParams::UseCase>] A list containing 1-5 types of messages that will be sent with this campaign.
140
+ #
141
+ # @param volume [Symbol, SurgeAPI::Models::CampaignCreateParams::Volume] This will be one of the following:
142
+ #
143
+ # @param includes [Array<Symbol, SurgeAPI::Models::CampaignCreateParams::Include>] A list of properties that this campaign should include. These properties can be
144
+ #
145
+ # @param link_sample [String] A sample link that might be sent by this campaign. If links from other domains a
146
+ #
147
+ # @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
148
+ #
149
+ # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
150
+
151
+ module UseCase
152
+ extend SurgeAPI::Internal::Type::Enum
153
+
154
+ ACCOUNT_NOTIFICATION = :account_notification
155
+ CUSTOMER_CARE = :customer_care
156
+ DELIVERY_NOTIFICATION = :delivery_notification
157
+ FRAUD_ALERT = :fraud_alert
158
+ HIGHER_EDUCATION = :higher_education
159
+ MARKETING = :marketing
160
+ POLLING_VOTING = :polling_voting
161
+ PUBLIC_SERVICE_ANNOUNCEMENT = :public_service_announcement
162
+ SECURITY_ALERT = :security_alert
163
+ TWO_FACTOR_AUTHENTICATION = :two_factor_authentication
164
+
165
+ # @!method self.values
166
+ # @return [Array<Symbol>]
167
+ end
168
+
169
+ # This will be one of the following:
170
+ #
171
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
172
+ # T-Mobile customers each day. In this case your platform will be charged for
173
+ # the setup fee for a low volume number upon receipt of the API request.
174
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
175
+ # T-Mobile customers each day, depending on the trust score assigned by The
176
+ # Campaign Registry. Your platform will be charged for the setup fee for a high
177
+ # volume number upon receipt of the API request, and phone numbers will be
178
+ # charged as high volume numbers going forward.
179
+ module Volume
180
+ extend SurgeAPI::Internal::Type::Enum
181
+
182
+ HIGH = :high
183
+ LOW = :low
184
+
185
+ # @!method self.values
186
+ # @return [Array<Symbol>]
187
+ end
188
+
189
+ module Include
190
+ extend SurgeAPI::Internal::Type::Enum
191
+
192
+ LINKS = :links
193
+ PHONE_NUMBERS = :phone_numbers
194
+ AGE_GATED = :age_gated
195
+ DIRECT_LENDING = :direct_lending
196
+
197
+ # @!method self.values
198
+ # @return [Array<Symbol>]
199
+ end
200
+ end
201
+ end
202
+ end