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
|
@@ -76,10 +76,8 @@ module GrowsurfRuby
|
|
|
76
76
|
)
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
-
# Creates a program
|
|
80
|
-
#
|
|
81
|
-
# installation) is not accepted here — configure it via the config sub-resources
|
|
82
|
-
# (e.g. `campaign.options.update`) after the program is created.
|
|
79
|
+
# Creates a new program, plus any optional campaign rewards. The new program is
|
|
80
|
+
# created in `DRAFT` status and owned by the API key's bound team.
|
|
83
81
|
#
|
|
84
82
|
# @overload create(type:, company_logo_image_url: nil, company_name: nil, currency_iso: nil, name: nil, rewards: nil, request_options: {})
|
|
85
83
|
#
|
|
@@ -91,7 +89,7 @@ module GrowsurfRuby
|
|
|
91
89
|
#
|
|
92
90
|
# @param currency_iso [String] ISO 4217 currency code. Defaults to USD. Chosen when the program is created and immutable afterward — it cannot be changed on update.
|
|
93
91
|
#
|
|
94
|
-
# @param name [String] The program name. Defaults to
|
|
92
|
+
# @param name [String] The program name. Defaults to a generated friendly label plus the creation date.
|
|
95
93
|
#
|
|
96
94
|
# @param rewards [Array<GrowsurfRuby::Models::Campaign::RewardCreateParams>] Optional inline rewards to create with the program.
|
|
97
95
|
#
|
|
@@ -111,11 +109,11 @@ module GrowsurfRuby
|
|
|
111
109
|
)
|
|
112
110
|
end
|
|
113
111
|
|
|
114
|
-
# Updates a program's identity and lifecycle. Only the fields you send are
|
|
115
|
-
# `type`, `urlId`, and `currencyISO` are immutable. Editor-tab
|
|
116
|
-
# options, installation) is edited via the
|
|
117
|
-
#
|
|
118
|
-
#
|
|
112
|
+
# Updates a program's identity and lifecycle. Only the fields you send are
|
|
113
|
+
# changed. `type`, `urlId`, and `currencyISO` are immutable. Editor-tab
|
|
114
|
+
# configuration (design, emails, options, installation) is edited via the
|
|
115
|
+
# dedicated config sub-resources, not here. The program cannot be deleted via this
|
|
116
|
+
# endpoint.
|
|
119
117
|
#
|
|
120
118
|
# @overload update(id, company_logo_image_url: nil, company_name: nil, name: nil, status: nil, request_options: {})
|
|
121
119
|
#
|
|
@@ -145,7 +143,8 @@ module GrowsurfRuby
|
|
|
145
143
|
)
|
|
146
144
|
end
|
|
147
145
|
|
|
148
|
-
# Clones an existing program
|
|
146
|
+
# Clones an existing program into a new `DRAFT` program. Integrations and
|
|
147
|
+
# credentials are not copied; active rewards are cloned.
|
|
149
148
|
#
|
|
150
149
|
# @overload clone(id, request_options: {})
|
|
151
150
|
#
|
|
@@ -163,6 +162,36 @@ module GrowsurfRuby
|
|
|
163
162
|
)
|
|
164
163
|
end
|
|
165
164
|
|
|
165
|
+
# Invites someone to join the affiliate program. GrowSurf emails them a single-use
|
|
166
|
+
# accept link; accepting it enrolls them as an approved affiliate without going
|
|
167
|
+
# through the public application. One active invite can exist per email address.
|
|
168
|
+
#
|
|
169
|
+
# @overload create_affiliate_invite(id, email:, first_name: nil, last_name: nil, request_options: {})
|
|
170
|
+
#
|
|
171
|
+
# @param id [String] GrowSurf program ID.
|
|
172
|
+
#
|
|
173
|
+
# @param email [String] Valid email address to invite. Maximum 255 characters.
|
|
174
|
+
#
|
|
175
|
+
# @param first_name [String] Invitee first name, used in the invite email. Maximum 255 characters.
|
|
176
|
+
#
|
|
177
|
+
# @param last_name [String] Invitee last name. Maximum 255 characters.
|
|
178
|
+
#
|
|
179
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
180
|
+
#
|
|
181
|
+
# @return [GrowsurfRuby::Models::AffiliateInvite]
|
|
182
|
+
#
|
|
183
|
+
# @see GrowsurfRuby::Models::CampaignCreateAffiliateInviteParams
|
|
184
|
+
def create_affiliate_invite(id, params)
|
|
185
|
+
parsed, options = GrowsurfRuby::CampaignCreateAffiliateInviteParams.dump_request(params)
|
|
186
|
+
@client.request(
|
|
187
|
+
method: :post,
|
|
188
|
+
path: ["campaign/%1$s/affiliate-invites", id],
|
|
189
|
+
body: parsed,
|
|
190
|
+
model: GrowsurfRuby::AffiliateInvite,
|
|
191
|
+
options: options
|
|
192
|
+
)
|
|
193
|
+
end
|
|
194
|
+
|
|
166
195
|
# Some parameter documentations has been truncated, see
|
|
167
196
|
# {GrowsurfRuby::Models::CampaignCreateMobileParticipantTokenParams} for more
|
|
168
197
|
# details.
|
|
@@ -210,7 +239,69 @@ module GrowsurfRuby
|
|
|
210
239
|
)
|
|
211
240
|
end
|
|
212
241
|
|
|
213
|
-
#
|
|
242
|
+
# Lists an affiliate program's applications, newest first. Applications exist on
|
|
243
|
+
# programs that review public signups (an `affiliateApplicationMode` of
|
|
244
|
+
# `MANUAL_REVIEW` or `AUTO_APPROVE`). A pending applicant is not a participant
|
|
245
|
+
# until their application is approved.
|
|
246
|
+
#
|
|
247
|
+
# @overload list_affiliate_applications(id, limit: nil, offset: nil, status: nil, request_options: {})
|
|
248
|
+
#
|
|
249
|
+
# @param id [String] GrowSurf program ID.
|
|
250
|
+
#
|
|
251
|
+
# @param limit [Integer] How many applications to return per page (1-100).
|
|
252
|
+
#
|
|
253
|
+
# @param offset [Integer] Offset number used to skip through a result set.
|
|
254
|
+
#
|
|
255
|
+
# @param status [Symbol, GrowsurfRuby::Models::CampaignListAffiliateApplicationsParams::Status] Only return applications with this status.
|
|
256
|
+
#
|
|
257
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
258
|
+
#
|
|
259
|
+
# @return [GrowsurfRuby::Models::AffiliateApplicationListResponse]
|
|
260
|
+
#
|
|
261
|
+
# @see GrowsurfRuby::Models::CampaignListAffiliateApplicationsParams
|
|
262
|
+
def list_affiliate_applications(id, params = {})
|
|
263
|
+
parsed, options = GrowsurfRuby::CampaignListAffiliateApplicationsParams.dump_request(params)
|
|
264
|
+
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
265
|
+
@client.request(
|
|
266
|
+
method: :get,
|
|
267
|
+
path: ["campaign/%1$s/affiliate-applications", id],
|
|
268
|
+
query: query,
|
|
269
|
+
model: GrowsurfRuby::Models::AffiliateApplicationListResponse,
|
|
270
|
+
options: options
|
|
271
|
+
)
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Lists an affiliate program's enrollment invites, newest first.
|
|
275
|
+
#
|
|
276
|
+
# @overload list_affiliate_invites(id, limit: nil, offset: nil, status: nil, request_options: {})
|
|
277
|
+
#
|
|
278
|
+
# @param id [String] GrowSurf program ID.
|
|
279
|
+
#
|
|
280
|
+
# @param limit [Integer] How many invites to return per page (1-100).
|
|
281
|
+
#
|
|
282
|
+
# @param offset [Integer] Offset number used to skip through a result set.
|
|
283
|
+
#
|
|
284
|
+
# @param status [Symbol, GrowsurfRuby::Models::CampaignListAffiliateInvitesParams::Status] Only return invites with this status.
|
|
285
|
+
#
|
|
286
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
287
|
+
#
|
|
288
|
+
# @return [GrowsurfRuby::Models::AffiliateInviteListResponse]
|
|
289
|
+
#
|
|
290
|
+
# @see GrowsurfRuby::Models::CampaignListAffiliateInvitesParams
|
|
291
|
+
def list_affiliate_invites(id, params = {})
|
|
292
|
+
parsed, options = GrowsurfRuby::CampaignListAffiliateInvitesParams.dump_request(params)
|
|
293
|
+
query = GrowsurfRuby::Internal::Util.encode_query_params(parsed)
|
|
294
|
+
@client.request(
|
|
295
|
+
method: :get,
|
|
296
|
+
path: ["campaign/%1$s/affiliate-invites", id],
|
|
297
|
+
query: query,
|
|
298
|
+
model: GrowsurfRuby::Models::AffiliateInviteListResponse,
|
|
299
|
+
options: options
|
|
300
|
+
)
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# **Affiliate programs only.** Retrieves a paged list of all participant
|
|
304
|
+
# commissions in an affiliate program.
|
|
214
305
|
#
|
|
215
306
|
# @overload list_commissions(id, limit: nil, next_id: nil, status: nil, request_options: {})
|
|
216
307
|
#
|
|
@@ -301,7 +392,8 @@ module GrowsurfRuby
|
|
|
301
392
|
)
|
|
302
393
|
end
|
|
303
394
|
|
|
304
|
-
# Retrieves a paged list of all participant payouts
|
|
395
|
+
# **Affiliate programs only.** Retrieves a paged list of all participant payouts
|
|
396
|
+
# in an affiliate program.
|
|
305
397
|
#
|
|
306
398
|
# @overload list_payouts(id, limit: nil, next_id: nil, status: nil, request_options: {})
|
|
307
399
|
#
|
|
@@ -378,10 +470,72 @@ module GrowsurfRuby
|
|
|
378
470
|
)
|
|
379
471
|
end
|
|
380
472
|
|
|
473
|
+
# Re-sends a pending invite with a fresh accept link (the previous link stops
|
|
474
|
+
# working). Resends are rate limited per invite; retry after a few minutes if a
|
|
475
|
+
# resend was just sent.
|
|
476
|
+
#
|
|
477
|
+
# @overload resend_affiliate_invite(invite_id, id:, request_options: {})
|
|
478
|
+
#
|
|
479
|
+
# @param invite_id [String] Affiliate invite ID.
|
|
480
|
+
#
|
|
481
|
+
# @param id [String] GrowSurf program ID.
|
|
482
|
+
#
|
|
483
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
484
|
+
#
|
|
485
|
+
# @return [GrowsurfRuby::Models::AffiliateInvite]
|
|
486
|
+
#
|
|
487
|
+
# @see GrowsurfRuby::Models::CampaignResendAffiliateInviteParams
|
|
488
|
+
def resend_affiliate_invite(invite_id, params)
|
|
489
|
+
parsed, options = GrowsurfRuby::CampaignResendAffiliateInviteParams.dump_request(params)
|
|
490
|
+
id =
|
|
491
|
+
parsed.delete(:id) do
|
|
492
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
493
|
+
end
|
|
494
|
+
@client.request(
|
|
495
|
+
method: :post,
|
|
496
|
+
path: ["campaign/%1$s/affiliate-invites/%2$s/resend", id, invite_id],
|
|
497
|
+
model: GrowsurfRuby::AffiliateInvite,
|
|
498
|
+
options: options
|
|
499
|
+
)
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
# Returns one affiliate application, including its submitted form answers.
|
|
503
|
+
#
|
|
504
|
+
# @overload retrieve_affiliate_application(application_id, id:, request_options: {})
|
|
505
|
+
#
|
|
506
|
+
# @param application_id [String] Affiliate application ID.
|
|
507
|
+
#
|
|
508
|
+
# @param id [String] GrowSurf program ID.
|
|
509
|
+
#
|
|
510
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
511
|
+
#
|
|
512
|
+
# @return [GrowsurfRuby::Models::AffiliateApplication]
|
|
513
|
+
#
|
|
514
|
+
# @see GrowsurfRuby::Models::CampaignRetrieveAffiliateApplicationParams
|
|
515
|
+
def retrieve_affiliate_application(application_id, params)
|
|
516
|
+
parsed, options = GrowsurfRuby::CampaignRetrieveAffiliateApplicationParams.dump_request(params)
|
|
517
|
+
id =
|
|
518
|
+
parsed.delete(:id) do
|
|
519
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
520
|
+
end
|
|
521
|
+
@client.request(
|
|
522
|
+
method: :get,
|
|
523
|
+
path: ["campaign/%1$s/affiliate-applications/%2$s", id, application_id],
|
|
524
|
+
model: GrowsurfRuby::AffiliateApplication,
|
|
525
|
+
options: options
|
|
526
|
+
)
|
|
527
|
+
end
|
|
528
|
+
|
|
381
529
|
# Some parameter documentations has been truncated, see
|
|
382
530
|
# {GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams} for more details.
|
|
383
531
|
#
|
|
384
|
-
# Retrieves analytics for a program.
|
|
532
|
+
# Retrieves analytics for a program. Pass `interval` to also get a time-series
|
|
533
|
+
# (`series`) alongside the totals, and `include` to add previous-period totals,
|
|
534
|
+
# status breakdowns, derived rates, or email performance. Add `email` to `include`
|
|
535
|
+
# for `sent` (accepted for delivery), `delivered`, `opened`, `clicked`, `bounced`,
|
|
536
|
+
# and `spamComplaints` metrics plus per-email-type breakdowns. Email rates are
|
|
537
|
+
# ratios from `0` to `1`, and `isPartial` identifies windows that begin before
|
|
538
|
+
# complete coverage.
|
|
385
539
|
#
|
|
386
540
|
# @overload retrieve_analytics(id, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
|
|
387
541
|
#
|
|
@@ -391,7 +545,7 @@ module GrowsurfRuby
|
|
|
391
545
|
#
|
|
392
546
|
# @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
|
|
393
547
|
#
|
|
394
|
-
# @param include [String] Comma-separated list of optional
|
|
548
|
+
# @param include [String] Comma-separated list of optional data to include: `previousPeriod` adds totals for
|
|
395
549
|
#
|
|
396
550
|
# @param interval [Symbol, GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Interval] When set to `day`, `week`, or `month`, the response also includes a `series` array
|
|
397
551
|
#
|
|
@@ -414,6 +568,82 @@ module GrowsurfRuby
|
|
|
414
568
|
)
|
|
415
569
|
end
|
|
416
570
|
|
|
571
|
+
# Some parameter documentations has been truncated, see
|
|
572
|
+
# {GrowsurfRuby::Models::CampaignReviewAffiliateApplicationParams} for more
|
|
573
|
+
# details.
|
|
574
|
+
#
|
|
575
|
+
# Decides a pending application. Set `status` to `APPROVED` to enroll the applicant
|
|
576
|
+
# (this creates the participant, or upgrades an existing participant with the same
|
|
577
|
+
# email), or to `DENIED` with an optional `rejectionReason`. A denied applicant may
|
|
578
|
+
# reapply after the program's reapplication cooldown; send an earlier
|
|
579
|
+
# `reapplyAllowedAt` (without `status`) to shorten that wait for one applicant.
|
|
580
|
+
# Provide exactly one of `status` or `reapplyAllowedAt`. Denial-only fields are
|
|
581
|
+
# only valid with `status` set to `DENIED`. Approval is idempotent: repeating it
|
|
582
|
+
# returns the same participant.
|
|
583
|
+
#
|
|
584
|
+
# @overload review_affiliate_application(application_id, id:, allow_immediate_reapply: nil, reapply_allowed_at: nil, rejection_reason: nil, review_note: nil, status: nil, request_options: {})
|
|
585
|
+
#
|
|
586
|
+
# @param application_id [String] Affiliate application ID.
|
|
587
|
+
#
|
|
588
|
+
# @param id [String] GrowSurf program ID.
|
|
589
|
+
#
|
|
590
|
+
# @param allow_immediate_reapply [Boolean] Only valid when `status` is `DENIED`; let the applicant reapply right away
|
|
591
|
+
#
|
|
592
|
+
# @param reapply_allowed_at [Integer] For an already-denied application, move the reapplication window to this earlier
|
|
593
|
+
#
|
|
594
|
+
# @param rejection_reason [String] Short reason recorded with a denial. Only valid when `status` is `DENIED`. Maximum 255 characters.
|
|
595
|
+
#
|
|
596
|
+
# @param review_note [String] Private note recorded with a denial. Only valid when `status` is `DENIED`; never shown to the applicant. Maximum 500 characters.
|
|
597
|
+
#
|
|
598
|
+
# @param status [Symbol, GrowsurfRuby::Models::CampaignReviewAffiliateApplicationParams::Status] The decision. `APPROVED` enrolls the applicant as an affiliate; `DENIED` closes
|
|
599
|
+
#
|
|
600
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
601
|
+
#
|
|
602
|
+
# @return [GrowsurfRuby::Models::AffiliateApplication]
|
|
603
|
+
#
|
|
604
|
+
# @see GrowsurfRuby::Models::CampaignReviewAffiliateApplicationParams
|
|
605
|
+
def review_affiliate_application(application_id, params)
|
|
606
|
+
parsed, options = GrowsurfRuby::CampaignReviewAffiliateApplicationParams.dump_request(params)
|
|
607
|
+
id =
|
|
608
|
+
parsed.delete(:id) do
|
|
609
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
610
|
+
end
|
|
611
|
+
@client.request(
|
|
612
|
+
method: :patch,
|
|
613
|
+
path: ["campaign/%1$s/affiliate-applications/%2$s", id, application_id],
|
|
614
|
+
body: parsed,
|
|
615
|
+
model: GrowsurfRuby::AffiliateApplication,
|
|
616
|
+
options: options
|
|
617
|
+
)
|
|
618
|
+
end
|
|
619
|
+
|
|
620
|
+
# Revokes a pending invite. Its emailed accept link stops working immediately.
|
|
621
|
+
#
|
|
622
|
+
# @overload revoke_affiliate_invite(invite_id, id:, request_options: {})
|
|
623
|
+
#
|
|
624
|
+
# @param invite_id [String] Affiliate invite ID.
|
|
625
|
+
#
|
|
626
|
+
# @param id [String] GrowSurf program ID.
|
|
627
|
+
#
|
|
628
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
629
|
+
#
|
|
630
|
+
# @return [GrowsurfRuby::Models::AffiliateInvite]
|
|
631
|
+
#
|
|
632
|
+
# @see GrowsurfRuby::Models::CampaignRevokeAffiliateInviteParams
|
|
633
|
+
def revoke_affiliate_invite(invite_id, params)
|
|
634
|
+
parsed, options = GrowsurfRuby::CampaignRevokeAffiliateInviteParams.dump_request(params)
|
|
635
|
+
id =
|
|
636
|
+
parsed.delete(:id) do
|
|
637
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
638
|
+
end
|
|
639
|
+
@client.request(
|
|
640
|
+
method: :delete,
|
|
641
|
+
path: ["campaign/%1$s/affiliate-invites/%2$s", id, invite_id],
|
|
642
|
+
model: GrowsurfRuby::AffiliateInvite,
|
|
643
|
+
options: options
|
|
644
|
+
)
|
|
645
|
+
end
|
|
646
|
+
|
|
417
647
|
# @api private
|
|
418
648
|
#
|
|
419
649
|
# @param client [GrowsurfRuby::Client]
|
|
@@ -3,9 +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
|
-
#
|
|
8
|
-
#
|
|
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.
|
|
9
9
|
#
|
|
10
10
|
# @overload retrieve(request_options: {})
|
|
11
11
|
#
|
|
@@ -21,8 +21,9 @@ module GrowsurfRuby
|
|
|
21
21
|
)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
# Updates the name of the team bound to the API key or OAuth connection. Any
|
|
25
|
-
#
|
|
24
|
+
# Updates the name of the team bound to the API key or OAuth connection. Any other
|
|
25
|
+
# property is rejected with a `400`. Personal profiles, billing, and team
|
|
26
|
+
# ownership are not editable here.
|
|
26
27
|
#
|
|
27
28
|
# @overload update(name:, request_options: {})
|
|
28
29
|
#
|
|
@@ -44,11 +45,15 @@ module GrowsurfRuby
|
|
|
44
45
|
)
|
|
45
46
|
end
|
|
46
47
|
|
|
47
|
-
# Generates a new API key and makes the key used on this request stop working
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
48
|
+
# Generates a new API key and makes the key used on this request stop working when
|
|
49
|
+
# rotation succeeds. Send a unique, random `Idempotency-Key`. If the response is
|
|
50
|
+
# interrupted, immediately retry with the original API key and the same
|
|
51
|
+
# `Idempotency-Key` to receive the same new key. Update every integration that
|
|
52
|
+
# used the old key. The team owner is notified by email whenever the key is
|
|
53
|
+
# rotated. GrowSurf SDKs generate the idempotency key automatically. This endpoint
|
|
54
|
+
# accepts an API key with `api_key:rotate`. If this scope is unavailable, rotate
|
|
55
|
+
# the key in the authenticated dashboard instead. This operation is available only
|
|
56
|
+
# through the REST API or a GrowSurf API SDK, not through MCP.
|
|
52
57
|
#
|
|
53
58
|
# @overload rotate_api_key(request_options: {})
|
|
54
59
|
#
|
|
@@ -64,8 +69,9 @@ module GrowsurfRuby
|
|
|
64
69
|
)
|
|
65
70
|
end
|
|
66
71
|
|
|
67
|
-
# Requests GrowSurf
|
|
68
|
-
#
|
|
72
|
+
# Requests GrowSurf to verify the bound team (required before a program can email
|
|
73
|
+
# its participants). Idempotent — calling it again while a request is pending does
|
|
74
|
+
# not create a duplicate. Returns the team with its updated `verificationStatus`.
|
|
69
75
|
#
|
|
70
76
|
# @overload request_verification(request_options: {})
|
|
71
77
|
#
|
|
@@ -82,7 +88,10 @@ module GrowsurfRuby
|
|
|
82
88
|
end
|
|
83
89
|
|
|
84
90
|
# Resends the email-verification message to the bound team's owner. The response
|
|
85
|
-
# never reveals the owner's email address.
|
|
91
|
+
# never reveals the owner's email address. A `200` with `status: SENT` is returned
|
|
92
|
+
# only when an email was actually dispatched. Returns `400` if the email is
|
|
93
|
+
# already verified, and `429` if a verification email was sent too recently — wait
|
|
94
|
+
# a moment, then retry.
|
|
86
95
|
#
|
|
87
96
|
# @overload resend_owner_verification_email(request_options: {})
|
|
88
97
|
#
|
data/lib/growsurf_ruby.rb
CHANGED
|
@@ -63,6 +63,7 @@ require_relative "growsurf_ruby/models/campaign/delete_reward_response"
|
|
|
63
63
|
require_relative "growsurf_ruby/models/campaign/fraud_risk_level"
|
|
64
64
|
require_relative "growsurf_ruby/models/campaign/participant_activity_logs_response"
|
|
65
65
|
require_relative "growsurf_ruby/models/campaign/participant_add_params"
|
|
66
|
+
require_relative "growsurf_ruby/models/email_analytics"
|
|
66
67
|
require_relative "growsurf_ruby/models/campaign/participant_analytics_response"
|
|
67
68
|
require_relative "growsurf_ruby/models/campaign/participant_bulk_delete_params"
|
|
68
69
|
require_relative "growsurf_ruby/models/campaign/participant_bulk_delete_response"
|
|
@@ -72,6 +73,8 @@ require_relative "growsurf_ruby/models/campaign/participant_delete_params"
|
|
|
72
73
|
require_relative "growsurf_ruby/models/campaign/participant_delete_response"
|
|
73
74
|
require_relative "growsurf_ruby/models/campaign/participant_email_params"
|
|
74
75
|
require_relative "growsurf_ruby/models/campaign/participant_email_response"
|
|
76
|
+
require_relative "growsurf_ruby/models/campaign/participant_get_payout_destination_params"
|
|
77
|
+
require_relative "growsurf_ruby/models/campaign/participant_get_payout_destination_response"
|
|
75
78
|
require_relative "growsurf_ruby/models/campaign/participant_list_activity_logs_params"
|
|
76
79
|
require_relative "growsurf_ruby/models/campaign/participant_list_commissions_params"
|
|
77
80
|
require_relative "growsurf_ruby/models/campaign/participant_list_payouts_params"
|
|
@@ -82,6 +85,8 @@ require_relative "growsurf_ruby/models/campaign/participant_record_transaction_p
|
|
|
82
85
|
require_relative "growsurf_ruby/models/campaign/participant_record_transaction_response"
|
|
83
86
|
require_relative "growsurf_ruby/models/campaign/participant_refund_transaction_params"
|
|
84
87
|
require_relative "growsurf_ruby/models/campaign/participant_refund_transaction_response"
|
|
88
|
+
require_relative "growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params"
|
|
89
|
+
require_relative "growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response"
|
|
85
90
|
require_relative "growsurf_ruby/models/campaign/participant_retrieve_analytics_params"
|
|
86
91
|
require_relative "growsurf_ruby/models/campaign/participant_retrieve_params"
|
|
87
92
|
require_relative "growsurf_ruby/models/campaign/participant_reward"
|
|
@@ -112,14 +117,21 @@ require_relative "growsurf_ruby/models/campaign/webhook_test_response"
|
|
|
112
117
|
require_relative "growsurf_ruby/models/campaign/webhook_update_params"
|
|
113
118
|
require_relative "growsurf_ruby/models/account_create_params"
|
|
114
119
|
require_relative "growsurf_ruby/models/account_create_response"
|
|
120
|
+
require_relative "growsurf_ruby/models/affiliate_application"
|
|
121
|
+
require_relative "growsurf_ruby/models/affiliate_application_list_response"
|
|
122
|
+
require_relative "growsurf_ruby/models/affiliate_invite"
|
|
123
|
+
require_relative "growsurf_ruby/models/affiliate_invite_list_response"
|
|
115
124
|
require_relative "growsurf_ruby/models/team"
|
|
116
125
|
require_relative "growsurf_ruby/models/team_resend_owner_verification_email_response"
|
|
117
126
|
require_relative "growsurf_ruby/models/team_rotate_api_key_response"
|
|
118
127
|
require_relative "growsurf_ruby/models/team_update_params"
|
|
119
128
|
require_relative "growsurf_ruby/models/campaign"
|
|
129
|
+
require_relative "growsurf_ruby/models/campaign_create_affiliate_invite_params"
|
|
120
130
|
require_relative "growsurf_ruby/models/campaign_create_mobile_participant_token_params"
|
|
121
131
|
require_relative "growsurf_ruby/models/campaign_create_mobile_participant_token_response"
|
|
122
132
|
require_relative "growsurf_ruby/models/campaign_create_params"
|
|
133
|
+
require_relative "growsurf_ruby/models/campaign_list_affiliate_applications_params"
|
|
134
|
+
require_relative "growsurf_ruby/models/campaign_list_affiliate_invites_params"
|
|
123
135
|
require_relative "growsurf_ruby/models/campaign_list_commissions_params"
|
|
124
136
|
require_relative "growsurf_ruby/models/campaign_list_leaderboard_params"
|
|
125
137
|
require_relative "growsurf_ruby/models/campaign_list_params"
|
|
@@ -127,9 +139,13 @@ require_relative "growsurf_ruby/models/campaign_list_participants_params"
|
|
|
127
139
|
require_relative "growsurf_ruby/models/campaign_list_payouts_params"
|
|
128
140
|
require_relative "growsurf_ruby/models/campaign_list_referrals_params"
|
|
129
141
|
require_relative "growsurf_ruby/models/campaign_list_response"
|
|
142
|
+
require_relative "growsurf_ruby/models/campaign_resend_affiliate_invite_params"
|
|
143
|
+
require_relative "growsurf_ruby/models/campaign_retrieve_affiliate_application_params"
|
|
130
144
|
require_relative "growsurf_ruby/models/campaign_retrieve_analytics_params"
|
|
131
145
|
require_relative "growsurf_ruby/models/campaign_retrieve_analytics_response"
|
|
132
146
|
require_relative "growsurf_ruby/models/campaign_retrieve_params"
|
|
147
|
+
require_relative "growsurf_ruby/models/campaign_review_affiliate_application_params"
|
|
148
|
+
require_relative "growsurf_ruby/models/campaign_revoke_affiliate_invite_params"
|
|
133
149
|
require_relative "growsurf_ruby/models/campaign_update_params"
|
|
134
150
|
require_relative "growsurf_ruby/models/commission_structure"
|
|
135
151
|
require_relative "growsurf_ruby/models/participant_commission_list"
|