surge_api 0.14.0 → 0.16.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 +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +1 -1
- data/lib/surge_api/client.rb +4 -0
- data/lib/surge_api/models/attachment_get_file_params.rb +14 -0
- data/lib/surge_api/models/attachment_get_file_response.rb +19 -0
- data/lib/surge_api/models/audience_create_params.rb +22 -0
- data/lib/surge_api/models/audience_create_response.rb +27 -0
- data/lib/surge_api/models/campaign_params.rb +12 -12
- data/lib/surge_api/models/campaign_update_params.rb +26 -0
- data/lib/surge_api/models/link_followed_webhook_event.rb +15 -5
- data/lib/surge_api/models/message.rb +9 -1
- data/lib/surge_api/models/phone_number.rb +9 -1
- data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +9 -1
- data/lib/surge_api/models/phone_number_purchase_params.rb +10 -1
- data/lib/surge_api/models.rb +6 -0
- data/lib/surge_api/resources/attachments.rb +35 -0
- data/lib/surge_api/resources/audiences.rb +24 -0
- data/lib/surge_api/resources/campaigns.rb +35 -0
- data/lib/surge_api/resources/phone_numbers.rb +3 -1
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +6 -0
- data/rbi/surge_api/client.rbi +3 -0
- data/rbi/surge_api/models/attachment_get_file_params.rbi +27 -0
- data/rbi/surge_api/models/attachment_get_file_response.rbi +34 -0
- data/rbi/surge_api/models/audience_create_params.rbi +40 -0
- data/rbi/surge_api/models/audience_create_response.rbi +37 -0
- data/rbi/surge_api/models/campaign_params.rbi +17 -20
- data/rbi/surge_api/models/campaign_update_params.rbi +60 -0
- data/rbi/surge_api/models/link_followed_webhook_event.rbi +26 -7
- data/rbi/surge_api/models/message.rbi +8 -0
- data/rbi/surge_api/models/phone_number.rbi +8 -0
- data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +8 -0
- data/rbi/surge_api/models/phone_number_purchase_params.rbi +13 -0
- data/rbi/surge_api/models.rbi +6 -0
- data/rbi/surge_api/resources/attachments.rbi +27 -0
- data/rbi/surge_api/resources/audiences.rbi +17 -0
- data/rbi/surge_api/resources/campaigns.rbi +21 -0
- data/rbi/surge_api/resources/phone_numbers.rbi +4 -0
- data/sig/surge_api/client.rbs +2 -0
- data/sig/surge_api/models/attachment_get_file_params.rbs +15 -0
- data/sig/surge_api/models/attachment_get_file_response.rbs +13 -0
- data/sig/surge_api/models/audience_create_params.rbs +23 -0
- data/sig/surge_api/models/audience_create_response.rbs +15 -0
- data/sig/surge_api/models/campaign_params.rbs +8 -10
- data/sig/surge_api/models/campaign_update_params.rbs +28 -0
- data/sig/surge_api/models/link_followed_webhook_event.rbs +22 -4
- data/sig/surge_api/models/message.rbs +5 -0
- data/sig/surge_api/models/phone_number.rbs +5 -0
- data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +5 -0
- data/sig/surge_api/models/phone_number_purchase_params.rbs +7 -0
- data/sig/surge_api/models.rbs +6 -0
- data/sig/surge_api/resources/attachments.rbs +12 -0
- data/sig/surge_api/resources/audiences.rbs +6 -0
- data/sig/surge_api/resources/campaigns.rbs +6 -0
- data/sig/surge_api/resources/phone_numbers.rbs +1 -0
- metadata +20 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class AudienceCreateParams < 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::AudienceCreateParams, SurgeAPI::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The audience name.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :name
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
name: String,
|
|
21
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
22
|
+
).returns(T.attached_class)
|
|
23
|
+
end
|
|
24
|
+
def self.new(
|
|
25
|
+
# The audience name.
|
|
26
|
+
name:,
|
|
27
|
+
request_options: {}
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
override.returns(
|
|
33
|
+
{ name: String, request_options: SurgeAPI::RequestOptions }
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
def to_hash
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class AudienceCreateResponse < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
SurgeAPI::Models::AudienceCreateResponse,
|
|
10
|
+
SurgeAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Unique identifier for the object.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# A name to identify this Audience. This name will only be visible within Surge.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# A group of contacts used for targeting messages.
|
|
23
|
+
sig { params(id: String, name: String).returns(T.attached_class) }
|
|
24
|
+
def self.new(
|
|
25
|
+
# Unique identifier for the object.
|
|
26
|
+
id:,
|
|
27
|
+
# A name to identify this Audience. This name will only be visible within Surge.
|
|
28
|
+
name:
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
sig { override.returns({ id: String, name: String }) }
|
|
33
|
+
def to_hash
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -52,6 +52,13 @@ module SurgeAPI
|
|
|
52
52
|
sig { returns(String) }
|
|
53
53
|
attr_accessor :privacy_policy_url
|
|
54
54
|
|
|
55
|
+
# The URL of the terms and conditions presented to end users when they opt in to
|
|
56
|
+
# messaging. These terms and conditions may be shared among all of a platform's
|
|
57
|
+
# customers if they're the terms that are presented to end users when they opt in
|
|
58
|
+
# to messaging.
|
|
59
|
+
sig { returns(String) }
|
|
60
|
+
attr_accessor :terms_and_conditions_url
|
|
61
|
+
|
|
55
62
|
# A list containing 1-5 types of messages that will be sent with this campaign.
|
|
56
63
|
#
|
|
57
64
|
# The following use cases are typically available to all brands:
|
|
@@ -145,16 +152,6 @@ module SurgeAPI
|
|
|
145
152
|
sig { params(link_sample: String).void }
|
|
146
153
|
attr_writer :link_sample
|
|
147
154
|
|
|
148
|
-
# The URL of the terms and conditions presented to end users when they opt in to
|
|
149
|
-
# messaging. These terms and conditions may be shared among all of a platform's
|
|
150
|
-
# customers if they're the terms that are presented to end users when they opt in
|
|
151
|
-
# to messaging.
|
|
152
|
-
sig { returns(T.nilable(String)) }
|
|
153
|
-
attr_reader :terms_and_conditions_url
|
|
154
|
-
|
|
155
|
-
sig { params(terms_and_conditions_url: String).void }
|
|
156
|
-
attr_writer :terms_and_conditions_url
|
|
157
|
-
|
|
158
155
|
# Full campaign details for standard registration through Surge
|
|
159
156
|
sig do
|
|
160
157
|
params(
|
|
@@ -162,6 +159,7 @@ module SurgeAPI
|
|
|
162
159
|
description: String,
|
|
163
160
|
message_samples: T::Array[String],
|
|
164
161
|
privacy_policy_url: String,
|
|
162
|
+
terms_and_conditions_url: String,
|
|
165
163
|
use_cases:
|
|
166
164
|
T::Array[
|
|
167
165
|
SurgeAPI::CampaignParams::StandardCampaignParams::UseCase::OrSymbol
|
|
@@ -172,8 +170,7 @@ module SurgeAPI
|
|
|
172
170
|
T::Array[
|
|
173
171
|
SurgeAPI::CampaignParams::StandardCampaignParams::Include::OrSymbol
|
|
174
172
|
],
|
|
175
|
-
link_sample: String
|
|
176
|
-
terms_and_conditions_url: String
|
|
173
|
+
link_sample: String
|
|
177
174
|
).returns(T.attached_class)
|
|
178
175
|
end
|
|
179
176
|
def self.new(
|
|
@@ -197,6 +194,11 @@ module SurgeAPI
|
|
|
197
194
|
# privacy policy if it's the policy that is displayed to end users when they opt
|
|
198
195
|
# in to messaging.
|
|
199
196
|
privacy_policy_url:,
|
|
197
|
+
# The URL of the terms and conditions presented to end users when they opt in to
|
|
198
|
+
# messaging. These terms and conditions may be shared among all of a platform's
|
|
199
|
+
# customers if they're the terms that are presented to end users when they opt in
|
|
200
|
+
# to messaging.
|
|
201
|
+
terms_and_conditions_url:,
|
|
200
202
|
# A list containing 1-5 types of messages that will be sent with this campaign.
|
|
201
203
|
#
|
|
202
204
|
# The following use cases are typically available to all brands:
|
|
@@ -250,12 +252,7 @@ module SurgeAPI
|
|
|
250
252
|
# carriers. If link shortening is enabled for the account, the link shortener URL
|
|
251
253
|
# will be used instead of what is provided. Reach out to support if you would like
|
|
252
254
|
# to disable automatic link shortening.
|
|
253
|
-
link_sample: nil
|
|
254
|
-
# The URL of the terms and conditions presented to end users when they opt in to
|
|
255
|
-
# messaging. These terms and conditions may be shared among all of a platform's
|
|
256
|
-
# customers if they're the terms that are presented to end users when they opt in
|
|
257
|
-
# to messaging.
|
|
258
|
-
terms_and_conditions_url: nil
|
|
255
|
+
link_sample: nil
|
|
259
256
|
)
|
|
260
257
|
end
|
|
261
258
|
|
|
@@ -266,6 +263,7 @@ module SurgeAPI
|
|
|
266
263
|
description: String,
|
|
267
264
|
message_samples: T::Array[String],
|
|
268
265
|
privacy_policy_url: String,
|
|
266
|
+
terms_and_conditions_url: String,
|
|
269
267
|
use_cases:
|
|
270
268
|
T::Array[
|
|
271
269
|
SurgeAPI::CampaignParams::StandardCampaignParams::UseCase::OrSymbol
|
|
@@ -276,8 +274,7 @@ module SurgeAPI
|
|
|
276
274
|
T::Array[
|
|
277
275
|
SurgeAPI::CampaignParams::StandardCampaignParams::Include::OrSymbol
|
|
278
276
|
],
|
|
279
|
-
link_sample: String
|
|
280
|
-
terms_and_conditions_url: String
|
|
277
|
+
link_sample: String
|
|
281
278
|
}
|
|
282
279
|
)
|
|
283
280
|
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
class CampaignUpdateParams < 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::CampaignUpdateParams, SurgeAPI::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Parameters for creating a new campaign. Either provide full campaign details or
|
|
15
|
+
# import using a TCR ID.
|
|
16
|
+
sig do
|
|
17
|
+
returns(
|
|
18
|
+
T.any(
|
|
19
|
+
SurgeAPI::CampaignParams::StandardCampaignParams,
|
|
20
|
+
SurgeAPI::CampaignParams::ExternalCampaignParams
|
|
21
|
+
)
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
attr_accessor :campaign_params
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
params(
|
|
28
|
+
campaign_params:
|
|
29
|
+
T.any(
|
|
30
|
+
SurgeAPI::CampaignParams::StandardCampaignParams::OrHash,
|
|
31
|
+
SurgeAPI::CampaignParams::ExternalCampaignParams::OrHash
|
|
32
|
+
),
|
|
33
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
34
|
+
).returns(T.attached_class)
|
|
35
|
+
end
|
|
36
|
+
def self.new(
|
|
37
|
+
# Parameters for creating a new campaign. Either provide full campaign details or
|
|
38
|
+
# import using a TCR ID.
|
|
39
|
+
campaign_params:,
|
|
40
|
+
request_options: {}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
override.returns(
|
|
46
|
+
{
|
|
47
|
+
campaign_params:
|
|
48
|
+
T.any(
|
|
49
|
+
SurgeAPI::CampaignParams::StandardCampaignParams,
|
|
50
|
+
SurgeAPI::CampaignParams::ExternalCampaignParams
|
|
51
|
+
),
|
|
52
|
+
request_options: SurgeAPI::RequestOptions
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
def to_hash
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -75,8 +75,15 @@ module SurgeAPI
|
|
|
75
75
|
sig { returns(String) }
|
|
76
76
|
attr_accessor :id
|
|
77
77
|
|
|
78
|
-
#
|
|
79
|
-
sig { returns(
|
|
78
|
+
# A Message is a communication sent to a Contact.
|
|
79
|
+
sig { returns(T.nilable(SurgeAPI::Message)) }
|
|
80
|
+
attr_reader :message
|
|
81
|
+
|
|
82
|
+
sig { params(message: T.nilable(SurgeAPI::Message::OrHash)).void }
|
|
83
|
+
attr_writer :message
|
|
84
|
+
|
|
85
|
+
# Deprecated. The unique identifier for the message that contained the link.
|
|
86
|
+
sig { returns(T.nilable(String)) }
|
|
80
87
|
attr_accessor :message_id
|
|
81
88
|
|
|
82
89
|
# The original URL that was shortened
|
|
@@ -85,14 +92,19 @@ module SurgeAPI
|
|
|
85
92
|
|
|
86
93
|
# The data associated with the event
|
|
87
94
|
sig do
|
|
88
|
-
params(
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
params(
|
|
96
|
+
id: String,
|
|
97
|
+
message: T.nilable(SurgeAPI::Message::OrHash),
|
|
98
|
+
message_id: T.nilable(String),
|
|
99
|
+
url: String
|
|
100
|
+
).returns(T.attached_class)
|
|
91
101
|
end
|
|
92
102
|
def self.new(
|
|
93
103
|
# The unique identifier for the link
|
|
94
104
|
id:,
|
|
95
|
-
#
|
|
105
|
+
# A Message is a communication sent to a Contact.
|
|
106
|
+
message:,
|
|
107
|
+
# Deprecated. The unique identifier for the message that contained the link.
|
|
96
108
|
message_id:,
|
|
97
109
|
# The original URL that was shortened
|
|
98
110
|
url:
|
|
@@ -100,7 +112,14 @@ module SurgeAPI
|
|
|
100
112
|
end
|
|
101
113
|
|
|
102
114
|
sig do
|
|
103
|
-
override.returns(
|
|
115
|
+
override.returns(
|
|
116
|
+
{
|
|
117
|
+
id: String,
|
|
118
|
+
message: T.nilable(SurgeAPI::Message),
|
|
119
|
+
message_id: T.nilable(String),
|
|
120
|
+
url: String
|
|
121
|
+
}
|
|
122
|
+
)
|
|
104
123
|
end
|
|
105
124
|
def to_hash
|
|
106
125
|
end
|
|
@@ -243,6 +243,10 @@ module SurgeAPI
|
|
|
243
243
|
sig { returns(String) }
|
|
244
244
|
attr_accessor :id
|
|
245
245
|
|
|
246
|
+
# A human-readable name for the phone number
|
|
247
|
+
sig { returns(T.nilable(String)) }
|
|
248
|
+
attr_accessor :name
|
|
249
|
+
|
|
246
250
|
# The canonical format of the phone number.
|
|
247
251
|
sig { returns(String) }
|
|
248
252
|
attr_accessor :number
|
|
@@ -259,6 +263,7 @@ module SurgeAPI
|
|
|
259
263
|
sig do
|
|
260
264
|
params(
|
|
261
265
|
id: String,
|
|
266
|
+
name: T.nilable(String),
|
|
262
267
|
number: String,
|
|
263
268
|
type: SurgeAPI::Message::Conversation::PhoneNumber::Type::OrSymbol
|
|
264
269
|
).returns(T.attached_class)
|
|
@@ -266,6 +271,8 @@ module SurgeAPI
|
|
|
266
271
|
def self.new(
|
|
267
272
|
# Unique identifier for the phone number
|
|
268
273
|
id:,
|
|
274
|
+
# A human-readable name for the phone number
|
|
275
|
+
name:,
|
|
269
276
|
# The canonical format of the phone number.
|
|
270
277
|
number:,
|
|
271
278
|
# Whether the phone number is local, toll-free, or short code
|
|
@@ -277,6 +284,7 @@ module SurgeAPI
|
|
|
277
284
|
override.returns(
|
|
278
285
|
{
|
|
279
286
|
id: String,
|
|
287
|
+
name: T.nilable(String),
|
|
280
288
|
number: String,
|
|
281
289
|
type:
|
|
282
290
|
SurgeAPI::Message::Conversation::PhoneNumber::Type::TaggedSymbol
|
|
@@ -16,6 +16,10 @@ module SurgeAPI
|
|
|
16
16
|
sig { returns(T.nilable(String)) }
|
|
17
17
|
attr_accessor :campaign_id
|
|
18
18
|
|
|
19
|
+
# A human-readable name for the phone number
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
19
23
|
# The phone number in E.164 format
|
|
20
24
|
sig { returns(String) }
|
|
21
25
|
attr_accessor :number
|
|
@@ -29,6 +33,7 @@ module SurgeAPI
|
|
|
29
33
|
params(
|
|
30
34
|
id: String,
|
|
31
35
|
campaign_id: T.nilable(String),
|
|
36
|
+
name: T.nilable(String),
|
|
32
37
|
number: String,
|
|
33
38
|
type: SurgeAPI::PhoneNumber::Type::OrSymbol
|
|
34
39
|
).returns(T.attached_class)
|
|
@@ -38,6 +43,8 @@ module SurgeAPI
|
|
|
38
43
|
id:,
|
|
39
44
|
# The unique identifier of the campaign this phone number is attached to, if any
|
|
40
45
|
campaign_id:,
|
|
46
|
+
# A human-readable name for the phone number
|
|
47
|
+
name:,
|
|
41
48
|
# The phone number in E.164 format
|
|
42
49
|
number:,
|
|
43
50
|
# Whether the phone number is local, toll-free, or short code
|
|
@@ -50,6 +57,7 @@ module SurgeAPI
|
|
|
50
57
|
{
|
|
51
58
|
id: String,
|
|
52
59
|
campaign_id: T.nilable(String),
|
|
60
|
+
name: T.nilable(String),
|
|
53
61
|
number: String,
|
|
54
62
|
type: SurgeAPI::PhoneNumber::Type::TaggedSymbol
|
|
55
63
|
}
|
|
@@ -88,6 +88,10 @@ module SurgeAPI
|
|
|
88
88
|
sig { returns(String) }
|
|
89
89
|
attr_accessor :campaign_id
|
|
90
90
|
|
|
91
|
+
# A human-readable name for the phone number
|
|
92
|
+
sig { returns(T.nilable(String)) }
|
|
93
|
+
attr_accessor :name
|
|
94
|
+
|
|
91
95
|
# The phone number in E.164 format
|
|
92
96
|
sig { returns(String) }
|
|
93
97
|
attr_accessor :number
|
|
@@ -105,6 +109,7 @@ module SurgeAPI
|
|
|
105
109
|
params(
|
|
106
110
|
id: String,
|
|
107
111
|
campaign_id: String,
|
|
112
|
+
name: T.nilable(String),
|
|
108
113
|
number: String,
|
|
109
114
|
type:
|
|
110
115
|
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::OrSymbol
|
|
@@ -115,6 +120,8 @@ module SurgeAPI
|
|
|
115
120
|
id:,
|
|
116
121
|
# The unique identifier of the campaign this phone number is attached to
|
|
117
122
|
campaign_id:,
|
|
123
|
+
# A human-readable name for the phone number
|
|
124
|
+
name:,
|
|
118
125
|
# The phone number in E.164 format
|
|
119
126
|
number:,
|
|
120
127
|
# Whether the phone number is local, toll-free, or short code
|
|
@@ -127,6 +134,7 @@ module SurgeAPI
|
|
|
127
134
|
{
|
|
128
135
|
id: String,
|
|
129
136
|
campaign_id: String,
|
|
137
|
+
name: T.nilable(String),
|
|
130
138
|
number: String,
|
|
131
139
|
type:
|
|
132
140
|
SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type::TaggedSymbol
|
|
@@ -38,6 +38,14 @@ module SurgeAPI
|
|
|
38
38
|
sig { params(longitude: Float).void }
|
|
39
39
|
attr_writer :longitude
|
|
40
40
|
|
|
41
|
+
# A human-readable name for the phone number. If not provided, defaults to the
|
|
42
|
+
# formatted phone number.
|
|
43
|
+
sig { returns(T.nilable(String)) }
|
|
44
|
+
attr_reader :name
|
|
45
|
+
|
|
46
|
+
sig { params(name: String).void }
|
|
47
|
+
attr_writer :name
|
|
48
|
+
|
|
41
49
|
# Whether the phone number is local or toll-free. Can be omitted if area_code or
|
|
42
50
|
# latitude/longitude are provided.
|
|
43
51
|
sig do
|
|
@@ -55,6 +63,7 @@ module SurgeAPI
|
|
|
55
63
|
area_code: String,
|
|
56
64
|
latitude: Float,
|
|
57
65
|
longitude: Float,
|
|
66
|
+
name: String,
|
|
58
67
|
type: SurgeAPI::PhoneNumberPurchaseParams::Type::OrSymbol,
|
|
59
68
|
request_options: SurgeAPI::RequestOptions::OrHash
|
|
60
69
|
).returns(T.attached_class)
|
|
@@ -69,6 +78,9 @@ module SurgeAPI
|
|
|
69
78
|
# Longitude to search for nearby phone numbers. Must be used with latitude. If
|
|
70
79
|
# provided without type, type will be inferred as 'local'.
|
|
71
80
|
longitude: nil,
|
|
81
|
+
# A human-readable name for the phone number. If not provided, defaults to the
|
|
82
|
+
# formatted phone number.
|
|
83
|
+
name: nil,
|
|
72
84
|
# Whether the phone number is local or toll-free. Can be omitted if area_code or
|
|
73
85
|
# latitude/longitude are provided.
|
|
74
86
|
type: nil,
|
|
@@ -82,6 +94,7 @@ module SurgeAPI
|
|
|
82
94
|
area_code: String,
|
|
83
95
|
latitude: Float,
|
|
84
96
|
longitude: Float,
|
|
97
|
+
name: String,
|
|
85
98
|
type: SurgeAPI::PhoneNumberPurchaseParams::Type::OrSymbol,
|
|
86
99
|
request_options: SurgeAPI::RequestOptions
|
|
87
100
|
}
|
data/rbi/surge_api/models.rbi
CHANGED
|
@@ -13,8 +13,12 @@ module SurgeAPI
|
|
|
13
13
|
|
|
14
14
|
AccountUpdateParams = SurgeAPI::Models::AccountUpdateParams
|
|
15
15
|
|
|
16
|
+
AttachmentGetFileParams = SurgeAPI::Models::AttachmentGetFileParams
|
|
17
|
+
|
|
16
18
|
AudienceAddContactParams = SurgeAPI::Models::AudienceAddContactParams
|
|
17
19
|
|
|
20
|
+
AudienceCreateParams = SurgeAPI::Models::AudienceCreateParams
|
|
21
|
+
|
|
18
22
|
AudienceListContactsParams = SurgeAPI::Models::AudienceListContactsParams
|
|
19
23
|
|
|
20
24
|
Blast = SurgeAPI::Models::Blast
|
|
@@ -35,6 +39,8 @@ module SurgeAPI
|
|
|
35
39
|
|
|
36
40
|
CampaignRetrieveParams = SurgeAPI::Models::CampaignRetrieveParams
|
|
37
41
|
|
|
42
|
+
CampaignUpdateParams = SurgeAPI::Models::CampaignUpdateParams
|
|
43
|
+
|
|
38
44
|
Contact = SurgeAPI::Models::Contact
|
|
39
45
|
|
|
40
46
|
ContactCreateParams = SurgeAPI::Models::ContactCreateParams
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Attachments
|
|
6
|
+
# Redirects to a signed URL where the attachment file can be downloaded. URL is
|
|
7
|
+
# short-lived, so redirect should be followed immediately.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
attachment_id: String,
|
|
11
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
12
|
+
).returns(SurgeAPI::Models::AttachmentGetFileResponse)
|
|
13
|
+
end
|
|
14
|
+
def get_file(
|
|
15
|
+
# The ID of the attachment.
|
|
16
|
+
attachment_id,
|
|
17
|
+
request_options: {}
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @api private
|
|
22
|
+
sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
|
|
23
|
+
def self.new(client:)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
module SurgeAPI
|
|
4
4
|
module Resources
|
|
5
5
|
class Audiences
|
|
6
|
+
# Creates a new audience.
|
|
7
|
+
sig do
|
|
8
|
+
params(
|
|
9
|
+
account_id: String,
|
|
10
|
+
name: String,
|
|
11
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
12
|
+
).returns(SurgeAPI::Models::AudienceCreateResponse)
|
|
13
|
+
end
|
|
14
|
+
def create(
|
|
15
|
+
# The account for which the audience should be created.
|
|
16
|
+
account_id,
|
|
17
|
+
# The audience name.
|
|
18
|
+
name:,
|
|
19
|
+
request_options: {}
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
6
23
|
# Adds an existing contact to a manual audience.
|
|
7
24
|
sig do
|
|
8
25
|
params(
|
|
@@ -35,6 +35,27 @@ module SurgeAPI
|
|
|
35
35
|
)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
# Updates a campaign that has not yet been approved. This can be used to fix
|
|
39
|
+
# issues flagged during review and resubmit the campaign. Returns an error if the
|
|
40
|
+
# campaign is currently in review, has already been approved, or has been
|
|
41
|
+
# deactivated.
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
id: String,
|
|
45
|
+
campaign_params: SurgeAPI::CampaignParams,
|
|
46
|
+
request_options: SurgeAPI::RequestOptions::OrHash
|
|
47
|
+
).returns(SurgeAPI::Campaign)
|
|
48
|
+
end
|
|
49
|
+
def update(
|
|
50
|
+
# The ID of the campaign to update.
|
|
51
|
+
id,
|
|
52
|
+
# Parameters for creating a new campaign. Either provide full campaign details or
|
|
53
|
+
# import using a TCR ID.
|
|
54
|
+
campaign_params:,
|
|
55
|
+
request_options: {}
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
38
59
|
# List all campaigns for an account with cursor-based pagination.
|
|
39
60
|
sig do
|
|
40
61
|
params(
|
|
@@ -32,6 +32,7 @@ module SurgeAPI
|
|
|
32
32
|
area_code: String,
|
|
33
33
|
latitude: Float,
|
|
34
34
|
longitude: Float,
|
|
35
|
+
name: String,
|
|
35
36
|
type: SurgeAPI::PhoneNumberPurchaseParams::Type::OrSymbol,
|
|
36
37
|
request_options: SurgeAPI::RequestOptions::OrHash
|
|
37
38
|
).returns(SurgeAPI::PhoneNumber)
|
|
@@ -48,6 +49,9 @@ module SurgeAPI
|
|
|
48
49
|
# Longitude to search for nearby phone numbers. Must be used with latitude. If
|
|
49
50
|
# provided without type, type will be inferred as 'local'.
|
|
50
51
|
longitude: nil,
|
|
52
|
+
# A human-readable name for the phone number. If not provided, defaults to the
|
|
53
|
+
# formatted phone number.
|
|
54
|
+
name: nil,
|
|
51
55
|
# Whether the phone number is local or toll-free. Can be omitted if area_code or
|
|
52
56
|
# latitude/longitude are provided.
|
|
53
57
|
type: nil,
|
data/sig/surge_api/client.rbs
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type attachment_get_file_params =
|
|
4
|
+
{ } & SurgeAPI::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class AttachmentGetFileParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
def initialize: (?request_options: SurgeAPI::request_opts) -> void
|
|
11
|
+
|
|
12
|
+
def to_hash: -> { request_options: SurgeAPI::RequestOptions }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type attachment_get_file_response = { error: SurgeAPI::Error }
|
|
4
|
+
|
|
5
|
+
class AttachmentGetFileResponse < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
attr_accessor error: SurgeAPI::Error
|
|
7
|
+
|
|
8
|
+
def initialize: (error: SurgeAPI::Error) -> void
|
|
9
|
+
|
|
10
|
+
def to_hash: -> { error: SurgeAPI::Error }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type audience_create_params =
|
|
4
|
+
{ name: String } & SurgeAPI::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class AudienceCreateParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
attr_accessor name: String
|
|
11
|
+
|
|
12
|
+
def initialize: (
|
|
13
|
+
name: String,
|
|
14
|
+
?request_options: SurgeAPI::request_opts
|
|
15
|
+
) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> {
|
|
18
|
+
name: String,
|
|
19
|
+
request_options: SurgeAPI::RequestOptions
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type audience_create_response = { id: String, name: String }
|
|
4
|
+
|
|
5
|
+
class AudienceCreateResponse < SurgeAPI::Internal::Type::BaseModel
|
|
6
|
+
attr_accessor id: String
|
|
7
|
+
|
|
8
|
+
attr_accessor name: String
|
|
9
|
+
|
|
10
|
+
def initialize: (id: String, name: String) -> void
|
|
11
|
+
|
|
12
|
+
def to_hash: -> { id: String, name: String }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|