growsurf-ruby 1.2.0 → 1.3.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 +21 -0
- data/LICENSE +201 -0
- data/README.md +1 -1
- data/lib/growsurf_ruby/internal/transport/base_client.rb +21 -4
- data/lib/growsurf_ruby/models/affiliate_application.rb +249 -0
- data/lib/growsurf_ruby/models/affiliate_application_list_response.rb +42 -0
- data/lib/growsurf_ruby/models/affiliate_invite.rb +109 -0
- data/lib/growsurf_ruby/models/affiliate_invite_list_response.rb +41 -0
- data/lib/growsurf_ruby/models/campaign/create.rb +12 -1
- data/lib/growsurf_ruby/models/campaign/participant.rb +79 -4
- data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +28 -17
- data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rb +28 -0
- data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rb +126 -0
- data/lib/growsurf_ruby/models/campaign/participant_list_payouts_params.rb +1 -0
- data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rb +50 -0
- data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rb +56 -0
- data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +14 -17
- data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +25 -9
- data/lib/growsurf_ruby/models/campaign/referral_source.rb +3 -0
- data/lib/growsurf_ruby/models/campaign/reward.rb +20 -3
- data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +3 -3
- data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +3 -3
- data/lib/growsurf_ruby/models/campaign.rb +2 -2
- data/lib/growsurf_ruby/models/campaign_create_affiliate_invite_params.rb +45 -0
- data/lib/growsurf_ruby/models/campaign_list_affiliate_applications_params.rb +57 -0
- data/lib/growsurf_ruby/models/campaign_list_affiliate_invites_params.rb +58 -0
- data/lib/growsurf_ruby/models/campaign_list_payouts_params.rb +1 -0
- data/lib/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rb +26 -0
- data/lib/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rb +26 -0
- data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +9 -6
- data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +59 -11
- data/lib/growsurf_ruby/models/campaign_review_affiliate_application_params.rb +94 -0
- data/lib/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rb +26 -0
- data/lib/growsurf_ruby/models/email_analytics.rb +41 -0
- data/lib/growsurf_ruby/models/participant_payout_list.rb +8 -1
- data/lib/growsurf_ruby/models/reward_tax_valuation.rb +24 -9
- data/lib/growsurf_ruby/models.rb +19 -0
- data/lib/growsurf_ruby/resources/account.rb +13 -3
- data/lib/growsurf_ruby/resources/campaign/commission.rb +3 -2
- data/lib/growsurf_ruby/resources/campaign/design.rb +14 -16
- data/lib/growsurf_ruby/resources/campaign/emails.rb +9 -11
- data/lib/growsurf_ruby/resources/campaign/installation.rb +8 -12
- data/lib/growsurf_ruby/resources/campaign/options.rb +11 -13
- data/lib/growsurf_ruby/resources/campaign/participant.rb +138 -44
- data/lib/growsurf_ruby/resources/campaign/reward.rb +4 -3
- data/lib/growsurf_ruby/resources/campaign/rewards.rb +20 -8
- data/lib/growsurf_ruby/resources/campaign.rb +245 -15
- data/lib/growsurf_ruby/resources/team.rb +22 -13
- data/lib/growsurf_ruby/version.rb +1 -1
- data/lib/growsurf_ruby.rb +16 -0
- data/rbi/growsurf_ruby/models/affiliate_application.rbi +431 -0
- data/rbi/growsurf_ruby/models/affiliate_application_list_response.rbi +70 -0
- data/rbi/growsurf_ruby/models/affiliate_invite.rbi +167 -0
- data/rbi/growsurf_ruby/models/affiliate_invite_list_response.rbi +70 -0
- data/rbi/growsurf_ruby/models/campaign/create.rbi +17 -0
- data/rbi/growsurf_ruby/models/campaign/participant.rbi +169 -3
- data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +3 -5
- data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -20
- data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +3 -1
- data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbi +48 -0
- data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +243 -0
- data/rbi/growsurf_ruby/models/campaign/participant_list_payouts_params.rbi +5 -0
- data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbi +100 -0
- data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +118 -0
- data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +22 -52
- data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +67 -11
- data/rbi/growsurf_ruby/models/campaign/referral_source.rbi +9 -0
- data/rbi/growsurf_ruby/models/campaign/reward.rbi +23 -2
- data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +4 -4
- data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +4 -4
- data/rbi/growsurf_ruby/models/campaign.rbi +2 -2
- data/rbi/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbi +74 -0
- data/rbi/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbi +130 -0
- data/rbi/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbi +135 -0
- data/rbi/growsurf_ruby/models/campaign_list_payouts_params.rbi +5 -0
- data/rbi/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbi +46 -0
- data/rbi/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbi +46 -0
- data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +15 -10
- data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +68 -18
- data/rbi/growsurf_ruby/models/campaign_review_affiliate_application_params.rbi +167 -0
- data/rbi/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbi +46 -0
- data/rbi/growsurf_ruby/models/email_analytics.rbi +200 -0
- data/rbi/growsurf_ruby/models/participant_payout_list.rbi +17 -3
- data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +66 -9
- data/rbi/growsurf_ruby/models.rbi +25 -0
- data/rbi/growsurf_ruby/resources/account.rbi +14 -0
- data/rbi/growsurf_ruby/resources/campaign/commission.rbi +3 -2
- data/rbi/growsurf_ruby/resources/campaign/design.rbi +11 -8
- data/rbi/growsurf_ruby/resources/campaign/emails.rbi +9 -6
- data/rbi/growsurf_ruby/resources/campaign/installation.rbi +8 -8
- data/rbi/growsurf_ruby/resources/campaign/options.rbi +11 -8
- data/rbi/growsurf_ruby/resources/campaign/participant.rbi +131 -46
- data/rbi/growsurf_ruby/resources/campaign/reward.rbi +4 -3
- data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +22 -10
- data/rbi/growsurf_ruby/resources/campaign.rbi +200 -18
- data/rbi/growsurf_ruby/resources/team.rbi +23 -0
- data/sig/growsurf_ruby/models/affiliate_application.rbs +192 -0
- data/sig/growsurf_ruby/models/affiliate_application_list_response.rbs +39 -0
- data/sig/growsurf_ruby/models/affiliate_invite.rbs +92 -0
- data/sig/growsurf_ruby/models/affiliate_invite_list_response.rbs +39 -0
- data/sig/growsurf_ruby/models/campaign/create.rbs +7 -0
- data/sig/growsurf_ruby/models/campaign/participant.rbs +62 -2
- data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +2 -11
- data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +12 -12
- data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbs +30 -0
- data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +107 -0
- data/sig/growsurf_ruby/models/campaign/participant_list_payouts_params.rbs +2 -1
- data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbs +49 -0
- data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +57 -0
- data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +5 -13
- data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +21 -7
- data/sig/growsurf_ruby/models/campaign/referral_source.rbs +4 -1
- data/sig/growsurf_ruby/models/campaign/reward.rbs +12 -0
- data/sig/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbs +40 -0
- data/sig/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbs +61 -0
- data/sig/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbs +62 -0
- data/sig/growsurf_ruby/models/campaign_list_payouts_params.rbs +2 -1
- data/sig/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbs +28 -0
- data/sig/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbs +28 -0
- data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +36 -16
- data/sig/growsurf_ruby/models/campaign_review_affiliate_application_params.rbs +79 -0
- data/sig/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbs +28 -0
- data/sig/growsurf_ruby/models/email_analytics.rbs +92 -0
- data/sig/growsurf_ruby/models/participant_payout_list.rbs +12 -4
- data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +26 -4
- data/sig/growsurf_ruby/models.rbs +18 -0
- data/sig/growsurf_ruby/resources/campaign/participant.rbs +16 -2
- data/sig/growsurf_ruby/resources/campaign.rbs +53 -0
- metadata +54 -3
|
@@ -61,10 +61,8 @@ module GrowsurfRuby
|
|
|
61
61
|
def list(request_options: {})
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
# Creates a program
|
|
65
|
-
#
|
|
66
|
-
# (design, emails, options, installation) is not accepted here — configure it via
|
|
67
|
-
# the config sub-resources after the program is created.
|
|
64
|
+
# Creates a new program, plus any optional campaign rewards. The new program is
|
|
65
|
+
# created in `DRAFT` status and owned by the API key's bound team.
|
|
68
66
|
sig do
|
|
69
67
|
params(
|
|
70
68
|
type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
|
|
@@ -84,7 +82,7 @@ module GrowsurfRuby
|
|
|
84
82
|
# ISO 4217 currency code. Defaults to USD. Chosen when the program is created and
|
|
85
83
|
# immutable afterward — it cannot be changed on update.
|
|
86
84
|
currency_iso: nil,
|
|
87
|
-
# The program name. Defaults to
|
|
85
|
+
# The program name. Defaults to a generated friendly label plus the creation date.
|
|
88
86
|
name: nil,
|
|
89
87
|
# Optional inline rewards to create with the program.
|
|
90
88
|
rewards: nil,
|
|
@@ -92,10 +90,11 @@ module GrowsurfRuby
|
|
|
92
90
|
)
|
|
93
91
|
end
|
|
94
92
|
|
|
95
|
-
# Updates a program's identity and lifecycle. Only the fields you send are
|
|
96
|
-
# `type`, `urlId`, and `currencyISO` are immutable. Editor-tab
|
|
97
|
-
# options, installation) is edited via the
|
|
98
|
-
# here.
|
|
93
|
+
# Updates a program's identity and lifecycle. Only the fields you send are
|
|
94
|
+
# changed. `type`, `urlId`, and `currencyISO` are immutable. Editor-tab
|
|
95
|
+
# configuration (design, emails, options, installation) is edited via the
|
|
96
|
+
# dedicated config sub-resources, not here. The program cannot be deleted via this
|
|
97
|
+
# endpoint.
|
|
99
98
|
sig do
|
|
100
99
|
params(
|
|
101
100
|
id: String,
|
|
@@ -122,7 +121,8 @@ module GrowsurfRuby
|
|
|
122
121
|
)
|
|
123
122
|
end
|
|
124
123
|
|
|
125
|
-
# Clones an existing program
|
|
124
|
+
# Clones an existing program into a new `DRAFT` program. Integrations and
|
|
125
|
+
# credentials are not copied; active rewards are cloned.
|
|
126
126
|
sig do
|
|
127
127
|
params(
|
|
128
128
|
id: String,
|
|
@@ -136,6 +136,31 @@ module GrowsurfRuby
|
|
|
136
136
|
)
|
|
137
137
|
end
|
|
138
138
|
|
|
139
|
+
# Invites someone to join the affiliate program. GrowSurf emails them a single-use
|
|
140
|
+
# accept link; accepting it enrolls them as an approved affiliate without going
|
|
141
|
+
# through the public application. One active invite can exist per email address.
|
|
142
|
+
sig do
|
|
143
|
+
params(
|
|
144
|
+
id: String,
|
|
145
|
+
email: String,
|
|
146
|
+
first_name: String,
|
|
147
|
+
last_name: String,
|
|
148
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
149
|
+
).returns(GrowsurfRuby::AffiliateInvite)
|
|
150
|
+
end
|
|
151
|
+
def create_affiliate_invite(
|
|
152
|
+
# GrowSurf program ID.
|
|
153
|
+
id,
|
|
154
|
+
# Valid email address to invite. Maximum 255 characters.
|
|
155
|
+
email:,
|
|
156
|
+
# Invitee first name, used in the invite email. Maximum 255 characters.
|
|
157
|
+
first_name: nil,
|
|
158
|
+
# Invitee last name. Maximum 255 characters.
|
|
159
|
+
last_name: nil,
|
|
160
|
+
request_options: {}
|
|
161
|
+
)
|
|
162
|
+
end
|
|
163
|
+
|
|
139
164
|
# Creates or returns a participant using the same input behavior as Add
|
|
140
165
|
# Participant, then returns a participant-scoped token for GrowSurf mobile SDK
|
|
141
166
|
# participant endpoints. Use this endpoint from your backend after your mobile app
|
|
@@ -179,7 +204,59 @@ module GrowsurfRuby
|
|
|
179
204
|
)
|
|
180
205
|
end
|
|
181
206
|
|
|
182
|
-
#
|
|
207
|
+
# Lists an affiliate program's applications, newest first. Applications exist on
|
|
208
|
+
# programs that review public signups (an `affiliateApplicationMode` of
|
|
209
|
+
# `MANUAL_REVIEW` or `AUTO_APPROVE`). A pending applicant is not a participant
|
|
210
|
+
# until their application is approved.
|
|
211
|
+
sig do
|
|
212
|
+
params(
|
|
213
|
+
id: String,
|
|
214
|
+
limit: Integer,
|
|
215
|
+
offset: Integer,
|
|
216
|
+
status:
|
|
217
|
+
GrowsurfRuby::CampaignListAffiliateApplicationsParams::Status::OrSymbol,
|
|
218
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
219
|
+
).returns(GrowsurfRuby::Models::AffiliateApplicationListResponse)
|
|
220
|
+
end
|
|
221
|
+
def list_affiliate_applications(
|
|
222
|
+
# GrowSurf program ID.
|
|
223
|
+
id,
|
|
224
|
+
# How many applications to return per page (1-100).
|
|
225
|
+
limit: nil,
|
|
226
|
+
# Offset number used to skip through a result set.
|
|
227
|
+
offset: nil,
|
|
228
|
+
# Only return applications with this status.
|
|
229
|
+
status: nil,
|
|
230
|
+
request_options: {}
|
|
231
|
+
)
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Lists an affiliate program's enrollment invites, newest first.
|
|
235
|
+
sig do
|
|
236
|
+
params(
|
|
237
|
+
id: String,
|
|
238
|
+
limit: Integer,
|
|
239
|
+
offset: Integer,
|
|
240
|
+
status:
|
|
241
|
+
GrowsurfRuby::CampaignListAffiliateInvitesParams::Status::OrSymbol,
|
|
242
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
243
|
+
).returns(GrowsurfRuby::Models::AffiliateInviteListResponse)
|
|
244
|
+
end
|
|
245
|
+
def list_affiliate_invites(
|
|
246
|
+
# GrowSurf program ID.
|
|
247
|
+
id,
|
|
248
|
+
# How many invites to return per page (1-100).
|
|
249
|
+
limit: nil,
|
|
250
|
+
# Offset number used to skip through a result set.
|
|
251
|
+
offset: nil,
|
|
252
|
+
# Only return invites with this status.
|
|
253
|
+
status: nil,
|
|
254
|
+
request_options: {}
|
|
255
|
+
)
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# **Affiliate programs only.** Retrieves a paged list of all participant
|
|
259
|
+
# commissions in an affiliate program.
|
|
183
260
|
sig do
|
|
184
261
|
params(
|
|
185
262
|
id: String,
|
|
@@ -249,7 +326,8 @@ module GrowsurfRuby
|
|
|
249
326
|
)
|
|
250
327
|
end
|
|
251
328
|
|
|
252
|
-
# Retrieves a paged list of all participant payouts
|
|
329
|
+
# **Affiliate programs only.** Retrieves a paged list of all participant payouts
|
|
330
|
+
# in an affiliate program.
|
|
253
331
|
sig do
|
|
254
332
|
params(
|
|
255
333
|
id: String,
|
|
@@ -313,7 +391,47 @@ module GrowsurfRuby
|
|
|
313
391
|
)
|
|
314
392
|
end
|
|
315
393
|
|
|
316
|
-
#
|
|
394
|
+
# Re-sends a pending invite with a fresh accept link (the previous link stops working).
|
|
395
|
+
# Resends are rate limited per invite; retry after a few minutes if a resend was just sent.
|
|
396
|
+
sig do
|
|
397
|
+
params(
|
|
398
|
+
invite_id: String,
|
|
399
|
+
id: String,
|
|
400
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
401
|
+
).returns(GrowsurfRuby::AffiliateInvite)
|
|
402
|
+
end
|
|
403
|
+
def resend_affiliate_invite(
|
|
404
|
+
# Affiliate invite ID.
|
|
405
|
+
invite_id,
|
|
406
|
+
# GrowSurf program ID.
|
|
407
|
+
id:,
|
|
408
|
+
request_options: {}
|
|
409
|
+
)
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
# Returns one affiliate application, including its submitted form answers.
|
|
413
|
+
sig do
|
|
414
|
+
params(
|
|
415
|
+
application_id: String,
|
|
416
|
+
id: String,
|
|
417
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
418
|
+
).returns(GrowsurfRuby::AffiliateApplication)
|
|
419
|
+
end
|
|
420
|
+
def retrieve_affiliate_application(
|
|
421
|
+
# Affiliate application ID.
|
|
422
|
+
application_id,
|
|
423
|
+
# GrowSurf program ID.
|
|
424
|
+
id:,
|
|
425
|
+
request_options: {}
|
|
426
|
+
)
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# Retrieves analytics for a program. Pass `interval` to also get a time-series (`series`)
|
|
430
|
+
# alongside the totals, and `include` to add previous-period totals, status breakdowns,
|
|
431
|
+
# derived rates, or email performance. Add `email` to `include` for `sent` (accepted for
|
|
432
|
+
# delivery), `delivered`, `opened`, `clicked`, `bounced`, and `spamComplaints` metrics plus
|
|
433
|
+
# per-email-type breakdowns. Email rates are ratios from `0` to `1`, and `isPartial`
|
|
434
|
+
# identifies windows that begin before complete coverage.
|
|
317
435
|
sig do
|
|
318
436
|
params(
|
|
319
437
|
id: String,
|
|
@@ -334,11 +452,14 @@ module GrowsurfRuby
|
|
|
334
452
|
# End date of the analytics timeframe as a Unix timestamp in milliseconds.
|
|
335
453
|
# Required if `days` is not set.
|
|
336
454
|
end_date: nil,
|
|
337
|
-
# Comma-separated list of optional
|
|
338
|
-
#
|
|
339
|
-
#
|
|
340
|
-
#
|
|
341
|
-
#
|
|
455
|
+
# Comma-separated list of optional data to include: `previousPeriod` adds totals for the
|
|
456
|
+
# equal-length window immediately before the requested one; `statusCounts` adds reward
|
|
457
|
+
# (and, for affiliate programs, affiliate/commission/payout) status breakdowns; `rates`
|
|
458
|
+
# adds derived referral rates; `email` adds `sent`, `delivered`, `opened`, `clicked`,
|
|
459
|
+
# `bounced`, `spamComplaints`, and per-email-type metrics. When `email` and an interval
|
|
460
|
+
# are both requested, each `series` item also contains counts for emails sent during that
|
|
461
|
+
# period. Combine `email` with `previousPeriod` to include the same email metrics in both
|
|
462
|
+
# windows.
|
|
342
463
|
include: nil,
|
|
343
464
|
# When set to `day`, `week`, or `month`, the response also includes a `series` array
|
|
344
465
|
# with per-period totals. Defaults to `total` (no series).
|
|
@@ -350,6 +471,67 @@ module GrowsurfRuby
|
|
|
350
471
|
)
|
|
351
472
|
end
|
|
352
473
|
|
|
474
|
+
# Decides a pending application. Set `status` to `APPROVED` to enroll the applicant
|
|
475
|
+
# (this creates the participant, or upgrades an existing participant with the same
|
|
476
|
+
# email), or to `DENIED` with an optional `rejectionReason`. A denied applicant may
|
|
477
|
+
# reapply after the program's reapplication cooldown; send an earlier
|
|
478
|
+
# `reapplyAllowedAt` (without `status`) to shorten that wait for one applicant.
|
|
479
|
+
# Provide exactly one of `status` or `reapplyAllowedAt`. Denial-only fields are
|
|
480
|
+
# only valid with `status` set to `DENIED`. Approval is idempotent: repeating it
|
|
481
|
+
# returns the same participant.
|
|
482
|
+
sig do
|
|
483
|
+
params(
|
|
484
|
+
application_id: String,
|
|
485
|
+
id: String,
|
|
486
|
+
allow_immediate_reapply: T::Boolean,
|
|
487
|
+
reapply_allowed_at: Integer,
|
|
488
|
+
rejection_reason: String,
|
|
489
|
+
review_note: String,
|
|
490
|
+
status:
|
|
491
|
+
GrowsurfRuby::CampaignReviewAffiliateApplicationParams::Status::OrSymbol,
|
|
492
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
493
|
+
).returns(GrowsurfRuby::AffiliateApplication)
|
|
494
|
+
end
|
|
495
|
+
def review_affiliate_application(
|
|
496
|
+
# Affiliate application ID.
|
|
497
|
+
application_id,
|
|
498
|
+
# GrowSurf program ID.
|
|
499
|
+
id:,
|
|
500
|
+
# Only valid when `status` is `DENIED`; let the applicant reapply right away.
|
|
501
|
+
allow_immediate_reapply: nil,
|
|
502
|
+
# For an already-denied application, move the reapplication window to this earlier
|
|
503
|
+
# time, in Unix milliseconds. Send without `status`.
|
|
504
|
+
reapply_allowed_at: nil,
|
|
505
|
+
# Short reason recorded with a denial. Only valid when `status` is `DENIED`.
|
|
506
|
+
# Maximum 255 characters.
|
|
507
|
+
rejection_reason: nil,
|
|
508
|
+
# Private note recorded with a denial. Only valid when `status` is `DENIED`; never
|
|
509
|
+
# shown to the applicant. Maximum 500 characters.
|
|
510
|
+
review_note: nil,
|
|
511
|
+
# The decision. `APPROVED` enrolls the applicant as an affiliate; `DENIED` closes
|
|
512
|
+
# the application.
|
|
513
|
+
status: nil,
|
|
514
|
+
request_options: {}
|
|
515
|
+
)
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
# Revokes a pending invite. Its emailed accept link stops working immediately.
|
|
519
|
+
sig do
|
|
520
|
+
params(
|
|
521
|
+
invite_id: String,
|
|
522
|
+
id: String,
|
|
523
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
524
|
+
).returns(GrowsurfRuby::AffiliateInvite)
|
|
525
|
+
end
|
|
526
|
+
def revoke_affiliate_invite(
|
|
527
|
+
# Affiliate invite ID.
|
|
528
|
+
invite_id,
|
|
529
|
+
# GrowSurf program ID.
|
|
530
|
+
id:,
|
|
531
|
+
request_options: {}
|
|
532
|
+
)
|
|
533
|
+
end
|
|
534
|
+
|
|
353
535
|
# @api private
|
|
354
536
|
sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
|
|
355
537
|
def self.new(client:)
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
module GrowsurfRuby
|
|
4
4
|
module Resources
|
|
5
5
|
class Team
|
|
6
|
+
# Retrieves the team bound to the API key or OAuth connection.
|
|
7
|
+
# `verificationStatus` is `VERIFIED` once GrowSurf has verified the team, which is
|
|
8
|
+
# required before a program can send participant emails.
|
|
6
9
|
sig do
|
|
7
10
|
params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
|
|
8
11
|
GrowsurfRuby::Models::Team
|
|
@@ -11,6 +14,9 @@ module GrowsurfRuby
|
|
|
11
14
|
def retrieve(request_options: {})
|
|
12
15
|
end
|
|
13
16
|
|
|
17
|
+
# Updates the name of the team bound to the API key or OAuth connection. Any other
|
|
18
|
+
# property is rejected with a `400`. Personal profiles, billing, and team
|
|
19
|
+
# ownership are not editable here.
|
|
14
20
|
sig do
|
|
15
21
|
params(
|
|
16
22
|
name: String,
|
|
@@ -20,6 +26,15 @@ module GrowsurfRuby
|
|
|
20
26
|
def update(name:, request_options: {})
|
|
21
27
|
end
|
|
22
28
|
|
|
29
|
+
# Generates a new API key and makes the key used on this request stop working when
|
|
30
|
+
# rotation succeeds. Send a unique, random `Idempotency-Key`. If the response is
|
|
31
|
+
# interrupted, immediately retry with the original API key and the same
|
|
32
|
+
# `Idempotency-Key` to receive the same new key. Update every integration that
|
|
33
|
+
# used the old key. The team owner is notified by email whenever the key is
|
|
34
|
+
# rotated. GrowSurf SDKs generate the idempotency key automatically. This endpoint
|
|
35
|
+
# accepts an API key with `api_key:rotate`. If this scope is unavailable, rotate
|
|
36
|
+
# the key in the authenticated dashboard instead. This operation is available only
|
|
37
|
+
# through the REST API or a GrowSurf API SDK, not through MCP.
|
|
23
38
|
sig do
|
|
24
39
|
params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
|
|
25
40
|
GrowsurfRuby::Models::TeamRotateAPIKeyResponse
|
|
@@ -28,6 +43,9 @@ module GrowsurfRuby
|
|
|
28
43
|
def rotate_api_key(request_options: {})
|
|
29
44
|
end
|
|
30
45
|
|
|
46
|
+
# Requests GrowSurf to verify the bound team (required before a program can email
|
|
47
|
+
# its participants). Idempotent — calling it again while a request is pending does
|
|
48
|
+
# not create a duplicate. Returns the team with its updated `verificationStatus`.
|
|
31
49
|
sig do
|
|
32
50
|
params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
|
|
33
51
|
GrowsurfRuby::Models::Team
|
|
@@ -36,6 +54,11 @@ module GrowsurfRuby
|
|
|
36
54
|
def request_verification(request_options: {})
|
|
37
55
|
end
|
|
38
56
|
|
|
57
|
+
# Resends the email-verification message to the bound team's owner. The response
|
|
58
|
+
# never reveals the owner's email address. A `200` with `status: SENT` is returned
|
|
59
|
+
# only when an email was actually dispatched. Returns `400` if the email is
|
|
60
|
+
# already verified, and `429` if a verification email was sent too recently — wait
|
|
61
|
+
# a moment, then retry.
|
|
39
62
|
sig do
|
|
40
63
|
params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
|
|
41
64
|
GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
module GrowsurfRuby
|
|
2
|
+
module Models
|
|
3
|
+
type affiliate_application =
|
|
4
|
+
{
|
|
5
|
+
answers: ::Array[GrowsurfRuby::AffiliateApplication::Answer],
|
|
6
|
+
created_at: Integer,
|
|
7
|
+
decided_at: Integer?,
|
|
8
|
+
email: String?,
|
|
9
|
+
first_name: String?,
|
|
10
|
+
id: String,
|
|
11
|
+
last_name: String?,
|
|
12
|
+
participant_id: String?,
|
|
13
|
+
reapply_allowed_at: Integer?,
|
|
14
|
+
rejection_reason: String?,
|
|
15
|
+
reviewed_at: Integer?,
|
|
16
|
+
risk_level: GrowsurfRuby::Models::AffiliateApplication::risk_level?,
|
|
17
|
+
status: GrowsurfRuby::Models::AffiliateApplication::status,
|
|
18
|
+
terms_accepted_at: Integer?
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
class AffiliateApplication < GrowsurfRuby::Internal::Type::BaseModel
|
|
22
|
+
attr_reader answers: ::Array[GrowsurfRuby::AffiliateApplication::Answer]
|
|
23
|
+
|
|
24
|
+
def answers=: (
|
|
25
|
+
::Array[GrowsurfRuby::AffiliateApplication::Answer]
|
|
26
|
+
) -> ::Array[GrowsurfRuby::AffiliateApplication::Answer]
|
|
27
|
+
|
|
28
|
+
attr_reader created_at: Integer
|
|
29
|
+
|
|
30
|
+
def created_at=: (Integer) -> Integer
|
|
31
|
+
|
|
32
|
+
attr_accessor decided_at: Integer?
|
|
33
|
+
|
|
34
|
+
attr_accessor email: String?
|
|
35
|
+
|
|
36
|
+
attr_accessor first_name: String?
|
|
37
|
+
|
|
38
|
+
attr_reader id: String
|
|
39
|
+
|
|
40
|
+
def id=: (String) -> String
|
|
41
|
+
|
|
42
|
+
attr_accessor last_name: String?
|
|
43
|
+
|
|
44
|
+
attr_accessor participant_id: String?
|
|
45
|
+
|
|
46
|
+
attr_accessor reapply_allowed_at: Integer?
|
|
47
|
+
|
|
48
|
+
attr_accessor rejection_reason: String?
|
|
49
|
+
|
|
50
|
+
attr_accessor reviewed_at: Integer?
|
|
51
|
+
|
|
52
|
+
attr_accessor risk_level: GrowsurfRuby::Models::AffiliateApplication::risk_level?
|
|
53
|
+
|
|
54
|
+
attr_reader status: GrowsurfRuby::Models::AffiliateApplication::status
|
|
55
|
+
|
|
56
|
+
def status=: (
|
|
57
|
+
GrowsurfRuby::Models::AffiliateApplication::status
|
|
58
|
+
) -> GrowsurfRuby::Models::AffiliateApplication::status
|
|
59
|
+
|
|
60
|
+
attr_reader terms_accepted_at: Integer?
|
|
61
|
+
|
|
62
|
+
def terms_accepted_at=: (Integer?) -> Integer?
|
|
63
|
+
|
|
64
|
+
def initialize: (
|
|
65
|
+
answers: ::Array[GrowsurfRuby::AffiliateApplication::Answer],
|
|
66
|
+
created_at: Integer,
|
|
67
|
+
decided_at: Integer?,
|
|
68
|
+
email: String?,
|
|
69
|
+
first_name: String?,
|
|
70
|
+
id: String,
|
|
71
|
+
last_name: String?,
|
|
72
|
+
participant_id: String?,
|
|
73
|
+
reapply_allowed_at: Integer?,
|
|
74
|
+
rejection_reason: String?,
|
|
75
|
+
reviewed_at: Integer?,
|
|
76
|
+
risk_level: GrowsurfRuby::Models::AffiliateApplication::risk_level?,
|
|
77
|
+
status: GrowsurfRuby::Models::AffiliateApplication::status,
|
|
78
|
+
terms_accepted_at: Integer?
|
|
79
|
+
) -> void
|
|
80
|
+
|
|
81
|
+
def to_hash: -> {
|
|
82
|
+
answers: ::Array[GrowsurfRuby::AffiliateApplication::Answer],
|
|
83
|
+
created_at: Integer,
|
|
84
|
+
decided_at: Integer?,
|
|
85
|
+
email: String?,
|
|
86
|
+
first_name: String?,
|
|
87
|
+
id: String,
|
|
88
|
+
last_name: String?,
|
|
89
|
+
participant_id: String?,
|
|
90
|
+
reapply_allowed_at: Integer?,
|
|
91
|
+
rejection_reason: String?,
|
|
92
|
+
reviewed_at: Integer?,
|
|
93
|
+
risk_level: GrowsurfRuby::Models::AffiliateApplication::risk_level?,
|
|
94
|
+
status: GrowsurfRuby::Models::AffiliateApplication::status,
|
|
95
|
+
terms_accepted_at: Integer?
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
type answer =
|
|
99
|
+
{
|
|
100
|
+
field_id: String,
|
|
101
|
+
label: String,
|
|
102
|
+
type: GrowsurfRuby::Models::AffiliateApplication::answer_type,
|
|
103
|
+
value: String | Integer | Float | bool
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
class Answer < GrowsurfRuby::Internal::Type::BaseModel
|
|
107
|
+
attr_reader field_id: String
|
|
108
|
+
|
|
109
|
+
def field_id=: (String) -> String
|
|
110
|
+
|
|
111
|
+
attr_reader label: String
|
|
112
|
+
|
|
113
|
+
def label=: (String) -> String
|
|
114
|
+
|
|
115
|
+
attr_reader type: GrowsurfRuby::Models::AffiliateApplication::answer_type
|
|
116
|
+
|
|
117
|
+
def type=: (
|
|
118
|
+
GrowsurfRuby::Models::AffiliateApplication::answer_type
|
|
119
|
+
) -> GrowsurfRuby::Models::AffiliateApplication::answer_type
|
|
120
|
+
|
|
121
|
+
attr_reader value: String | Integer | Float | bool
|
|
122
|
+
|
|
123
|
+
def value=: (
|
|
124
|
+
String | Integer | Float | bool
|
|
125
|
+
) -> (String | Integer | Float | bool)
|
|
126
|
+
|
|
127
|
+
def initialize: (
|
|
128
|
+
field_id: String,
|
|
129
|
+
label: String,
|
|
130
|
+
type: GrowsurfRuby::Models::AffiliateApplication::answer_type,
|
|
131
|
+
value: String | Integer | Float | bool
|
|
132
|
+
) -> void
|
|
133
|
+
|
|
134
|
+
def to_hash: -> {
|
|
135
|
+
field_id: String,
|
|
136
|
+
label: String,
|
|
137
|
+
type: GrowsurfRuby::Models::AffiliateApplication::answer_type,
|
|
138
|
+
value: String | Integer | Float | bool
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
module Type
|
|
142
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
143
|
+
|
|
144
|
+
TEXT: :text
|
|
145
|
+
TEXTAREA: :textarea
|
|
146
|
+
URL: :url
|
|
147
|
+
COUNTRY: :country
|
|
148
|
+
NUMBER: :number
|
|
149
|
+
DROPDOWN: :dropdown
|
|
150
|
+
RADIO: :radio
|
|
151
|
+
CHECKBOX: :checkbox
|
|
152
|
+
|
|
153
|
+
def self?.values: -> ::Array[GrowsurfRuby::Models::AffiliateApplication::answer_type]
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
type answer_type =
|
|
158
|
+
:text
|
|
159
|
+
| :textarea
|
|
160
|
+
| :url
|
|
161
|
+
| :country
|
|
162
|
+
| :number
|
|
163
|
+
| :dropdown
|
|
164
|
+
| :radio
|
|
165
|
+
| :checkbox
|
|
166
|
+
|
|
167
|
+
type risk_level = :LOW | :MEDIUM | :HIGH
|
|
168
|
+
|
|
169
|
+
module RiskLevel
|
|
170
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
171
|
+
|
|
172
|
+
LOW: :LOW
|
|
173
|
+
MEDIUM: :MEDIUM
|
|
174
|
+
HIGH: :HIGH
|
|
175
|
+
|
|
176
|
+
def self?.values: -> ::Array[GrowsurfRuby::Models::AffiliateApplication::risk_level]
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
type status = :PENDING | :APPROVED | :DENIED
|
|
180
|
+
|
|
181
|
+
module Status
|
|
182
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
183
|
+
|
|
184
|
+
PENDING: :PENDING
|
|
185
|
+
APPROVED: :APPROVED
|
|
186
|
+
DENIED: :DENIED
|
|
187
|
+
|
|
188
|
+
def self?.values: -> ::Array[GrowsurfRuby::Models::AffiliateApplication::status]
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module GrowsurfRuby
|
|
2
|
+
module Models
|
|
3
|
+
type affiliate_application_list_response =
|
|
4
|
+
{
|
|
5
|
+
applications: ::Array[GrowsurfRuby::AffiliateApplication],
|
|
6
|
+
total: Integer,
|
|
7
|
+
limit: Integer,
|
|
8
|
+
offset: Integer
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class AffiliateApplicationListResponse < GrowsurfRuby::Internal::Type::BaseModel
|
|
12
|
+
attr_accessor applications: ::Array[GrowsurfRuby::AffiliateApplication]
|
|
13
|
+
|
|
14
|
+
attr_accessor total: Integer
|
|
15
|
+
|
|
16
|
+
attr_reader limit: Integer?
|
|
17
|
+
|
|
18
|
+
def limit=: (Integer) -> Integer
|
|
19
|
+
|
|
20
|
+
attr_reader offset: Integer?
|
|
21
|
+
|
|
22
|
+
def offset=: (Integer) -> Integer
|
|
23
|
+
|
|
24
|
+
def initialize: (
|
|
25
|
+
applications: ::Array[GrowsurfRuby::AffiliateApplication],
|
|
26
|
+
total: Integer,
|
|
27
|
+
?limit: Integer,
|
|
28
|
+
?offset: Integer
|
|
29
|
+
) -> void
|
|
30
|
+
|
|
31
|
+
def to_hash: -> {
|
|
32
|
+
applications: ::Array[GrowsurfRuby::AffiliateApplication],
|
|
33
|
+
total: Integer,
|
|
34
|
+
limit: Integer,
|
|
35
|
+
offset: Integer
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
module GrowsurfRuby
|
|
2
|
+
module Models
|
|
3
|
+
type affiliate_invite =
|
|
4
|
+
{
|
|
5
|
+
accepted_at: Integer?,
|
|
6
|
+
created_at: Integer,
|
|
7
|
+
email: String,
|
|
8
|
+
expires_at: Integer,
|
|
9
|
+
first_name: String?,
|
|
10
|
+
id: String,
|
|
11
|
+
last_name: String?,
|
|
12
|
+
last_sent_at: Integer,
|
|
13
|
+
revoked_at: Integer?,
|
|
14
|
+
status: GrowsurfRuby::Models::AffiliateInvite::status
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class AffiliateInvite < GrowsurfRuby::Internal::Type::BaseModel
|
|
18
|
+
attr_accessor accepted_at: Integer?
|
|
19
|
+
|
|
20
|
+
attr_reader created_at: Integer?
|
|
21
|
+
|
|
22
|
+
def created_at=: (Integer) -> Integer
|
|
23
|
+
|
|
24
|
+
attr_reader email: String?
|
|
25
|
+
|
|
26
|
+
def email=: (String) -> String
|
|
27
|
+
|
|
28
|
+
attr_reader expires_at: Integer?
|
|
29
|
+
|
|
30
|
+
def expires_at=: (Integer) -> Integer
|
|
31
|
+
|
|
32
|
+
attr_accessor first_name: String?
|
|
33
|
+
|
|
34
|
+
attr_reader id: String?
|
|
35
|
+
|
|
36
|
+
def id=: (String) -> String
|
|
37
|
+
|
|
38
|
+
attr_accessor last_name: String?
|
|
39
|
+
|
|
40
|
+
attr_reader last_sent_at: Integer?
|
|
41
|
+
|
|
42
|
+
def last_sent_at=: (Integer) -> Integer
|
|
43
|
+
|
|
44
|
+
attr_accessor revoked_at: Integer?
|
|
45
|
+
|
|
46
|
+
attr_reader status: GrowsurfRuby::Models::AffiliateInvite::status?
|
|
47
|
+
|
|
48
|
+
def status=: (
|
|
49
|
+
GrowsurfRuby::Models::AffiliateInvite::status
|
|
50
|
+
) -> GrowsurfRuby::Models::AffiliateInvite::status
|
|
51
|
+
|
|
52
|
+
def initialize: (
|
|
53
|
+
?accepted_at: Integer?,
|
|
54
|
+
?created_at: Integer,
|
|
55
|
+
?email: String,
|
|
56
|
+
?expires_at: Integer,
|
|
57
|
+
?first_name: String?,
|
|
58
|
+
?id: String,
|
|
59
|
+
?last_name: String?,
|
|
60
|
+
?last_sent_at: Integer,
|
|
61
|
+
?revoked_at: Integer?,
|
|
62
|
+
?status: GrowsurfRuby::Models::AffiliateInvite::status
|
|
63
|
+
) -> void
|
|
64
|
+
|
|
65
|
+
def to_hash: -> {
|
|
66
|
+
accepted_at: Integer?,
|
|
67
|
+
created_at: Integer,
|
|
68
|
+
email: String,
|
|
69
|
+
expires_at: Integer,
|
|
70
|
+
first_name: String?,
|
|
71
|
+
id: String,
|
|
72
|
+
last_name: String?,
|
|
73
|
+
last_sent_at: Integer,
|
|
74
|
+
revoked_at: Integer?,
|
|
75
|
+
status: GrowsurfRuby::Models::AffiliateInvite::status
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
type status = :PENDING | :ACCEPTED | :EXPIRED | :REVOKED
|
|
79
|
+
|
|
80
|
+
module Status
|
|
81
|
+
extend GrowsurfRuby::Internal::Type::Enum
|
|
82
|
+
|
|
83
|
+
PENDING: :PENDING
|
|
84
|
+
ACCEPTED: :ACCEPTED
|
|
85
|
+
EXPIRED: :EXPIRED
|
|
86
|
+
REVOKED: :REVOKED
|
|
87
|
+
|
|
88
|
+
def self?.values: -> ::Array[GrowsurfRuby::Models::AffiliateInvite::status]
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|