growsurf-ruby 1.17.0 → 1.19.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 +34 -0
- data/README.md +1 -1
- data/lib/growsurf_ruby/client.rb +0 -4
- data/lib/growsurf_ruby/errors.rb +128 -0
- data/lib/growsurf_ruby/models/campaign/campaign_custom_domain.rb +109 -0
- data/lib/growsurf_ruby/models/campaign/create.rb +18 -4
- data/lib/growsurf_ruby/models/campaign/custom_domain_set_params.rb +25 -0
- data/lib/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rb +27 -0
- data/lib/growsurf_ruby/models/campaign/participant.rb +15 -215
- data/lib/growsurf_ruby/models/campaign/participant_email_params.rb +12 -8
- data/lib/growsurf_ruby/models/campaign/participant_list_referrals_params.rb +0 -3
- data/lib/growsurf_ruby/models/campaign/participant_record_transaction_params.rb +16 -2
- data/lib/growsurf_ruby/models/campaign/participant_refund_transaction_params.rb +16 -2
- data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +20 -0
- data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +20 -0
- data/lib/growsurf_ruby/models/campaign/webhook_create_params.rb +10 -3
- data/lib/growsurf_ruby/models/campaign_create_params.rb +10 -5
- data/lib/growsurf_ruby/models/campaign_list_referrals_params.rb +0 -3
- data/lib/growsurf_ruby/models/campaign_update_params.rb +4 -4
- data/lib/growsurf_ruby/models/commission_structure.rb +3 -0
- data/lib/growsurf_ruby/models/referral_list.rb +17 -1
- data/lib/growsurf_ruby/models.rb +0 -2
- data/lib/growsurf_ruby/resources/campaign/custom_domain.rb +111 -0
- data/lib/growsurf_ruby/resources/campaign/design.rb +3 -3
- data/lib/growsurf_ruby/resources/campaign/emails.rb +1 -2
- data/lib/growsurf_ruby/resources/campaign/installation.rb +1 -2
- data/lib/growsurf_ruby/resources/campaign/options.rb +4 -5
- data/lib/growsurf_ruby/resources/campaign/participant.rb +9 -4
- data/lib/growsurf_ruby/resources/campaign/program_resources.rb +1 -0
- data/lib/growsurf_ruby/resources/campaign/rewards.rb +17 -2
- data/lib/growsurf_ruby/resources/campaign/webhooks.rb +13 -3
- data/lib/growsurf_ruby/resources/campaign.rb +15 -9
- data/lib/growsurf_ruby/version.rb +1 -1
- data/lib/growsurf_ruby.rb +4 -3
- data/rbi/growsurf_ruby/client.rbi +0 -3
- data/rbi/growsurf_ruby/errors.rbi +64 -0
- data/rbi/growsurf_ruby/models/campaign/campaign_custom_domain.rbi +193 -0
- data/rbi/growsurf_ruby/models/campaign/create.rbi +24 -4
- data/rbi/growsurf_ruby/models/campaign/custom_domain_set_params.rbi +47 -0
- data/rbi/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rbi +40 -0
- data/rbi/growsurf_ruby/models/campaign/participant.rbi +15 -292
- data/rbi/growsurf_ruby/models/campaign/participant_email_params.rbi +23 -16
- data/rbi/growsurf_ruby/models/campaign/participant_list_referrals_params.rbi +0 -15
- data/rbi/growsurf_ruby/models/campaign/participant_record_transaction_params.rbi +23 -4
- data/rbi/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbi +23 -4
- data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +24 -0
- data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +24 -0
- data/rbi/growsurf_ruby/models/campaign/webhook_create_params.rbi +18 -4
- data/rbi/growsurf_ruby/models/campaign_create_params.rbi +6 -12
- data/rbi/growsurf_ruby/models/campaign_list_referrals_params.rbi +0 -15
- data/rbi/growsurf_ruby/models/campaign_update_params.rbi +6 -12
- data/rbi/growsurf_ruby/models/commission_structure.rbi +3 -0
- data/rbi/growsurf_ruby/models/referral_list.rbi +19 -3
- data/rbi/growsurf_ruby/models.rbi +0 -2
- data/rbi/growsurf_ruby/resources/campaign/custom_domain.rbi +91 -0
- data/rbi/growsurf_ruby/resources/campaign/design.rbi +3 -3
- data/rbi/growsurf_ruby/resources/campaign/emails.rbi +1 -2
- data/rbi/growsurf_ruby/resources/campaign/installation.rbi +1 -2
- data/rbi/growsurf_ruby/resources/campaign/options.rbi +4 -5
- data/rbi/growsurf_ruby/resources/campaign/participant.rbi +30 -15
- data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +25 -2
- data/rbi/growsurf_ruby/resources/campaign/webhooks.rbi +21 -4
- data/rbi/growsurf_ruby/resources/campaign.rbi +21 -9
- data/sig/growsurf_ruby/client.rbs +0 -2
- data/sig/growsurf_ruby/errors.rbs +40 -0
- data/sig/growsurf_ruby/models/campaign/campaign_custom_domain.rbs +84 -0
- data/sig/growsurf_ruby/models/campaign/create.rbs +5 -0
- data/sig/growsurf_ruby/models/campaign/custom_domain_set_params.rbs +25 -0
- data/sig/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rbs +18 -0
- data/sig/growsurf_ruby/models/campaign/participant.rbs +7 -205
- data/sig/growsurf_ruby/models/campaign/participant_list_referrals_params.rbs +0 -6
- data/sig/growsurf_ruby/models/campaign/participant_record_transaction_params.rbs +19 -5
- data/sig/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbs +19 -5
- data/sig/growsurf_ruby/models/campaign_create_params.rbs +8 -12
- data/sig/growsurf_ruby/models/campaign_list_referrals_params.rbs +0 -6
- data/sig/growsurf_ruby/models/campaign_update_params.rbs +8 -12
- data/sig/growsurf_ruby/models/referral_list.rbs +13 -3
- data/sig/growsurf_ruby/models.rbs +0 -2
- data/sig/growsurf_ruby/resources/campaign/custom_domain.rbs +30 -0
- data/sig/growsurf_ruby/resources/campaign/participant.rbs +3 -2
- data/sig/growsurf_ruby/resources/campaign.rbs +7 -4
- metadata +14 -11
- data/lib/growsurf_ruby/models/account_create_params.rb +0 -46
- data/lib/growsurf_ruby/models/account_create_response.rb +0 -57
- data/lib/growsurf_ruby/resources/account.rb +0 -66
- data/rbi/growsurf_ruby/models/account_create_params.rbi +0 -73
- data/rbi/growsurf_ruby/models/account_create_response.rbi +0 -107
- data/rbi/growsurf_ruby/resources/account.rbi +0 -46
- data/sig/growsurf_ruby/models/account_create_params.rbs +0 -42
- data/sig/growsurf_ruby/models/account_create_response.rbs +0 -42
- data/sig/growsurf_ruby/resources/account.rbs +0 -15
|
@@ -30,15 +30,18 @@ module GrowsurfRuby
|
|
|
30
30
|
sig { params(body: String).void }
|
|
31
31
|
attr_writer :body
|
|
32
32
|
|
|
33
|
-
# The program email template to
|
|
34
|
-
# The
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
# `
|
|
40
|
-
# `
|
|
41
|
-
#
|
|
33
|
+
# The program email template to trigger (template mode). Send the camelCase
|
|
34
|
+
# email-type key. The available types depend on the program type; the template's
|
|
35
|
+
# `isEnabled` setting controls automatic sends only. This endpoint can trigger
|
|
36
|
+
# any sendable template. System and transactional types (login link, payout
|
|
37
|
+
# destination confirmation, tax notifications), the invite email, and the
|
|
38
|
+
# follow-up reminder cannot be sent. Referral programs: `welcomeNonReferred`,
|
|
39
|
+
# `referralLinkViewedFirstTime`, `referralLinkUsed`, `referredSignup`,
|
|
40
|
+
# `welcomeReferred`, `offerClaimed`, `goalAchieved`, `campaignEndedWinners`,
|
|
41
|
+
# `campaignEndedNonWinners`, `progressUpdateMonthly`. Affiliate programs:
|
|
42
|
+
# `welcomeNonReferred`, `referralLinkViewedFirstTime`, `referredSignup`,
|
|
43
|
+
# `offerClaimed`, `commissionGenerated`, `commissionAdjusted`, `payoutPending`,
|
|
44
|
+
# `payoutSentSuccess`, `progressUpdateMonthly`.
|
|
42
45
|
sig { returns(T.nilable(String)) }
|
|
43
46
|
attr_reader :email_type
|
|
44
47
|
|
|
@@ -78,15 +81,19 @@ module GrowsurfRuby
|
|
|
78
81
|
# inserting `{{...}}` tokens like `{{firstName}}` or `{{shareUrl}}`. See
|
|
79
82
|
# [Guide to using dynamic text in GrowSurf emails](https://support.growsurf.com/article/213-guide-to-using-dynamic-text-in-growsurf-emails).
|
|
80
83
|
body: nil,
|
|
81
|
-
# The program email template to
|
|
82
|
-
# The
|
|
83
|
-
#
|
|
84
|
-
#
|
|
84
|
+
# The program email template to trigger (template mode). Send the camelCase
|
|
85
|
+
# email-type key. The available types depend on the program type; the
|
|
86
|
+
# template's `isEnabled` setting controls automatic sends only. This endpoint
|
|
87
|
+
# can trigger any sendable template. System and transactional types (login
|
|
88
|
+
# link, payout destination confirmation, tax notifications), the invite email,
|
|
89
|
+
# and the follow-up reminder cannot be sent. Referral programs:
|
|
90
|
+
# `welcomeNonReferred`, `referralLinkViewedFirstTime`, `referralLinkUsed`,
|
|
91
|
+
# `referredSignup`, `welcomeReferred`, `offerClaimed`, `goalAchieved`,
|
|
85
92
|
# `campaignEndedWinners`, `campaignEndedNonWinners`, `progressUpdateMonthly`.
|
|
86
93
|
# Affiliate programs: `welcomeNonReferred`, `referralLinkViewedFirstTime`,
|
|
87
|
-
# `referredSignup`, `
|
|
88
|
-
# `
|
|
89
|
-
#
|
|
94
|
+
# `referredSignup`, `offerClaimed`, `commissionGenerated`,
|
|
95
|
+
# `commissionAdjusted`, `payoutPending`, `payoutSentSuccess`,
|
|
96
|
+
# `progressUpdateMonthly`.
|
|
90
97
|
email_type: nil,
|
|
91
98
|
# Optional preheader text for a free-form email.
|
|
92
99
|
preheader: nil,
|
|
@@ -191,21 +191,6 @@ module GrowsurfRuby
|
|
|
191
191
|
:email,
|
|
192
192
|
GrowsurfRuby::Campaign::ParticipantListReferralsParams::SortBy::TaggedSymbol
|
|
193
193
|
)
|
|
194
|
-
FIRST_NAME =
|
|
195
|
-
T.let(
|
|
196
|
-
:firstName,
|
|
197
|
-
GrowsurfRuby::Campaign::ParticipantListReferralsParams::SortBy::TaggedSymbol
|
|
198
|
-
)
|
|
199
|
-
LAST_NAME =
|
|
200
|
-
T.let(
|
|
201
|
-
:lastName,
|
|
202
|
-
GrowsurfRuby::Campaign::ParticipantListReferralsParams::SortBy::TaggedSymbol
|
|
203
|
-
)
|
|
204
|
-
REFERRAL_STATUS =
|
|
205
|
-
T.let(
|
|
206
|
-
:referralStatus,
|
|
207
|
-
GrowsurfRuby::Campaign::ParticipantListReferralsParams::SortBy::TaggedSymbol
|
|
208
|
-
)
|
|
209
194
|
REFERRAL_TRIGGERED_AT =
|
|
210
195
|
T.let(
|
|
211
196
|
:referralTriggeredAt,
|
|
@@ -155,10 +155,10 @@ module GrowsurfRuby
|
|
|
155
155
|
sig { params(transaction_id: String).void }
|
|
156
156
|
attr_writer :transaction_id
|
|
157
157
|
|
|
158
|
-
sig { returns(T.nilable(
|
|
158
|
+
sig { returns(T.nilable(GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::OrSymbol)) }
|
|
159
159
|
attr_reader :payment_provider
|
|
160
160
|
|
|
161
|
-
sig { params(payment_provider:
|
|
161
|
+
sig { params(payment_provider: GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::OrSymbol).void }
|
|
162
162
|
attr_writer :payment_provider
|
|
163
163
|
|
|
164
164
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -194,7 +194,7 @@ module GrowsurfRuby
|
|
|
194
194
|
total_tax_amounts: T::Array[T::Hash[Symbol, T.anything]],
|
|
195
195
|
total_taxes: T::Array[T::Hash[Symbol, T.anything]],
|
|
196
196
|
transaction_id: String,
|
|
197
|
-
payment_provider:
|
|
197
|
+
payment_provider: GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::OrSymbol,
|
|
198
198
|
test_mode: T::Boolean,
|
|
199
199
|
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
200
200
|
).returns(T.attached_class)
|
|
@@ -259,7 +259,7 @@ module GrowsurfRuby
|
|
|
259
259
|
total_tax_amounts: T::Array[T::Hash[Symbol, T.anything]],
|
|
260
260
|
total_taxes: T::Array[T::Hash[Symbol, T.anything]],
|
|
261
261
|
transaction_id: String,
|
|
262
|
-
payment_provider:
|
|
262
|
+
payment_provider: GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::OrSymbol,
|
|
263
263
|
test_mode: T::Boolean,
|
|
264
264
|
request_options: GrowsurfRuby::RequestOptions
|
|
265
265
|
}
|
|
@@ -267,6 +267,25 @@ module GrowsurfRuby
|
|
|
267
267
|
end
|
|
268
268
|
def to_hash
|
|
269
269
|
end
|
|
270
|
+
|
|
271
|
+
# Connected payment provider.
|
|
272
|
+
module PaymentProvider
|
|
273
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
274
|
+
|
|
275
|
+
TaggedSymbol =
|
|
276
|
+
T.type_alias do
|
|
277
|
+
T.all(Symbol, GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider)
|
|
278
|
+
end
|
|
279
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
280
|
+
|
|
281
|
+
STRIPE = T.let(:stripe, GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::TaggedSymbol)
|
|
282
|
+
CHARGEBEE = T.let(:chargebee, GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::TaggedSymbol)
|
|
283
|
+
RECURLY = T.let(:recurly, GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::TaggedSymbol)
|
|
284
|
+
|
|
285
|
+
sig { override.returns(T::Array[GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::TaggedSymbol]) }
|
|
286
|
+
def self.values
|
|
287
|
+
end
|
|
288
|
+
end
|
|
270
289
|
end
|
|
271
290
|
end
|
|
272
291
|
end
|
|
@@ -122,10 +122,10 @@ module GrowsurfRuby
|
|
|
122
122
|
sig { params(transaction_id: String).void }
|
|
123
123
|
attr_writer :transaction_id
|
|
124
124
|
|
|
125
|
-
sig { returns(T.nilable(
|
|
125
|
+
sig { returns(T.nilable(GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::OrSymbol)) }
|
|
126
126
|
attr_reader :payment_provider
|
|
127
127
|
|
|
128
|
-
sig { params(payment_provider:
|
|
128
|
+
sig { params(payment_provider: GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::OrSymbol).void }
|
|
129
129
|
attr_writer :payment_provider
|
|
130
130
|
|
|
131
131
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -154,7 +154,7 @@ module GrowsurfRuby
|
|
|
154
154
|
refund_id: String,
|
|
155
155
|
refund_status: String,
|
|
156
156
|
transaction_id: String,
|
|
157
|
-
payment_provider:
|
|
157
|
+
payment_provider: GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::OrSymbol,
|
|
158
158
|
test_mode: T::Boolean,
|
|
159
159
|
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
160
160
|
).returns(T.attached_class)
|
|
@@ -204,7 +204,7 @@ module GrowsurfRuby
|
|
|
204
204
|
refund_id: String,
|
|
205
205
|
refund_status: String,
|
|
206
206
|
transaction_id: String,
|
|
207
|
-
payment_provider:
|
|
207
|
+
payment_provider: GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::OrSymbol,
|
|
208
208
|
test_mode: T::Boolean,
|
|
209
209
|
request_options: GrowsurfRuby::RequestOptions
|
|
210
210
|
}
|
|
@@ -246,6 +246,25 @@ module GrowsurfRuby
|
|
|
246
246
|
def self.values
|
|
247
247
|
end
|
|
248
248
|
end
|
|
249
|
+
|
|
250
|
+
# Connected payment provider.
|
|
251
|
+
module PaymentProvider
|
|
252
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
253
|
+
|
|
254
|
+
TaggedSymbol =
|
|
255
|
+
T.type_alias do
|
|
256
|
+
T.all(Symbol, GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider)
|
|
257
|
+
end
|
|
258
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
259
|
+
|
|
260
|
+
STRIPE = T.let(:stripe, GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::TaggedSymbol)
|
|
261
|
+
CHARGEBEE = T.let(:chargebee, GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::TaggedSymbol)
|
|
262
|
+
RECURLY = T.let(:recurly, GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::TaggedSymbol)
|
|
263
|
+
|
|
264
|
+
sig { override.returns(T::Array[GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::TaggedSymbol]) }
|
|
265
|
+
def self.values
|
|
266
|
+
end
|
|
267
|
+
end
|
|
249
268
|
end
|
|
250
269
|
end
|
|
251
270
|
end
|
|
@@ -143,6 +143,18 @@ module GrowsurfRuby
|
|
|
143
143
|
attr_writer :limit_duration
|
|
144
144
|
|
|
145
145
|
# Custom key/value metadata (single-level; values are stored as strings).
|
|
146
|
+
# Each value must be a string, number, or boolean of up to 500 characters. Each
|
|
147
|
+
# key must have 1 to 40 characters once camelCased, and two keys that camelCase
|
|
148
|
+
# to the same key are rejected. Up to 50 keys. An entry that breaks these rules
|
|
149
|
+
# returns `400`.
|
|
150
|
+
#
|
|
151
|
+
# For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
|
|
152
|
+
# referrer’s amount and `referredRewardAmount` is the friend’s amount. If
|
|
153
|
+
# `referredRewardAmount` is absent, both use `rewardAmount`. New or changed positive
|
|
154
|
+
# numeric amounts must use whole units for currencies without decimals, such as JPY, and
|
|
155
|
+
# no more than two decimal places for other currencies, including USD and KWD. Excess
|
|
156
|
+
# precision is rejected rather than rounded, including when you clone a program. Existing
|
|
157
|
+
# unchanged amounts and earned rewards keep their saved values.
|
|
146
158
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
147
159
|
attr_reader :metadata
|
|
148
160
|
|
|
@@ -296,6 +308,18 @@ module GrowsurfRuby
|
|
|
296
308
|
limit: nil,
|
|
297
309
|
limit_duration: nil,
|
|
298
310
|
# Custom key/value metadata (single-level; values are stored as strings).
|
|
311
|
+
# Each value must be a string, number, or boolean of up to 500 characters.
|
|
312
|
+
# Each key must have 1 to 40 characters once camelCased, and two keys that
|
|
313
|
+
# camelCase to the same key are rejected. Up to 50 keys. An entry that breaks
|
|
314
|
+
# these rules returns `400`.
|
|
315
|
+
#
|
|
316
|
+
# For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
|
|
317
|
+
# referrer’s amount and `referredRewardAmount` is the friend’s amount. If
|
|
318
|
+
# `referredRewardAmount` is absent, both use `rewardAmount`. New or changed positive
|
|
319
|
+
# numeric amounts must use whole units for currencies without decimals, such as JPY, and
|
|
320
|
+
# no more than two decimal places for other currencies, including USD and KWD. Excess
|
|
321
|
+
# precision is rejected rather than rounded, including when you clone a program.
|
|
322
|
+
# Existing unchanged amounts and earned rewards keep their saved values.
|
|
299
323
|
metadata: nil,
|
|
300
324
|
# Text shown before a participant's referral count in milestone-progress copy.
|
|
301
325
|
# Applies to `MILESTONE` rewards.
|
|
@@ -142,6 +142,18 @@ module GrowsurfRuby
|
|
|
142
142
|
attr_writer :limit_duration
|
|
143
143
|
|
|
144
144
|
# Custom key/value metadata (single-level; values are stored as strings).
|
|
145
|
+
# Each value must be a string, number, or boolean of up to 500 characters. Each
|
|
146
|
+
# key must have 1 to 40 characters once camelCased, and two keys that camelCase
|
|
147
|
+
# to the same key are rejected. Up to 50 keys. An entry that breaks these rules
|
|
148
|
+
# returns `400`.
|
|
149
|
+
#
|
|
150
|
+
# For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
|
|
151
|
+
# referrer’s amount and `referredRewardAmount` is the friend’s amount. If
|
|
152
|
+
# `referredRewardAmount` is absent, both use `rewardAmount`. New or changed positive
|
|
153
|
+
# numeric amounts must use whole units for currencies without decimals, such as JPY, and
|
|
154
|
+
# no more than two decimal places for other currencies, including USD and KWD. Excess
|
|
155
|
+
# precision is rejected rather than rounded, including when you clone a program. Existing
|
|
156
|
+
# unchanged amounts and earned rewards keep their saved values.
|
|
145
157
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
146
158
|
attr_reader :metadata
|
|
147
159
|
|
|
@@ -296,6 +308,18 @@ module GrowsurfRuby
|
|
|
296
308
|
limit: nil,
|
|
297
309
|
limit_duration: nil,
|
|
298
310
|
# Custom key/value metadata (single-level; values are stored as strings).
|
|
311
|
+
# Each value must be a string, number, or boolean of up to 500 characters.
|
|
312
|
+
# Each key must have 1 to 40 characters once camelCased, and two keys that
|
|
313
|
+
# camelCase to the same key are rejected. Up to 50 keys. An entry that breaks
|
|
314
|
+
# these rules returns `400`.
|
|
315
|
+
#
|
|
316
|
+
# For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
|
|
317
|
+
# referrer’s amount and `referredRewardAmount` is the friend’s amount. If
|
|
318
|
+
# `referredRewardAmount` is absent, both use `rewardAmount`. New or changed positive
|
|
319
|
+
# numeric amounts must use whole units for currencies without decimals, such as JPY, and
|
|
320
|
+
# no more than two decimal places for other currencies, including USD and KWD. Excess
|
|
321
|
+
# precision is rejected rather than rounded, including when you clone a program.
|
|
322
|
+
# Existing unchanged amounts and earned rewards keep their saved values.
|
|
299
323
|
metadata: nil,
|
|
300
324
|
# Text shown before a participant's referral count in milestone-progress copy.
|
|
301
325
|
# Applies to `MILESTONE` rewards.
|
|
@@ -19,8 +19,15 @@ module GrowsurfRuby
|
|
|
19
19
|
sig { returns(String) }
|
|
20
20
|
attr_accessor :payload_url
|
|
21
21
|
|
|
22
|
-
# The events this webhook is subscribed to. When omitted,
|
|
23
|
-
#
|
|
22
|
+
# The events this webhook is subscribed to. When omitted, the webhook is
|
|
23
|
+
# subscribed to every event its program type offers, like a webhook added in the
|
|
24
|
+
# dashboard: referral programs offer `PARTICIPANT_REACHED_A_GOAL`,
|
|
25
|
+
# `NEW_PARTICIPANT_ADDED`, `PARTICIPANT_FRAUD_STATUS_UPDATED`, and
|
|
26
|
+
# `CAMPAIGN_ENDED`; affiliate programs offer `NEW_COMMISSION_ADDED`,
|
|
27
|
+
# `COMMISSION_ADJUSTED`, `NEW_PAYOUT_ISSUED`, `NEW_PARTICIPANT_ADDED`,
|
|
28
|
+
# `PARTICIPANT_FRAUD_STATUS_UPDATED`, and `CAMPAIGN_ENDED`. Send `[]` to
|
|
29
|
+
# subscribe to no events. An event the program type does not offer returns
|
|
30
|
+
# `400`.
|
|
24
31
|
sig do
|
|
25
32
|
returns(
|
|
26
33
|
T.nilable(T::Array[GrowsurfRuby::Campaign::WebhookEvent::OrSymbol])
|
|
@@ -61,8 +68,15 @@ module GrowsurfRuby
|
|
|
61
68
|
def self.new(
|
|
62
69
|
# The URL that receives webhook deliveries.
|
|
63
70
|
payload_url:,
|
|
64
|
-
# The events this webhook is subscribed to. When omitted,
|
|
65
|
-
#
|
|
71
|
+
# The events this webhook is subscribed to. When omitted, the webhook is
|
|
72
|
+
# subscribed to every event its program type offers, like a webhook added in
|
|
73
|
+
# the dashboard: referral programs offer `PARTICIPANT_REACHED_A_GOAL`,
|
|
74
|
+
# `NEW_PARTICIPANT_ADDED`, `PARTICIPANT_FRAUD_STATUS_UPDATED`, and
|
|
75
|
+
# `CAMPAIGN_ENDED`; affiliate programs offer `NEW_COMMISSION_ADDED`,
|
|
76
|
+
# `COMMISSION_ADJUSTED`, `NEW_PAYOUT_ISSUED`, `NEW_PARTICIPANT_ADDED`,
|
|
77
|
+
# `PARTICIPANT_FRAUD_STATUS_UPDATED`, and `CAMPAIGN_ENDED`. Send `[]` to
|
|
78
|
+
# subscribe to no events. An event the program type does not offer returns
|
|
79
|
+
# `400`.
|
|
66
80
|
events: nil,
|
|
67
81
|
is_enabled: nil,
|
|
68
82
|
# Write-only. Used to sign deliveries (the `GrowSurf-Signature` HMAC header). Never
|
|
@@ -18,16 +18,10 @@ module GrowsurfRuby
|
|
|
18
18
|
attr_accessor :type
|
|
19
19
|
|
|
20
20
|
sig { returns(T.nilable(String)) }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
sig { params(company_logo_image_url: String).void }
|
|
24
|
-
attr_writer :company_logo_image_url
|
|
21
|
+
attr_accessor :company_logo_image_url
|
|
25
22
|
|
|
26
23
|
sig { returns(T.nilable(String)) }
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
sig { params(company_name: String).void }
|
|
30
|
-
attr_writer :company_name
|
|
24
|
+
attr_accessor :company_name
|
|
31
25
|
|
|
32
26
|
sig { returns(T.nilable(String)) }
|
|
33
27
|
attr_reader :currency_iso
|
|
@@ -66,8 +60,8 @@ module GrowsurfRuby
|
|
|
66
60
|
sig do
|
|
67
61
|
params(
|
|
68
62
|
type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
|
|
69
|
-
company_logo_image_url: String,
|
|
70
|
-
company_name: String,
|
|
63
|
+
company_logo_image_url: T.nilable(String),
|
|
64
|
+
company_name: T.nilable(String),
|
|
71
65
|
currency_iso: String,
|
|
72
66
|
goal: GrowsurfRuby::CampaignCreateParams::Goal::OrSymbol,
|
|
73
67
|
name: String,
|
|
@@ -91,8 +85,8 @@ module GrowsurfRuby
|
|
|
91
85
|
override.returns(
|
|
92
86
|
{
|
|
93
87
|
type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
|
|
94
|
-
company_logo_image_url: String,
|
|
95
|
-
company_name: String,
|
|
88
|
+
company_logo_image_url: T.nilable(String),
|
|
89
|
+
company_name: T.nilable(String),
|
|
96
90
|
currency_iso: String,
|
|
97
91
|
goal: GrowsurfRuby::CampaignCreateParams::Goal::OrSymbol,
|
|
98
92
|
name: String,
|
|
@@ -177,21 +177,6 @@ module GrowsurfRuby
|
|
|
177
177
|
:email,
|
|
178
178
|
GrowsurfRuby::CampaignListReferralsParams::SortBy::TaggedSymbol
|
|
179
179
|
)
|
|
180
|
-
FIRST_NAME =
|
|
181
|
-
T.let(
|
|
182
|
-
:firstName,
|
|
183
|
-
GrowsurfRuby::CampaignListReferralsParams::SortBy::TaggedSymbol
|
|
184
|
-
)
|
|
185
|
-
LAST_NAME =
|
|
186
|
-
T.let(
|
|
187
|
-
:lastName,
|
|
188
|
-
GrowsurfRuby::CampaignListReferralsParams::SortBy::TaggedSymbol
|
|
189
|
-
)
|
|
190
|
-
REFERRAL_STATUS =
|
|
191
|
-
T.let(
|
|
192
|
-
:referralStatus,
|
|
193
|
-
GrowsurfRuby::CampaignListReferralsParams::SortBy::TaggedSymbol
|
|
194
|
-
)
|
|
195
180
|
REFERRAL_TRIGGERED_AT =
|
|
196
181
|
T.let(
|
|
197
182
|
:referralTriggeredAt,
|
|
@@ -18,16 +18,10 @@ module GrowsurfRuby
|
|
|
18
18
|
attr_accessor :id
|
|
19
19
|
|
|
20
20
|
sig { returns(T.nilable(String)) }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
sig { params(company_logo_image_url: String).void }
|
|
24
|
-
attr_writer :company_logo_image_url
|
|
21
|
+
attr_accessor :company_logo_image_url
|
|
25
22
|
|
|
26
23
|
sig { returns(T.nilable(String)) }
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
sig { params(company_name: String).void }
|
|
30
|
-
attr_writer :company_name
|
|
24
|
+
attr_accessor :company_name
|
|
31
25
|
|
|
32
26
|
sig { returns(T.nilable(String)) }
|
|
33
27
|
attr_reader :name
|
|
@@ -50,8 +44,8 @@ module GrowsurfRuby
|
|
|
50
44
|
sig do
|
|
51
45
|
params(
|
|
52
46
|
id: String,
|
|
53
|
-
company_logo_image_url: String,
|
|
54
|
-
company_name: String,
|
|
47
|
+
company_logo_image_url: T.nilable(String),
|
|
48
|
+
company_name: T.nilable(String),
|
|
55
49
|
name: String,
|
|
56
50
|
status: GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol,
|
|
57
51
|
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
@@ -71,8 +65,8 @@ module GrowsurfRuby
|
|
|
71
65
|
override.returns(
|
|
72
66
|
{
|
|
73
67
|
id: String,
|
|
74
|
-
company_logo_image_url: String,
|
|
75
|
-
company_name: String,
|
|
68
|
+
company_logo_image_url: T.nilable(String),
|
|
69
|
+
company_name: T.nilable(String),
|
|
76
70
|
name: String,
|
|
77
71
|
status: GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol,
|
|
78
72
|
request_options: GrowsurfRuby::RequestOptions
|
|
@@ -11,6 +11,9 @@ module GrowsurfRuby
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Fixed commission amount in the currency's smallest denomination, used when
|
|
15
|
+
# `type` is `FIXED`. The maximum is `100000000` (1,000,000.00) for USD, EUR, and
|
|
16
|
+
# GBP. `null` for percentage-based commissions.
|
|
14
17
|
sig { returns(T.nilable(Integer)) }
|
|
15
18
|
attr_accessor :amount
|
|
16
19
|
|
|
@@ -82,6 +82,14 @@ module GrowsurfRuby
|
|
|
82
82
|
sig { returns(T.nilable(String)) }
|
|
83
83
|
attr_accessor :last_name
|
|
84
84
|
|
|
85
|
+
# When the referrer's credit for this referral expired, as a Unix timestamp in milliseconds. `null` when the credit has not expired.
|
|
86
|
+
sig { returns(T.nilable(Integer)) }
|
|
87
|
+
attr_accessor :referral_credit_expired_at
|
|
88
|
+
|
|
89
|
+
# When the referral was triggered, as a Unix timestamp in milliseconds. `null` until the referral is triggered, and for invites.
|
|
90
|
+
sig { returns(T.nilable(Integer)) }
|
|
91
|
+
attr_accessor :referral_triggered_at
|
|
92
|
+
|
|
85
93
|
sig do
|
|
86
94
|
params(
|
|
87
95
|
id: String,
|
|
@@ -91,7 +99,9 @@ module GrowsurfRuby
|
|
|
91
99
|
referred_by: String,
|
|
92
100
|
updated_at: Integer,
|
|
93
101
|
first_name: T.nilable(String),
|
|
94
|
-
last_name: T.nilable(String)
|
|
102
|
+
last_name: T.nilable(String),
|
|
103
|
+
referral_credit_expired_at: T.nilable(Integer),
|
|
104
|
+
referral_triggered_at: T.nilable(Integer)
|
|
95
105
|
).returns(T.attached_class)
|
|
96
106
|
end
|
|
97
107
|
def self.new(
|
|
@@ -102,7 +112,11 @@ module GrowsurfRuby
|
|
|
102
112
|
referred_by:,
|
|
103
113
|
updated_at:,
|
|
104
114
|
first_name: nil,
|
|
105
|
-
last_name: nil
|
|
115
|
+
last_name: nil,
|
|
116
|
+
# When the referrer's credit for this referral expired, as a Unix timestamp in milliseconds. `null` when the credit has not expired.
|
|
117
|
+
referral_credit_expired_at: nil,
|
|
118
|
+
# When the referral was triggered, as a Unix timestamp in milliseconds. `null` until the referral is triggered, and for invites.
|
|
119
|
+
referral_triggered_at: nil
|
|
106
120
|
)
|
|
107
121
|
end
|
|
108
122
|
|
|
@@ -117,7 +131,9 @@ module GrowsurfRuby
|
|
|
117
131
|
referred_by: String,
|
|
118
132
|
updated_at: Integer,
|
|
119
133
|
first_name: T.nilable(String),
|
|
120
|
-
last_name: T.nilable(String)
|
|
134
|
+
last_name: T.nilable(String),
|
|
135
|
+
referral_credit_expired_at: T.nilable(Integer),
|
|
136
|
+
referral_triggered_at: T.nilable(Integer)
|
|
121
137
|
}
|
|
122
138
|
)
|
|
123
139
|
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module GrowsurfRuby
|
|
4
|
+
module Resources
|
|
5
|
+
class Campaign
|
|
6
|
+
# Custom domain operations: the custom domain that serves a program's landing pages.
|
|
7
|
+
class CustomDomain
|
|
8
|
+
# Retrieves the custom domain that serves a program's landing pages, and whether its
|
|
9
|
+
# DNS is verified. When no custom domain is set, `domain` is `null`. This call does
|
|
10
|
+
# not check DNS; use `verify` for a live check.
|
|
11
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
id: String,
|
|
14
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
15
|
+
).returns(GrowsurfRuby::Models::Campaign::CampaignCustomDomain)
|
|
16
|
+
end
|
|
17
|
+
def retrieve(
|
|
18
|
+
# GrowSurf program ID.
|
|
19
|
+
id,
|
|
20
|
+
request_options: {}
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Sets the custom domain for a program's landing pages, or replaces the current one.
|
|
25
|
+
# Send a hostname such as `refer.piedpiper.com`; `https://` is added if you leave it
|
|
26
|
+
# out. Paths, ports, queries and `http://` return a `400`.
|
|
27
|
+
# Replacing a domain removes the old one right away, and its pages stop loading
|
|
28
|
+
# there. Sending the current domain again changes nothing. A domain used by another
|
|
29
|
+
# program returns a `409`.
|
|
30
|
+
# A new domain starts unverified. Point a `CNAME` record from the hostname to the
|
|
31
|
+
# `dns_record.value` in the response, then call `verify`.
|
|
32
|
+
sig do
|
|
33
|
+
params(
|
|
34
|
+
id: String,
|
|
35
|
+
domain: String,
|
|
36
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
37
|
+
).returns(GrowsurfRuby::Models::Campaign::CampaignCustomDomain)
|
|
38
|
+
end
|
|
39
|
+
def set(
|
|
40
|
+
# Path param: GrowSurf program ID.
|
|
41
|
+
id,
|
|
42
|
+
# Body param: The hostname to serve the program's landing pages from, with or
|
|
43
|
+
# without `https://`. Up to 255 characters.
|
|
44
|
+
domain:,
|
|
45
|
+
request_options: {}
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Checks the custom domain's DNS now and returns the result in `is_verified`. The
|
|
50
|
+
# first time the check passes, GrowSurf sets up the domain's SSL certificate; pages
|
|
51
|
+
# can take a few minutes to load over `https://` after that. If the record is wrong
|
|
52
|
+
# or has not propagated yet, `is_verified` stays `false`; call again later. More than
|
|
53
|
+
# one `CNAME` record on the hostname returns a `400`. Returns a `404` when no custom
|
|
54
|
+
# domain is set. A domain that is already verified is returned as is, without a new
|
|
55
|
+
# check.
|
|
56
|
+
sig do
|
|
57
|
+
params(
|
|
58
|
+
id: String,
|
|
59
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
60
|
+
).returns(GrowsurfRuby::Models::Campaign::CampaignCustomDomain)
|
|
61
|
+
end
|
|
62
|
+
def verify(
|
|
63
|
+
# GrowSurf program ID.
|
|
64
|
+
id,
|
|
65
|
+
request_options: {}
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Removes a program's custom domain. Its landing pages go back to their GrowSurf
|
|
70
|
+
# URL. Returns a `404` when no custom domain is set.
|
|
71
|
+
sig do
|
|
72
|
+
params(
|
|
73
|
+
id: String,
|
|
74
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
75
|
+
).returns(GrowsurfRuby::Models::Campaign::DeleteCampaignCustomDomainResponse)
|
|
76
|
+
end
|
|
77
|
+
def delete(
|
|
78
|
+
# GrowSurf program ID.
|
|
79
|
+
id,
|
|
80
|
+
request_options: {}
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# @api private
|
|
85
|
+
sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
|
|
86
|
+
def self.new(client:)
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -40,7 +40,8 @@ module GrowsurfRuby
|
|
|
40
40
|
# programs and hidden for referral programs, and `GET` returns every setting with its
|
|
41
41
|
# default copy.
|
|
42
42
|
# `participantAvatarStyle` is `CHARACTERS`, `INITIALS`, `ANIMALS`, or `GRADIENT`; missing or
|
|
43
|
-
# unknown values mean `INITIALS`.
|
|
43
|
+
# unknown values mean `INITIALS`. `visualStyle` is `GLOW`, `CLEAN`, `FLAT`, `ROUND`, `TINT`,
|
|
44
|
+
# or `GLASS`, and is omitted when the program has no saved Style.
|
|
44
45
|
# `payoutDestinationConfirmation` is omitted when no confirmation fields are stored. Stored
|
|
45
46
|
# `null` fields are returned as `null`; omitted and `null` fields use localized defaults.
|
|
46
47
|
sig do
|
|
@@ -65,8 +66,7 @@ module GrowsurfRuby
|
|
|
65
66
|
# values return a `400`. Landing-page custom code and JavaScript are not editable via the
|
|
66
67
|
# API.
|
|
67
68
|
# Changes to participant email content are checked before saving. Rejected content
|
|
68
|
-
# returns `400
|
|
69
|
-
# response saves the change. A concurrent edit can return `409`; reload the
|
|
69
|
+
# returns `400` and is not saved. A concurrent edit can return `409`; reload the
|
|
70
70
|
# program before retrying.
|
|
71
71
|
sig do
|
|
72
72
|
params(
|
|
@@ -34,8 +34,7 @@ module GrowsurfRuby
|
|
|
34
34
|
# (`settings.sender.fromEmail`, whose custom value requires dashboard domain
|
|
35
35
|
# verification).
|
|
36
36
|
# Changes to participant email content are checked before saving. Rejected content
|
|
37
|
-
# returns `400
|
|
38
|
-
# response saves the change. A concurrent edit can return `409`; reload the
|
|
37
|
+
# returns `400` and is not saved. A concurrent edit can return `409`; reload the
|
|
39
38
|
# program before retrying.
|
|
40
39
|
sig do
|
|
41
40
|
params(
|
|
@@ -28,8 +28,7 @@ module GrowsurfRuby
|
|
|
28
28
|
# redirect destinations, which may take a moment to complete. URLs must include an
|
|
29
29
|
# explicit `http://` or `https://` scheme.
|
|
30
30
|
# Changes to participant email content are checked before saving. Rejected content
|
|
31
|
-
# returns `400
|
|
32
|
-
# response saves the change. A concurrent edit can return `409`; reload the
|
|
31
|
+
# returns `400` and is not saved. A concurrent edit can return `409`; reload the
|
|
33
32
|
# program before retrying.
|
|
34
33
|
sig do
|
|
35
34
|
params(
|
|
@@ -29,12 +29,11 @@ module GrowsurfRuby
|
|
|
29
29
|
# and `payoutThreshold`/`taxDocumentation` are affiliate-only, and affiliate
|
|
30
30
|
# programs require `requireParticipantAuth: true`). `fraud.recaptcha.secretKey`
|
|
31
31
|
# is write-only. `referralCreditWindowDays: null` means "never expires".
|
|
32
|
-
# Turning on `languages.additionalLanguages`
|
|
33
|
-
#
|
|
34
|
-
# off,
|
|
32
|
+
# Turning on `languages.additionalLanguages` returns `403` if your account does
|
|
33
|
+
# not include additional languages. While any are on, every `languages` change,
|
|
34
|
+
# including turning them off, returns the same `403`.
|
|
35
35
|
# Changes to participant email content are checked before saving. Rejected content
|
|
36
|
-
# returns `400
|
|
37
|
-
# response saves the change. A concurrent edit can return `409`; reload the
|
|
36
|
+
# returns `400` and is not saved. A concurrent edit can return `409`; reload the
|
|
38
37
|
# program before retrying.
|
|
39
38
|
sig do
|
|
40
39
|
params(
|