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,84 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class VerificationCheck < SurgeAPI::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(SurgeAPI::VerificationCheck, SurgeAPI::Internal::AnyHash)
9
+ end
10
+
11
+ # The result of the code check.
12
+ sig do
13
+ returns(T.nilable(SurgeAPI::VerificationCheck::Result::TaggedSymbol))
14
+ end
15
+ attr_reader :result
16
+
17
+ sig { params(result: SurgeAPI::VerificationCheck::Result::OrSymbol).void }
18
+ attr_writer :result
19
+
20
+ # A phone number verification
21
+ sig { returns(T.nilable(SurgeAPI::Verification)) }
22
+ attr_reader :verification
23
+
24
+ sig { params(verification: SurgeAPI::Verification::OrHash).void }
25
+ attr_writer :verification
26
+
27
+ # The result of checking a Verification code
28
+ sig do
29
+ params(
30
+ result: SurgeAPI::VerificationCheck::Result::OrSymbol,
31
+ verification: SurgeAPI::Verification::OrHash
32
+ ).returns(T.attached_class)
33
+ end
34
+ def self.new(
35
+ # The result of the code check.
36
+ result: nil,
37
+ # A phone number verification
38
+ verification: nil
39
+ )
40
+ end
41
+
42
+ sig do
43
+ override.returns(
44
+ {
45
+ result: SurgeAPI::VerificationCheck::Result::TaggedSymbol,
46
+ verification: SurgeAPI::Verification
47
+ }
48
+ )
49
+ end
50
+ def to_hash
51
+ end
52
+
53
+ # The result of the code check.
54
+ module Result
55
+ extend SurgeAPI::Internal::Type::Enum
56
+
57
+ TaggedSymbol =
58
+ T.type_alias { T.all(Symbol, SurgeAPI::VerificationCheck::Result) }
59
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
60
+
61
+ OK = T.let(:ok, SurgeAPI::VerificationCheck::Result::TaggedSymbol)
62
+ INCORRECT =
63
+ T.let(:incorrect, SurgeAPI::VerificationCheck::Result::TaggedSymbol)
64
+ EXHAUSTED =
65
+ T.let(:exhausted, SurgeAPI::VerificationCheck::Result::TaggedSymbol)
66
+ EXPIRED =
67
+ T.let(:expired, SurgeAPI::VerificationCheck::Result::TaggedSymbol)
68
+ ALREADY_VERIFIED =
69
+ T.let(
70
+ :already_verified,
71
+ SurgeAPI::VerificationCheck::Result::TaggedSymbol
72
+ )
73
+
74
+ sig do
75
+ override.returns(
76
+ T::Array[SurgeAPI::VerificationCheck::Result::TaggedSymbol]
77
+ )
78
+ end
79
+ def self.values
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class VerificationCheckParams < 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::VerificationCheckParams, SurgeAPI::Internal::AnyHash)
12
+ end
13
+
14
+ # The Verification code that was received.
15
+ sig { returns(String) }
16
+ attr_accessor :code
17
+
18
+ sig do
19
+ params(
20
+ code: String,
21
+ request_options: SurgeAPI::RequestOptions::OrHash
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(
25
+ # The Verification code that was received.
26
+ code:,
27
+ request_options: {}
28
+ )
29
+ end
30
+
31
+ sig do
32
+ override.returns(
33
+ { code: String, request_options: SurgeAPI::RequestOptions }
34
+ )
35
+ end
36
+ def to_hash
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class VerificationCreateParams < 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::VerificationCreateParams, SurgeAPI::Internal::AnyHash)
12
+ end
13
+
14
+ # The phone number to be verified. In E.164 format.
15
+ sig { returns(String) }
16
+ attr_accessor :phone_number
17
+
18
+ sig do
19
+ params(
20
+ phone_number: String,
21
+ request_options: SurgeAPI::RequestOptions::OrHash
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(
25
+ # The phone number to be verified. In E.164 format.
26
+ phone_number:,
27
+ request_options: {}
28
+ )
29
+ end
30
+
31
+ sig do
32
+ override.returns(
33
+ { phone_number: String, request_options: SurgeAPI::RequestOptions }
34
+ )
35
+ end
36
+ def to_hash
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class WebhookUnwrapParams < 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::WebhookUnwrapParams, 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,80 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ Account = SurgeAPI::Models::Account
5
+
6
+ AccountCreateParams = SurgeAPI::Models::AccountCreateParams
7
+
8
+ AccountRetrieveStatusParams = SurgeAPI::Models::AccountRetrieveStatusParams
9
+
10
+ AccountStatus = SurgeAPI::Models::AccountStatus
11
+
12
+ AccountUpdateParams = SurgeAPI::Models::AccountUpdateParams
13
+
14
+ Blast = SurgeAPI::Models::Blast
15
+
16
+ BlastCreateParams = SurgeAPI::Models::BlastCreateParams
17
+
18
+ CallEndedWebhookEvent = SurgeAPI::Models::CallEndedWebhookEvent
19
+
20
+ Campaign = SurgeAPI::Models::Campaign
21
+
22
+ CampaignApprovedWebhookEvent = SurgeAPI::Models::CampaignApprovedWebhookEvent
23
+
24
+ CampaignCreateParams = SurgeAPI::Models::CampaignCreateParams
25
+
26
+ Contact = SurgeAPI::Models::Contact
27
+
28
+ ContactCreateParams = SurgeAPI::Models::ContactCreateParams
29
+
30
+ ContactRetrieveParams = SurgeAPI::Models::ContactRetrieveParams
31
+
32
+ ContactUpdateParams = SurgeAPI::Models::ContactUpdateParams
33
+
34
+ ConversationCreatedWebhookEvent =
35
+ SurgeAPI::Models::ConversationCreatedWebhookEvent
36
+
37
+ Error = SurgeAPI::Models::Error
38
+
39
+ Message = SurgeAPI::Models::Message
40
+
41
+ MessageCreateParams = SurgeAPI::Models::MessageCreateParams
42
+
43
+ MessageDeliveredWebhookEvent = SurgeAPI::Models::MessageDeliveredWebhookEvent
44
+
45
+ MessageFailedWebhookEvent = SurgeAPI::Models::MessageFailedWebhookEvent
46
+
47
+ MessageReceivedWebhookEvent = SurgeAPI::Models::MessageReceivedWebhookEvent
48
+
49
+ MessageSentWebhookEvent = SurgeAPI::Models::MessageSentWebhookEvent
50
+
51
+ Organization = SurgeAPI::Models::Organization
52
+
53
+ PhoneNumber = SurgeAPI::Models::PhoneNumber
54
+
55
+ PhoneNumberPurchaseParams = SurgeAPI::Models::PhoneNumberPurchaseParams
56
+
57
+ UnwrapWebhookEvent = SurgeAPI::Models::UnwrapWebhookEvent
58
+
59
+ User = SurgeAPI::Models::User
60
+
61
+ UserCreateParams = SurgeAPI::Models::UserCreateParams
62
+
63
+ UserCreateTokenParams = SurgeAPI::Models::UserCreateTokenParams
64
+
65
+ UserRetrieveParams = SurgeAPI::Models::UserRetrieveParams
66
+
67
+ UserTokenResponse = SurgeAPI::Models::UserTokenResponse
68
+
69
+ UserUpdateParams = SurgeAPI::Models::UserUpdateParams
70
+
71
+ Verification = SurgeAPI::Models::Verification
72
+
73
+ VerificationCheck = SurgeAPI::Models::VerificationCheck
74
+
75
+ VerificationCheckParams = SurgeAPI::Models::VerificationCheckParams
76
+
77
+ VerificationCreateParams = SurgeAPI::Models::VerificationCreateParams
78
+
79
+ WebhookUnwrapParams = SurgeAPI::Models::WebhookUnwrapParams
80
+ end
@@ -0,0 +1,59 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ # Specify HTTP behaviour to use for a specific request. These options supplement
5
+ # or override those provided at the client level.
6
+ #
7
+ # When making a request, you can pass an actual {RequestOptions} instance, or
8
+ # simply pass a Hash with symbol keys matching the attributes on this class.
9
+ class RequestOptions < SurgeAPI::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(SurgeAPI::RequestOptions, SurgeAPI::Internal::AnyHash)
13
+ end
14
+
15
+ # @api private
16
+ sig { params(opts: SurgeAPI::RequestOptions::OrHash).void }
17
+ def self.validate!(opts)
18
+ end
19
+
20
+ # Idempotency key to send with request and all associated retries. Will only be
21
+ # sent for write requests.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_accessor :idempotency_key
24
+
25
+ # Extra query params to send with the request. These are `.merge`’d into any
26
+ # `query` given at the client level.
27
+ sig do
28
+ returns(
29
+ T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])
30
+ )
31
+ end
32
+ attr_accessor :extra_query
33
+
34
+ # Extra headers to send with the request. These are `.merged`’d into any
35
+ # `extra_headers` given at the client level.
36
+ sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) }
37
+ attr_accessor :extra_headers
38
+
39
+ # Extra data to send with the request. These are deep merged into any data
40
+ # generated as part of the normal request.
41
+ sig { returns(T.nilable(T.anything)) }
42
+ attr_accessor :extra_body
43
+
44
+ # Maximum number of retries to attempt after a failed initial request.
45
+ sig { returns(T.nilable(Integer)) }
46
+ attr_accessor :max_retries
47
+
48
+ # Request timeout in seconds.
49
+ sig { returns(T.nilable(Float)) }
50
+ attr_accessor :timeout
51
+
52
+ # Returns a new instance of RequestOptions.
53
+ sig do
54
+ params(values: SurgeAPI::Internal::AnyHash).returns(T.attached_class)
55
+ end
56
+ def self.new(values = {})
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,94 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Resources
5
+ class Accounts
6
+ # Creates a new Account within the calling Platform.
7
+ sig do
8
+ params(
9
+ name: String,
10
+ brand_name: T.nilable(String),
11
+ organization: SurgeAPI::AccountCreateParams::Organization::OrHash,
12
+ time_zone: String,
13
+ request_options: SurgeAPI::RequestOptions::OrHash
14
+ ).returns(SurgeAPI::Account)
15
+ end
16
+ def create(
17
+ # The name of the account that will be visible for your internal organizational
18
+ # purposes. This will also be the default public-facing brand name unless you also
19
+ # set a `brand_name`, but otherwise the account name will never be displayed
20
+ # anywhere outside of Surge HQ, and may include your ID for the account or
21
+ # anything else that may help you.
22
+ name:,
23
+ # The name by which the people this account communicates with know it. If not
24
+ # provided, this will match the name field.
25
+ brand_name: nil,
26
+ # Parameters describing the legal entity on whose behalf the account will be
27
+ # operated.
28
+ organization: nil,
29
+ # This is the time zone in which the account is headquartered. This time zone may
30
+ # be used for compliance with TCPA restrictions on when messages may be sent.
31
+ time_zone: nil,
32
+ request_options: {}
33
+ )
34
+ end
35
+
36
+ # Updates an Account
37
+ sig do
38
+ params(
39
+ id: String,
40
+ brand_name: String,
41
+ name: String,
42
+ organization: SurgeAPI::AccountUpdateParams::Organization::OrHash,
43
+ time_zone: T.nilable(String),
44
+ request_options: SurgeAPI::RequestOptions::OrHash
45
+ ).returns(SurgeAPI::Account)
46
+ end
47
+ def update(
48
+ # The ID for the account to update.
49
+ id,
50
+ # The name by which the people this account communicates with know it. If not
51
+ # provided, this will match the name field.
52
+ brand_name: nil,
53
+ # The name of the account that will be visible for your internal organizational
54
+ # purposes. This will also be the default public-facing brand name unless you also
55
+ # set a `brand_name`, but otherwise the account name will never be displayed
56
+ # anywhere outside of Surge HQ, and may include your ID for the account or
57
+ # anything else that may help you.
58
+ name: nil,
59
+ # Parameters describing the legal entity on whose behalf the account will be
60
+ # operated.
61
+ organization: nil,
62
+ # The time zone for the account
63
+ time_zone: nil,
64
+ request_options: {}
65
+ )
66
+ end
67
+
68
+ # Check an account's status and capabilities
69
+ sig do
70
+ params(
71
+ account_id: String,
72
+ capabilities:
73
+ T::Array[
74
+ SurgeAPI::AccountRetrieveStatusParams::Capability::OrSymbol
75
+ ],
76
+ request_options: SurgeAPI::RequestOptions::OrHash
77
+ ).returns(SurgeAPI::AccountStatus)
78
+ end
79
+ def retrieve_status(
80
+ # ID of the account to check
81
+ account_id,
82
+ # capabilities about which to check the status
83
+ capabilities: nil,
84
+ request_options: {}
85
+ )
86
+ end
87
+
88
+ # @api private
89
+ sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
90
+ def self.new(client:)
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Resources
5
+ class Blasts
6
+ # Sends a Blast.
7
+ sig do
8
+ params(
9
+ account_id: String,
10
+ attachments:
11
+ T::Array[SurgeAPI::BlastCreateParams::Attachment::OrHash],
12
+ body: String,
13
+ contacts: T::Array[String],
14
+ name: String,
15
+ segments: T::Array[String],
16
+ send_at: Time,
17
+ to: T::Array[String],
18
+ request_options: SurgeAPI::RequestOptions::OrHash
19
+ ).returns(SurgeAPI::Blast)
20
+ end
21
+ def create(
22
+ # The account for which the blast should be sent.
23
+ account_id,
24
+ attachments: nil,
25
+ # The message body.
26
+ body: nil,
27
+ # Deprecated. Use `to` instead.
28
+ contacts: nil,
29
+ # Optional name for the blast.
30
+ name: nil,
31
+ # Deprecated. Use `to` instead.
32
+ segments: nil,
33
+ # When to send the blast. If not provided, sends immediately.
34
+ send_at: nil,
35
+ # List of recipients to whom the blast should be sent. This can be a combination
36
+ # of contact IDs, segment IDs, and phone numbers.
37
+ to: nil,
38
+ request_options: {}
39
+ )
40
+ end
41
+
42
+ # @api private
43
+ sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
44
+ def self.new(client:)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,115 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Resources
5
+ class Campaigns
6
+ # Creates a campaign to register account to send text messages.
7
+ sig do
8
+ params(
9
+ account_id: String,
10
+ consent_flow: String,
11
+ description: String,
12
+ message_samples: T::Array[String],
13
+ privacy_policy_url: String,
14
+ use_cases:
15
+ T::Array[SurgeAPI::CampaignCreateParams::UseCase::OrSymbol],
16
+ volume: SurgeAPI::CampaignCreateParams::Volume::OrSymbol,
17
+ includes: T::Array[SurgeAPI::CampaignCreateParams::Include::OrSymbol],
18
+ link_sample: String,
19
+ terms_and_conditions_url: String,
20
+ request_options: SurgeAPI::RequestOptions::OrHash
21
+ ).returns(SurgeAPI::Campaign)
22
+ end
23
+ def create(
24
+ # The account for which the campaign should be created.
25
+ account_id,
26
+ # A string explaining the method through which end users will opt in to receive
27
+ # messages from the brand. Typically this should include URLs for opt-in forms or
28
+ # screenshots that might be helpful in explaining the flow to someone unfamiliar
29
+ # with the organization's purpose.
30
+ consent_flow:,
31
+ # An explanation of the organization's purpose and how it will be using text
32
+ # messaging to accomplish that purpose.
33
+ description:,
34
+ # An array of 2-5 strings with examples of the messages that will be sent from
35
+ # this campaign. Typically the first sample should be a compliance message like
36
+ # `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
37
+ # These samples don't necessarily need to be the only templates that will be used
38
+ # for the campaign, but they should reflect the purpose of the messages that will
39
+ # be sent. Any variable content can be reflected by wrapping it in square brackets
40
+ # like `[customer name]`.
41
+ message_samples:,
42
+ # The URL of the privacy policy for the brand in question. This may be a shared
43
+ # privacy policy if it's the policy that is displayed to end users when they opt
44
+ # in to messaging.
45
+ privacy_policy_url:,
46
+ # A list containing 1-5 types of messages that will be sent with this campaign.
47
+ #
48
+ # The following use cases are typically available to all brands:
49
+ #
50
+ # - `account_notification` - For sending reminders, alerts, and general
51
+ # account-related notifications like booking confirmations or appointment
52
+ # reminders.
53
+ # - `customer_care` - For account support, troubleshooting, and general customer
54
+ # service communication.
55
+ # - `delivery_notification` - For notifying customers about the status of product
56
+ # or service deliveries.
57
+ # - `fraud_alert` - For warning customers about suspicious or potentially
58
+ # fraudulent activity.
59
+ # - `higher_education` - For messaging related to colleges, universities, and
60
+ # school districts outside of K–12.
61
+ # - `marketing` - For promotional or advertising messages intended to market
62
+ # products or services.
63
+ # - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
64
+ # - `public_service_announcement` - For raising awareness about social issues or
65
+ # important public information.
66
+ # - `security_alert` - For alerts related to potential security breaches or
67
+ # compromised systems requiring user action.
68
+ # - `two_factor_authentication` - For sending one-time passwords or verification
69
+ # codes for login or password reset.
70
+ #
71
+ # For access to special use cases not shown here, reach out to support@surge.app.
72
+ use_cases:,
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
+ volume:,
84
+ # A list of properties that this campaign should include. These properties can be
85
+ # any of the following values:
86
+ #
87
+ # - `links` - whether the campaign might send links in messages
88
+ # - `phone_numbers` - whether the campaign might send phone numbers in messages
89
+ # - `age_gated` - whether the campaign contains age gated content (controlled
90
+ # substances or adult content)
91
+ # - `direct_lending` - whether the campaign contains content related to direct
92
+ # lending or other loan arrangements
93
+ includes: nil,
94
+ # A sample link that might be sent by this campaign. If links from other domains
95
+ # are sent through this campaign, they are much more likely to be filtered by the
96
+ # carriers. If link shortening is enabled for the account, the link shortener URL
97
+ # will be used instead of what is provided. Reach out to support if you would like
98
+ # to disable automatic link shortening.
99
+ link_sample: nil,
100
+ # The URL of the terms and conditions presented to end users when they opt in to
101
+ # messaging. These terms and conditions may be shared among all of a platform's
102
+ # customers if they're the terms that are presented to end users when they opt in
103
+ # to messaging.
104
+ terms_and_conditions_url: nil,
105
+ request_options: {}
106
+ )
107
+ end
108
+
109
+ # @api private
110
+ sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
111
+ def self.new(client:)
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,85 @@
1
+ # typed: strong
2
+
3
+ module SurgeAPI
4
+ module Resources
5
+ class Contacts
6
+ # Creates a new Contact object.
7
+ sig do
8
+ params(
9
+ account_id: String,
10
+ phone_number: String,
11
+ email: String,
12
+ first_name: String,
13
+ last_name: String,
14
+ metadata: T::Hash[Symbol, String],
15
+ request_options: SurgeAPI::RequestOptions::OrHash
16
+ ).returns(SurgeAPI::Contact)
17
+ end
18
+ def create(
19
+ # The account for which the contact should be created.
20
+ account_id,
21
+ # The contact's phone number in E.164 format.
22
+ phone_number:,
23
+ # The contact's email address.
24
+ email: nil,
25
+ # The contact's first name.
26
+ first_name: nil,
27
+ # The contact's last name.
28
+ last_name: nil,
29
+ # Set of key-value pairs that will be stored with the object.
30
+ metadata: nil,
31
+ request_options: {}
32
+ )
33
+ end
34
+
35
+ # Retrieves a Contact object.
36
+ sig do
37
+ params(
38
+ id: String,
39
+ request_options: SurgeAPI::RequestOptions::OrHash
40
+ ).returns(SurgeAPI::Contact)
41
+ end
42
+ def retrieve(
43
+ # The ID of the contact to retrieve.
44
+ id,
45
+ request_options: {}
46
+ )
47
+ end
48
+
49
+ # Updates the specified contact by setting the values of the parameters passed.
50
+ # Any parameters not provided will be left unchanged.
51
+ sig do
52
+ params(
53
+ id: String,
54
+ phone_number: String,
55
+ email: String,
56
+ first_name: String,
57
+ last_name: String,
58
+ metadata: T::Hash[Symbol, String],
59
+ request_options: SurgeAPI::RequestOptions::OrHash
60
+ ).returns(SurgeAPI::Contact)
61
+ end
62
+ def update(
63
+ # The ID of the contact to update.
64
+ id,
65
+ # The contact's phone number in E.164 format.
66
+ phone_number:,
67
+ # The contact's email address.
68
+ email: nil,
69
+ # The contact's first name.
70
+ first_name: nil,
71
+ # The contact's last name.
72
+ last_name: nil,
73
+ # Set of key-value pairs that will be stored with the object.
74
+ metadata: nil,
75
+ request_options: {}
76
+ )
77
+ end
78
+
79
+ # @api private
80
+ sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
81
+ def self.new(client:)
82
+ end
83
+ end
84
+ end
85
+ end