surge_api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +28 -0
- data/README.md +286 -0
- data/SECURITY.md +27 -0
- data/lib/surge_api/client.rb +106 -0
- data/lib/surge_api/errors.rb +228 -0
- data/lib/surge_api/file_part.rb +55 -0
- data/lib/surge_api/internal/transport/base_client.rb +567 -0
- data/lib/surge_api/internal/transport/pooled_net_requester.rb +201 -0
- data/lib/surge_api/internal/type/array_of.rb +168 -0
- data/lib/surge_api/internal/type/base_model.rb +531 -0
- data/lib/surge_api/internal/type/base_page.rb +55 -0
- data/lib/surge_api/internal/type/boolean.rb +77 -0
- data/lib/surge_api/internal/type/converter.rb +327 -0
- data/lib/surge_api/internal/type/enum.rb +131 -0
- data/lib/surge_api/internal/type/file_input.rb +108 -0
- data/lib/surge_api/internal/type/hash_of.rb +188 -0
- data/lib/surge_api/internal/type/request_parameters.rb +42 -0
- data/lib/surge_api/internal/type/union.rb +250 -0
- data/lib/surge_api/internal/type/unknown.rb +81 -0
- data/lib/surge_api/internal/util.rb +915 -0
- data/lib/surge_api/internal.rb +20 -0
- data/lib/surge_api/models/account.rb +60 -0
- data/lib/surge_api/models/account_create_params.rb +481 -0
- data/lib/surge_api/models/account_retrieve_status_params.rb +32 -0
- data/lib/surge_api/models/account_status.rb +104 -0
- data/lib/surge_api/models/account_update_params.rb +480 -0
- data/lib/surge_api/models/blast.rb +61 -0
- data/lib/surge_api/models/blast_create_params.rb +90 -0
- data/lib/surge_api/models/call_ended_webhook_event.rb +106 -0
- data/lib/surge_api/models/campaign.rb +208 -0
- data/lib/surge_api/models/campaign_approved_webhook_event.rb +74 -0
- data/lib/surge_api/models/campaign_create_params.rb +202 -0
- data/lib/surge_api/models/contact.rb +59 -0
- data/lib/surge_api/models/contact_create_params.rb +54 -0
- data/lib/surge_api/models/contact_retrieve_params.rb +14 -0
- data/lib/surge_api/models/contact_update_params.rb +54 -0
- data/lib/surge_api/models/conversation_created_webhook_event.rb +70 -0
- data/lib/surge_api/models/error.rb +34 -0
- data/lib/surge_api/models/message.rb +146 -0
- data/lib/surge_api/models/message_create_params.rb +153 -0
- data/lib/surge_api/models/message_delivered_webhook_event.rb +159 -0
- data/lib/surge_api/models/message_failed_webhook_event.rb +167 -0
- data/lib/surge_api/models/message_received_webhook_event.rb +159 -0
- data/lib/surge_api/models/message_sent_webhook_event.rb +159 -0
- data/lib/surge_api/models/organization.rb +419 -0
- data/lib/surge_api/models/phone_number.rb +48 -0
- data/lib/surge_api/models/phone_number_purchase_params.rb +65 -0
- data/lib/surge_api/models/unwrap_webhook_event.rb +26 -0
- data/lib/surge_api/models/user.rb +51 -0
- data/lib/surge_api/models/user_create_params.rb +46 -0
- data/lib/surge_api/models/user_create_token_params.rb +22 -0
- data/lib/surge_api/models/user_retrieve_params.rb +14 -0
- data/lib/surge_api/models/user_token_response.rb +19 -0
- data/lib/surge_api/models/user_update_params.rb +46 -0
- data/lib/surge_api/models/verification.rb +58 -0
- data/lib/surge_api/models/verification_check.rb +43 -0
- data/lib/surge_api/models/verification_check_params.rb +22 -0
- data/lib/surge_api/models/verification_create_params.rb +22 -0
- data/lib/surge_api/models/webhook_unwrap_params.rb +14 -0
- data/lib/surge_api/models.rb +117 -0
- data/lib/surge_api/request_options.rb +77 -0
- data/lib/surge_api/resources/accounts.rb +102 -0
- data/lib/surge_api/resources/blasts.rb +53 -0
- data/lib/surge_api/resources/campaigns.rb +57 -0
- data/lib/surge_api/resources/contacts.rb +99 -0
- data/lib/surge_api/resources/messages.rb +75 -0
- data/lib/surge_api/resources/phone_numbers.rb +48 -0
- data/lib/surge_api/resources/users.rb +119 -0
- data/lib/surge_api/resources/verifications.rb +60 -0
- data/lib/surge_api/resources/webhooks.rb +22 -0
- data/lib/surge_api/version.rb +5 -0
- data/lib/surge_api.rb +100 -0
- data/manifest.yaml +15 -0
- data/rbi/surge_api/client.rbi +73 -0
- data/rbi/surge_api/errors.rbi +205 -0
- data/rbi/surge_api/file_part.rbi +37 -0
- data/rbi/surge_api/internal/transport/base_client.rbi +292 -0
- data/rbi/surge_api/internal/transport/pooled_net_requester.rbi +79 -0
- data/rbi/surge_api/internal/type/array_of.rbi +104 -0
- data/rbi/surge_api/internal/type/base_model.rbi +302 -0
- data/rbi/surge_api/internal/type/base_page.rbi +42 -0
- data/rbi/surge_api/internal/type/boolean.rbi +58 -0
- data/rbi/surge_api/internal/type/converter.rbi +216 -0
- data/rbi/surge_api/internal/type/enum.rbi +82 -0
- data/rbi/surge_api/internal/type/file_input.rbi +59 -0
- data/rbi/surge_api/internal/type/hash_of.rbi +104 -0
- data/rbi/surge_api/internal/type/request_parameters.rbi +29 -0
- data/rbi/surge_api/internal/type/union.rbi +128 -0
- data/rbi/surge_api/internal/type/unknown.rbi +58 -0
- data/rbi/surge_api/internal/util.rbi +487 -0
- data/rbi/surge_api/internal.rbi +16 -0
- data/rbi/surge_api/models/account.rbi +83 -0
- data/rbi/surge_api/models/account_create_params.rbi +1104 -0
- data/rbi/surge_api/models/account_retrieve_status_params.rbi +96 -0
- data/rbi/surge_api/models/account_status.rbi +185 -0
- data/rbi/surge_api/models/account_update_params.rbi +1105 -0
- data/rbi/surge_api/models/blast.rbi +108 -0
- data/rbi/surge_api/models/blast_create_params.rbi +145 -0
- data/rbi/surge_api/models/call_ended_webhook_event.rbi +205 -0
- data/rbi/surge_api/models/campaign.rbi +331 -0
- data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +149 -0
- data/rbi/surge_api/models/campaign_create_params.rbi +386 -0
- data/rbi/surge_api/models/contact.rbi +88 -0
- data/rbi/surge_api/models/contact_create_params.rbi +87 -0
- data/rbi/surge_api/models/contact_retrieve_params.rbi +27 -0
- data/rbi/surge_api/models/contact_update_params.rbi +87 -0
- data/rbi/surge_api/models/conversation_created_webhook_event.rbi +129 -0
- data/rbi/surge_api/models/error.rbi +51 -0
- data/rbi/surge_api/models/message.rbi +283 -0
- data/rbi/surge_api/models/message_create_params.rbi +281 -0
- data/rbi/surge_api/models/message_delivered_webhook_event.rbi +331 -0
- data/rbi/surge_api/models/message_failed_webhook_event.rbi +335 -0
- data/rbi/surge_api/models/message_received_webhook_event.rbi +331 -0
- data/rbi/surge_api/models/message_sent_webhook_event.rbi +322 -0
- data/rbi/surge_api/models/organization.rbi +649 -0
- data/rbi/surge_api/models/phone_number.rbi +72 -0
- data/rbi/surge_api/models/phone_number_purchase_params.rbi +122 -0
- data/rbi/surge_api/models/unwrap_webhook_event.rbi +26 -0
- data/rbi/surge_api/models/user.rbi +80 -0
- data/rbi/surge_api/models/user_create_params.rbi +76 -0
- data/rbi/surge_api/models/user_create_token_params.rbi +46 -0
- data/rbi/surge_api/models/user_retrieve_params.rbi +27 -0
- data/rbi/surge_api/models/user_token_response.rbi +31 -0
- data/rbi/surge_api/models/user_update_params.rbi +76 -0
- data/rbi/surge_api/models/verification.rbi +86 -0
- data/rbi/surge_api/models/verification_check.rbi +84 -0
- data/rbi/surge_api/models/verification_check_params.rbi +40 -0
- data/rbi/surge_api/models/verification_create_params.rbi +40 -0
- data/rbi/surge_api/models/webhook_unwrap_params.rbi +27 -0
- data/rbi/surge_api/models.rbi +80 -0
- data/rbi/surge_api/request_options.rbi +59 -0
- data/rbi/surge_api/resources/accounts.rbi +94 -0
- data/rbi/surge_api/resources/blasts.rbi +48 -0
- data/rbi/surge_api/resources/campaigns.rbi +115 -0
- data/rbi/surge_api/resources/contacts.rbi +85 -0
- data/rbi/surge_api/resources/messages.rbi +72 -0
- data/rbi/surge_api/resources/phone_numbers.rbi +43 -0
- data/rbi/surge_api/resources/users.rbi +96 -0
- data/rbi/surge_api/resources/verifications.rbi +43 -0
- data/rbi/surge_api/resources/webhooks.rbi +31 -0
- data/rbi/surge_api/version.rbi +5 -0
- data/sig/surge_api/client.rbs +42 -0
- data/sig/surge_api/errors.rbs +117 -0
- data/sig/surge_api/file_part.rbs +21 -0
- data/sig/surge_api/internal/transport/base_client.rbs +131 -0
- data/sig/surge_api/internal/transport/pooled_net_requester.rbs +45 -0
- data/sig/surge_api/internal/type/array_of.rbs +48 -0
- data/sig/surge_api/internal/type/base_model.rbs +102 -0
- data/sig/surge_api/internal/type/base_page.rbs +24 -0
- data/sig/surge_api/internal/type/boolean.rbs +26 -0
- data/sig/surge_api/internal/type/converter.rbs +79 -0
- data/sig/surge_api/internal/type/enum.rbs +32 -0
- data/sig/surge_api/internal/type/file_input.rbs +25 -0
- data/sig/surge_api/internal/type/hash_of.rbs +48 -0
- data/sig/surge_api/internal/type/request_parameters.rbs +17 -0
- data/sig/surge_api/internal/type/union.rbs +52 -0
- data/sig/surge_api/internal/type/unknown.rbs +26 -0
- data/sig/surge_api/internal/util.rbs +185 -0
- data/sig/surge_api/internal.rbs +9 -0
- data/sig/surge_api/models/account.rbs +40 -0
- data/sig/surge_api/models/account_create_params.rbs +433 -0
- data/sig/surge_api/models/account_retrieve_status_params.rbs +40 -0
- data/sig/surge_api/models/account_status.rbs +71 -0
- data/sig/surge_api/models/account_update_params.rbs +435 -0
- data/sig/surge_api/models/blast.rbs +64 -0
- data/sig/surge_api/models/blast_create_params.rbs +82 -0
- data/sig/surge_api/models/call_ended_webhook_event.rbs +99 -0
- data/sig/surge_api/models/campaign.rbs +122 -0
- data/sig/surge_api/models/campaign_approved_webhook_event.rbs +67 -0
- data/sig/surge_api/models/campaign_create_params.rbs +127 -0
- data/sig/surge_api/models/contact.rbs +53 -0
- data/sig/surge_api/models/contact_create_params.rbs +54 -0
- data/sig/surge_api/models/contact_retrieve_params.rbs +15 -0
- data/sig/surge_api/models/contact_update_params.rbs +54 -0
- data/sig/surge_api/models/conversation_created_webhook_event.rbs +62 -0
- data/sig/surge_api/models/error.rbs +27 -0
- data/sig/surge_api/models/message.rbs +138 -0
- data/sig/surge_api/models/message_create_params.rbs +140 -0
- data/sig/surge_api/models/message_delivered_webhook_event.rbs +143 -0
- data/sig/surge_api/models/message_failed_webhook_event.rbs +148 -0
- data/sig/surge_api/models/message_received_webhook_event.rbs +143 -0
- data/sig/surge_api/models/message_sent_webhook_event.rbs +143 -0
- data/sig/surge_api/models/organization.rbs +385 -0
- data/sig/surge_api/models/phone_number.rbs +37 -0
- data/sig/surge_api/models/phone_number_purchase_params.rbs +62 -0
- data/sig/surge_api/models/unwrap_webhook_event.rbs +18 -0
- data/sig/surge_api/models/user.rbs +48 -0
- data/sig/surge_api/models/user_create_params.rbs +47 -0
- data/sig/surge_api/models/user_create_token_params.rbs +26 -0
- data/sig/surge_api/models/user_retrieve_params.rbs +15 -0
- data/sig/surge_api/models/user_token_response.rbs +15 -0
- data/sig/surge_api/models/user_update_params.rbs +47 -0
- data/sig/surge_api/models/verification.rbs +48 -0
- data/sig/surge_api/models/verification_check.rbs +45 -0
- data/sig/surge_api/models/verification_check_params.rbs +23 -0
- data/sig/surge_api/models/verification_create_params.rbs +23 -0
- data/sig/surge_api/models/webhook_unwrap_params.rbs +15 -0
- data/sig/surge_api/models.rbs +77 -0
- data/sig/surge_api/request_options.rbs +34 -0
- data/sig/surge_api/resources/accounts.rbs +30 -0
- data/sig/surge_api/resources/blasts.rbs +19 -0
- data/sig/surge_api/resources/campaigns.rbs +21 -0
- data/sig/surge_api/resources/contacts.rbs +32 -0
- data/sig/surge_api/resources/messages.rbs +18 -0
- data/sig/surge_api/resources/phone_numbers.rbs +16 -0
- data/sig/surge_api/resources/users.rbs +36 -0
- data/sig/surge_api/resources/verifications.rbs +18 -0
- data/sig/surge_api/resources/webhooks.rbs +17 -0
- data/sig/surge_api/version.rbs +3 -0
- metadata +269 -0
@@ -0,0 +1,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
|