surge_api 0.14.0 → 0.15.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 +10 -0
- data/README.md +1 -1
- 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.rb +4 -0
- data/lib/surge_api/resources/audiences.rb +24 -0
- data/lib/surge_api/resources/campaigns.rb +35 -0
- data/lib/surge_api/version.rb +1 -1
- data/lib/surge_api.rb +3 -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.rbi +4 -0
- data/rbi/surge_api/resources/audiences.rbi +17 -0
- data/rbi/surge_api/resources/campaigns.rbi +21 -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.rbs +4 -0
- data/sig/surge_api/resources/audiences.rbs +6 -0
- data/sig/surge_api/resources/campaigns.rbs +6 -0
- metadata +11 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 614370dfa43aa94b2c07f29576b6e5859d11010ede1baa50269ff5d2d1ceccc9
|
|
4
|
+
data.tar.gz: a1717cedfe90b25cb8ad1c6fc529bd89ed6bead53039a37c0c1d99883fae1b42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 139587949698301477b68cb7a99f4b3367bc9575369ba153bb318f94dc488120348fb19a0ec2d566fd0407ddada88cddbfbf8ad1ac26640685e052408e29b6c4
|
|
7
|
+
data.tar.gz: 53b59055a002e7720fe165241c3ef0df906657d900dcb729da9be4a06e93a947a407eb7d73816a4aa76dac178e885f321f9528169e39f9ec719e4ab60fa27da1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.0 (2026-04-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.14.0...v0.15.0](https://github.com/surgeapi/ruby-sdk/compare/v0.14.0...v0.15.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** create an audience ([817fd30](https://github.com/surgeapi/ruby-sdk/commit/817fd3063e6346d452062fb720b42495f030d1e9))
|
|
10
|
+
* **api:** require terms_and_conditions_url for campaigns ([859ee36](https://github.com/surgeapi/ruby-sdk/commit/859ee3658653d0c0dfee2b7d6118e4adf7cb9c46))
|
|
11
|
+
* **api:** update a campaign ([b22a5e4](https://github.com/surgeapi/ruby-sdk/commit/b22a5e438e80654d4ea05572d4e54c32594eba22))
|
|
12
|
+
|
|
3
13
|
## 0.14.0 (2026-04-01)
|
|
4
14
|
|
|
5
15
|
Full Changelog: [v0.13.0...v0.14.0](https://github.com/surgeapi/ruby-sdk/compare/v0.13.0...v0.14.0)
|
data/README.md
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Audiences#create
|
|
6
|
+
class AudienceCreateParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute name
|
|
11
|
+
# The audience name.
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :name, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(name:, request_options: {})
|
|
17
|
+
# @param name [String] The audience name.
|
|
18
|
+
#
|
|
19
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Audiences#create
|
|
6
|
+
class AudienceCreateResponse < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# Unique identifier for the object.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute name
|
|
14
|
+
# A name to identify this Audience. This name will only be visible within Surge.
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :name, String
|
|
18
|
+
|
|
19
|
+
# @!method initialize(id:, name:)
|
|
20
|
+
# A group of contacts used for targeting messages.
|
|
21
|
+
#
|
|
22
|
+
# @param id [String] Unique identifier for the object.
|
|
23
|
+
#
|
|
24
|
+
# @param name [String] A name to identify this Audience. This name will only be visible within Surge.
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -50,6 +50,15 @@ module SurgeAPI
|
|
|
50
50
|
# @return [String]
|
|
51
51
|
required :privacy_policy_url, String
|
|
52
52
|
|
|
53
|
+
# @!attribute terms_and_conditions_url
|
|
54
|
+
# The URL of the terms and conditions presented to end users when they opt in to
|
|
55
|
+
# messaging. These terms and conditions may be shared among all of a platform's
|
|
56
|
+
# customers if they're the terms that are presented to end users when they opt in
|
|
57
|
+
# to messaging.
|
|
58
|
+
#
|
|
59
|
+
# @return [String]
|
|
60
|
+
required :terms_and_conditions_url, String
|
|
61
|
+
|
|
53
62
|
# @!attribute use_cases
|
|
54
63
|
# A list containing 1-5 types of messages that will be sent with this campaign.
|
|
55
64
|
#
|
|
@@ -122,16 +131,7 @@ module SurgeAPI
|
|
|
122
131
|
# @return [String, nil]
|
|
123
132
|
optional :link_sample, String
|
|
124
133
|
|
|
125
|
-
# @!
|
|
126
|
-
# The URL of the terms and conditions presented to end users when they opt in to
|
|
127
|
-
# messaging. These terms and conditions may be shared among all of a platform's
|
|
128
|
-
# customers if they're the terms that are presented to end users when they opt in
|
|
129
|
-
# to messaging.
|
|
130
|
-
#
|
|
131
|
-
# @return [String, nil]
|
|
132
|
-
optional :terms_and_conditions_url, String
|
|
133
|
-
|
|
134
|
-
# @!method initialize(consent_flow:, description:, message_samples:, privacy_policy_url:, use_cases:, volume:, includes: nil, link_sample: nil, terms_and_conditions_url: nil)
|
|
134
|
+
# @!method initialize(consent_flow:, description:, message_samples:, privacy_policy_url:, terms_and_conditions_url:, use_cases:, volume:, includes: nil, link_sample: nil)
|
|
135
135
|
# Some parameter documentations has been truncated, see
|
|
136
136
|
# {SurgeAPI::Models::CampaignParams::StandardCampaignParams} for more details.
|
|
137
137
|
#
|
|
@@ -145,6 +145,8 @@ module SurgeAPI
|
|
|
145
145
|
#
|
|
146
146
|
# @param privacy_policy_url [String] The URL of the privacy policy for the brand in question. This may be a shared pr
|
|
147
147
|
#
|
|
148
|
+
# @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
|
|
149
|
+
#
|
|
148
150
|
# @param use_cases [Array<Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::UseCase>] A list containing 1-5 types of messages that will be sent with this campaign.
|
|
149
151
|
#
|
|
150
152
|
# @param volume [Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::Volume] This will be one of the following:
|
|
@@ -152,8 +154,6 @@ module SurgeAPI
|
|
|
152
154
|
# @param includes [Array<Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::Include>] A list of properties that this campaign should include. These properties can be
|
|
153
155
|
#
|
|
154
156
|
# @param link_sample [String] A sample link that might be sent by this campaign. If links from other domains a
|
|
155
|
-
#
|
|
156
|
-
# @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
|
|
157
157
|
|
|
158
158
|
module UseCase
|
|
159
159
|
extend SurgeAPI::Internal::Type::Enum
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SurgeAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SurgeAPI::Resources::Campaigns#update
|
|
6
|
+
class CampaignUpdateParams < SurgeAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute campaign_params
|
|
11
|
+
# Parameters for creating a new campaign. Either provide full campaign details or
|
|
12
|
+
# import using a TCR ID.
|
|
13
|
+
#
|
|
14
|
+
# @return [SurgeAPI::Models::CampaignParams::StandardCampaignParams, SurgeAPI::Models::CampaignParams::ExternalCampaignParams]
|
|
15
|
+
required :campaign_params, union: -> { SurgeAPI::CampaignParams }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(campaign_params:, request_options: {})
|
|
18
|
+
# Some parameter documentations has been truncated, see
|
|
19
|
+
# {SurgeAPI::Models::CampaignUpdateParams} for more details.
|
|
20
|
+
#
|
|
21
|
+
# @param campaign_params [SurgeAPI::Models::CampaignParams::StandardCampaignParams, SurgeAPI::Models::CampaignParams::ExternalCampaignParams] Parameters for creating a new campaign. Either provide full campaign details or
|
|
22
|
+
#
|
|
23
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/surge_api/models.rb
CHANGED
|
@@ -53,6 +53,8 @@ module SurgeAPI
|
|
|
53
53
|
|
|
54
54
|
AudienceAddContactParams = SurgeAPI::Models::AudienceAddContactParams
|
|
55
55
|
|
|
56
|
+
AudienceCreateParams = SurgeAPI::Models::AudienceCreateParams
|
|
57
|
+
|
|
56
58
|
AudienceListContactsParams = SurgeAPI::Models::AudienceListContactsParams
|
|
57
59
|
|
|
58
60
|
Blast = SurgeAPI::Models::Blast
|
|
@@ -73,6 +75,8 @@ module SurgeAPI
|
|
|
73
75
|
|
|
74
76
|
CampaignRetrieveParams = SurgeAPI::Models::CampaignRetrieveParams
|
|
75
77
|
|
|
78
|
+
CampaignUpdateParams = SurgeAPI::Models::CampaignUpdateParams
|
|
79
|
+
|
|
76
80
|
Contact = SurgeAPI::Models::Contact
|
|
77
81
|
|
|
78
82
|
ContactCreateParams = SurgeAPI::Models::ContactCreateParams
|
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
module SurgeAPI
|
|
4
4
|
module Resources
|
|
5
5
|
class Audiences
|
|
6
|
+
# Creates a new audience.
|
|
7
|
+
#
|
|
8
|
+
# @overload create(account_id, name:, request_options: {})
|
|
9
|
+
#
|
|
10
|
+
# @param account_id [String] The account for which the audience should be created.
|
|
11
|
+
#
|
|
12
|
+
# @param name [String] The audience name.
|
|
13
|
+
#
|
|
14
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
15
|
+
#
|
|
16
|
+
# @return [SurgeAPI::Models::AudienceCreateResponse]
|
|
17
|
+
#
|
|
18
|
+
# @see SurgeAPI::Models::AudienceCreateParams
|
|
19
|
+
def create(account_id, params)
|
|
20
|
+
parsed, options = SurgeAPI::AudienceCreateParams.dump_request(params)
|
|
21
|
+
@client.request(
|
|
22
|
+
method: :post,
|
|
23
|
+
path: ["accounts/%1$s/audiences", account_id],
|
|
24
|
+
body: parsed,
|
|
25
|
+
model: SurgeAPI::Models::AudienceCreateResponse,
|
|
26
|
+
options: options
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
6
30
|
# Some parameter documentations has been truncated, see
|
|
7
31
|
# {SurgeAPI::Models::AudienceAddContactParams} for more details.
|
|
8
32
|
#
|
|
@@ -55,6 +55,41 @@ module SurgeAPI
|
|
|
55
55
|
)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
# Some parameter documentations has been truncated, see
|
|
59
|
+
# {SurgeAPI::Models::CampaignUpdateParams} for more details.
|
|
60
|
+
#
|
|
61
|
+
# Updates a campaign that has not yet been approved. This can be used to fix
|
|
62
|
+
# issues flagged during review and resubmit the campaign. Returns an error if the
|
|
63
|
+
# campaign is currently in review, has already been approved, or has been
|
|
64
|
+
# deactivated.
|
|
65
|
+
#
|
|
66
|
+
# @overload update(id, campaign_params:, request_options: {})
|
|
67
|
+
#
|
|
68
|
+
# @param id [String] The ID of the campaign to update.
|
|
69
|
+
#
|
|
70
|
+
# @param campaign_params [SurgeAPI::CampaignParams] Parameters for creating a new campaign. Either provide full campaign details or
|
|
71
|
+
#
|
|
72
|
+
# @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
73
|
+
#
|
|
74
|
+
# @return [SurgeAPI::Models::Campaign]
|
|
75
|
+
#
|
|
76
|
+
# @see SurgeAPI::Models::CampaignUpdateParams
|
|
77
|
+
def update(id, params)
|
|
78
|
+
parsed, options = SurgeAPI::CampaignUpdateParams.dump_request(params)
|
|
79
|
+
case parsed
|
|
80
|
+
in {campaign_params: Hash => union, **rest}
|
|
81
|
+
parsed = {**rest, **union}
|
|
82
|
+
else
|
|
83
|
+
end
|
|
84
|
+
@client.request(
|
|
85
|
+
method: :patch,
|
|
86
|
+
path: ["campaigns/%1$s", id],
|
|
87
|
+
body: parsed,
|
|
88
|
+
model: SurgeAPI::Campaign,
|
|
89
|
+
options: options
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
58
93
|
# Some parameter documentations has been truncated, see
|
|
59
94
|
# {SurgeAPI::Models::CampaignListParams} for more details.
|
|
60
95
|
#
|
data/lib/surge_api/version.rb
CHANGED
data/lib/surge_api.rb
CHANGED
|
@@ -62,6 +62,8 @@ require_relative "surge_api/models/account_retrieve_status_params"
|
|
|
62
62
|
require_relative "surge_api/models/account_status"
|
|
63
63
|
require_relative "surge_api/models/account_update_params"
|
|
64
64
|
require_relative "surge_api/models/audience_add_contact_params"
|
|
65
|
+
require_relative "surge_api/models/audience_create_params"
|
|
66
|
+
require_relative "surge_api/models/audience_create_response"
|
|
65
67
|
require_relative "surge_api/models/audience_list_contacts_params"
|
|
66
68
|
require_relative "surge_api/models/blast"
|
|
67
69
|
require_relative "surge_api/models/blast_create_params"
|
|
@@ -71,6 +73,7 @@ require_relative "surge_api/models/campaign_approved_webhook_event"
|
|
|
71
73
|
require_relative "surge_api/models/campaign_create_params"
|
|
72
74
|
require_relative "surge_api/models/campaign_list_params"
|
|
73
75
|
require_relative "surge_api/models/campaign_retrieve_params"
|
|
76
|
+
require_relative "surge_api/models/campaign_update_params"
|
|
74
77
|
require_relative "surge_api/models/contact"
|
|
75
78
|
require_relative "surge_api/models/contact_create_params"
|
|
76
79
|
require_relative "surge_api/models/contact_list_params"
|
|
@@ -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
|
data/rbi/surge_api/models.rbi
CHANGED
|
@@ -15,6 +15,8 @@ module SurgeAPI
|
|
|
15
15
|
|
|
16
16
|
AudienceAddContactParams = SurgeAPI::Models::AudienceAddContactParams
|
|
17
17
|
|
|
18
|
+
AudienceCreateParams = SurgeAPI::Models::AudienceCreateParams
|
|
19
|
+
|
|
18
20
|
AudienceListContactsParams = SurgeAPI::Models::AudienceListContactsParams
|
|
19
21
|
|
|
20
22
|
Blast = SurgeAPI::Models::Blast
|
|
@@ -35,6 +37,8 @@ module SurgeAPI
|
|
|
35
37
|
|
|
36
38
|
CampaignRetrieveParams = SurgeAPI::Models::CampaignRetrieveParams
|
|
37
39
|
|
|
40
|
+
CampaignUpdateParams = SurgeAPI::Models::CampaignUpdateParams
|
|
41
|
+
|
|
38
42
|
Contact = SurgeAPI::Models::Contact
|
|
39
43
|
|
|
40
44
|
ContactCreateParams = SurgeAPI::Models::ContactCreateParams
|
|
@@ -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(
|
|
@@ -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
|
|
@@ -13,11 +13,11 @@ module SurgeAPI
|
|
|
13
13
|
description: String,
|
|
14
14
|
message_samples: ::Array[String],
|
|
15
15
|
privacy_policy_url: String,
|
|
16
|
+
terms_and_conditions_url: String,
|
|
16
17
|
use_cases: ::Array[SurgeAPI::Models::CampaignParams::StandardCampaignParams::use_case],
|
|
17
18
|
volume: SurgeAPI::Models::CampaignParams::StandardCampaignParams::volume,
|
|
18
19
|
includes: ::Array[SurgeAPI::Models::CampaignParams::StandardCampaignParams::include_],
|
|
19
|
-
link_sample: String
|
|
20
|
-
terms_and_conditions_url: String
|
|
20
|
+
link_sample: String
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
class StandardCampaignParams < SurgeAPI::Internal::Type::BaseModel
|
|
@@ -29,6 +29,8 @@ module SurgeAPI
|
|
|
29
29
|
|
|
30
30
|
attr_accessor privacy_policy_url: String
|
|
31
31
|
|
|
32
|
+
attr_accessor terms_and_conditions_url: String
|
|
33
|
+
|
|
32
34
|
attr_accessor use_cases: ::Array[SurgeAPI::Models::CampaignParams::StandardCampaignParams::use_case]
|
|
33
35
|
|
|
34
36
|
attr_accessor volume: SurgeAPI::Models::CampaignParams::StandardCampaignParams::volume
|
|
@@ -43,20 +45,16 @@ module SurgeAPI
|
|
|
43
45
|
|
|
44
46
|
def link_sample=: (String) -> String
|
|
45
47
|
|
|
46
|
-
attr_reader terms_and_conditions_url: String?
|
|
47
|
-
|
|
48
|
-
def terms_and_conditions_url=: (String) -> String
|
|
49
|
-
|
|
50
48
|
def initialize: (
|
|
51
49
|
consent_flow: String,
|
|
52
50
|
description: String,
|
|
53
51
|
message_samples: ::Array[String],
|
|
54
52
|
privacy_policy_url: String,
|
|
53
|
+
terms_and_conditions_url: String,
|
|
55
54
|
use_cases: ::Array[SurgeAPI::Models::CampaignParams::StandardCampaignParams::use_case],
|
|
56
55
|
volume: SurgeAPI::Models::CampaignParams::StandardCampaignParams::volume,
|
|
57
56
|
?includes: ::Array[SurgeAPI::Models::CampaignParams::StandardCampaignParams::include_],
|
|
58
|
-
?link_sample: String
|
|
59
|
-
?terms_and_conditions_url: String
|
|
57
|
+
?link_sample: String
|
|
60
58
|
) -> void
|
|
61
59
|
|
|
62
60
|
def to_hash: -> {
|
|
@@ -64,11 +62,11 @@ module SurgeAPI
|
|
|
64
62
|
description: String,
|
|
65
63
|
message_samples: ::Array[String],
|
|
66
64
|
privacy_policy_url: String,
|
|
65
|
+
terms_and_conditions_url: String,
|
|
67
66
|
use_cases: ::Array[SurgeAPI::Models::CampaignParams::StandardCampaignParams::use_case],
|
|
68
67
|
volume: SurgeAPI::Models::CampaignParams::StandardCampaignParams::volume,
|
|
69
68
|
includes: ::Array[SurgeAPI::Models::CampaignParams::StandardCampaignParams::include_],
|
|
70
|
-
link_sample: String
|
|
71
|
-
terms_and_conditions_url: String
|
|
69
|
+
link_sample: String
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
type use_case =
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module SurgeAPI
|
|
2
|
+
module Models
|
|
3
|
+
type campaign_update_params =
|
|
4
|
+
{ campaign_params: SurgeAPI::Models::campaign_params }
|
|
5
|
+
& SurgeAPI::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class CampaignUpdateParams < SurgeAPI::Internal::Type::BaseModel
|
|
8
|
+
extend SurgeAPI::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include SurgeAPI::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
def campaign_params: -> SurgeAPI::Models::campaign_params
|
|
12
|
+
|
|
13
|
+
def campaign_params=: (
|
|
14
|
+
SurgeAPI::Models::campaign_params _
|
|
15
|
+
) -> SurgeAPI::Models::campaign_params
|
|
16
|
+
|
|
17
|
+
def initialize: (
|
|
18
|
+
campaign_params: SurgeAPI::Models::campaign_params,
|
|
19
|
+
?request_options: SurgeAPI::request_opts
|
|
20
|
+
) -> void
|
|
21
|
+
|
|
22
|
+
def to_hash: -> {
|
|
23
|
+
campaign_params: SurgeAPI::Models::campaign_params,
|
|
24
|
+
request_options: SurgeAPI::RequestOptions
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/sig/surge_api/models.rbs
CHANGED
|
@@ -13,6 +13,8 @@ module SurgeAPI
|
|
|
13
13
|
|
|
14
14
|
class AudienceAddContactParams = SurgeAPI::Models::AudienceAddContactParams
|
|
15
15
|
|
|
16
|
+
class AudienceCreateParams = SurgeAPI::Models::AudienceCreateParams
|
|
17
|
+
|
|
16
18
|
class AudienceListContactsParams = SurgeAPI::Models::AudienceListContactsParams
|
|
17
19
|
|
|
18
20
|
class Blast = SurgeAPI::Models::Blast
|
|
@@ -33,6 +35,8 @@ module SurgeAPI
|
|
|
33
35
|
|
|
34
36
|
class CampaignRetrieveParams = SurgeAPI::Models::CampaignRetrieveParams
|
|
35
37
|
|
|
38
|
+
class CampaignUpdateParams = SurgeAPI::Models::CampaignUpdateParams
|
|
39
|
+
|
|
36
40
|
class Contact = SurgeAPI::Models::Contact
|
|
37
41
|
|
|
38
42
|
class ContactCreateParams = SurgeAPI::Models::ContactCreateParams
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
module SurgeAPI
|
|
2
2
|
module Resources
|
|
3
3
|
class Audiences
|
|
4
|
+
def create: (
|
|
5
|
+
String account_id,
|
|
6
|
+
name: String,
|
|
7
|
+
?request_options: SurgeAPI::request_opts
|
|
8
|
+
) -> SurgeAPI::Models::AudienceCreateResponse
|
|
9
|
+
|
|
4
10
|
def add_contact: (
|
|
5
11
|
String audience_id,
|
|
6
12
|
id: String,
|
|
@@ -12,6 +12,12 @@ module SurgeAPI
|
|
|
12
12
|
?request_options: SurgeAPI::request_opts
|
|
13
13
|
) -> SurgeAPI::Campaign
|
|
14
14
|
|
|
15
|
+
def update: (
|
|
16
|
+
String id,
|
|
17
|
+
campaign_params: SurgeAPI::Models::CampaignParams,
|
|
18
|
+
?request_options: SurgeAPI::request_opts
|
|
19
|
+
) -> SurgeAPI::Campaign
|
|
20
|
+
|
|
15
21
|
def list: (
|
|
16
22
|
String account_id,
|
|
17
23
|
?after: String,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: surge_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Surge
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -77,6 +77,8 @@ files:
|
|
|
77
77
|
- lib/surge_api/models/account_status.rb
|
|
78
78
|
- lib/surge_api/models/account_update_params.rb
|
|
79
79
|
- lib/surge_api/models/audience_add_contact_params.rb
|
|
80
|
+
- lib/surge_api/models/audience_create_params.rb
|
|
81
|
+
- lib/surge_api/models/audience_create_response.rb
|
|
80
82
|
- lib/surge_api/models/audience_list_contacts_params.rb
|
|
81
83
|
- lib/surge_api/models/blast.rb
|
|
82
84
|
- lib/surge_api/models/blast_create_params.rb
|
|
@@ -87,6 +89,7 @@ files:
|
|
|
87
89
|
- lib/surge_api/models/campaign_list_params.rb
|
|
88
90
|
- lib/surge_api/models/campaign_params.rb
|
|
89
91
|
- lib/surge_api/models/campaign_retrieve_params.rb
|
|
92
|
+
- lib/surge_api/models/campaign_update_params.rb
|
|
90
93
|
- lib/surge_api/models/contact.rb
|
|
91
94
|
- lib/surge_api/models/contact_create_params.rb
|
|
92
95
|
- lib/surge_api/models/contact_list_params.rb
|
|
@@ -176,6 +179,8 @@ files:
|
|
|
176
179
|
- rbi/surge_api/models/account_status.rbi
|
|
177
180
|
- rbi/surge_api/models/account_update_params.rbi
|
|
178
181
|
- rbi/surge_api/models/audience_add_contact_params.rbi
|
|
182
|
+
- rbi/surge_api/models/audience_create_params.rbi
|
|
183
|
+
- rbi/surge_api/models/audience_create_response.rbi
|
|
179
184
|
- rbi/surge_api/models/audience_list_contacts_params.rbi
|
|
180
185
|
- rbi/surge_api/models/blast.rbi
|
|
181
186
|
- rbi/surge_api/models/blast_create_params.rbi
|
|
@@ -186,6 +191,7 @@ files:
|
|
|
186
191
|
- rbi/surge_api/models/campaign_list_params.rbi
|
|
187
192
|
- rbi/surge_api/models/campaign_params.rbi
|
|
188
193
|
- rbi/surge_api/models/campaign_retrieve_params.rbi
|
|
194
|
+
- rbi/surge_api/models/campaign_update_params.rbi
|
|
189
195
|
- rbi/surge_api/models/contact.rbi
|
|
190
196
|
- rbi/surge_api/models/contact_create_params.rbi
|
|
191
197
|
- rbi/surge_api/models/contact_list_params.rbi
|
|
@@ -274,6 +280,8 @@ files:
|
|
|
274
280
|
- sig/surge_api/models/account_status.rbs
|
|
275
281
|
- sig/surge_api/models/account_update_params.rbs
|
|
276
282
|
- sig/surge_api/models/audience_add_contact_params.rbs
|
|
283
|
+
- sig/surge_api/models/audience_create_params.rbs
|
|
284
|
+
- sig/surge_api/models/audience_create_response.rbs
|
|
277
285
|
- sig/surge_api/models/audience_list_contacts_params.rbs
|
|
278
286
|
- sig/surge_api/models/blast.rbs
|
|
279
287
|
- sig/surge_api/models/blast_create_params.rbs
|
|
@@ -284,6 +292,7 @@ files:
|
|
|
284
292
|
- sig/surge_api/models/campaign_list_params.rbs
|
|
285
293
|
- sig/surge_api/models/campaign_params.rbs
|
|
286
294
|
- sig/surge_api/models/campaign_retrieve_params.rbs
|
|
295
|
+
- sig/surge_api/models/campaign_update_params.rbs
|
|
287
296
|
- sig/surge_api/models/contact.rbs
|
|
288
297
|
- sig/surge_api/models/contact_create_params.rbs
|
|
289
298
|
- sig/surge_api/models/contact_list_params.rbs
|