growsurf-ruby 1.2.1 → 1.4.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 +25 -25
- data/lib/growsurf_ruby/models/campaign/participant_reward.rb +1 -0
- 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 +41 -3
- data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +26 -4
- data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +26 -4
- data/lib/growsurf_ruby/models/campaign.rb +24 -3
- 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/commission_structure.rb +16 -3
- data/lib/growsurf_ruby/models/email_analytics.rb +41 -0
- data/lib/growsurf_ruby/models/participant_commission_list.rb +19 -1
- 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/campaign/design.rb +14 -12
- data/lib/growsurf_ruby/resources/campaign/options.rb +7 -7
- data/lib/growsurf_ruby/resources/campaign/participant.rb +101 -14
- data/lib/growsurf_ruby/resources/campaign/rewards.rb +8 -4
- data/lib/growsurf_ruby/resources/campaign.rb +231 -4
- 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 +38 -62
- data/rbi/growsurf_ruby/models/campaign/participant_reward.rbi +5 -0
- 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 +78 -2
- data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +68 -4
- data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +68 -4
- data/rbi/growsurf_ruby/models/campaign.rbi +48 -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/commission_structure.rbi +34 -3
- data/rbi/growsurf_ruby/models/email_analytics.rbi +200 -0
- data/rbi/growsurf_ruby/models/participant_commission_list.rbi +48 -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/campaign/design.rbi +9 -8
- data/rbi/growsurf_ruby/resources/campaign/options.rbi +7 -7
- data/rbi/growsurf_ruby/resources/campaign/participant.rbi +99 -18
- data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +18 -4
- data/rbi/growsurf_ruby/resources/campaign.rbi +188 -10
- 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_reward.rbs +2 -1
- 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 +28 -0
- data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +20 -0
- data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +20 -0
- data/sig/growsurf_ruby/models/campaign.rbs +16 -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/commission_structure.rbs +16 -4
- data/sig/growsurf_ruby/models/email_analytics.rbs +92 -0
- data/sig/growsurf_ruby/models/participant_commission_list.rbs +16 -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/rewards.rbs +2 -0
- data/sig/growsurf_ruby/resources/campaign.rbs +53 -0
- metadata +54 -3
data/lib/growsurf_ruby/models.rb
CHANGED
|
@@ -41,6 +41,10 @@ module GrowsurfRuby
|
|
|
41
41
|
|
|
42
42
|
AccountCreateParams = GrowsurfRuby::Models::AccountCreateParams
|
|
43
43
|
|
|
44
|
+
AffiliateApplication = GrowsurfRuby::Models::AffiliateApplication
|
|
45
|
+
|
|
46
|
+
AffiliateInvite = GrowsurfRuby::Models::AffiliateInvite
|
|
47
|
+
|
|
44
48
|
Team = GrowsurfRuby::Models::Team
|
|
45
49
|
|
|
46
50
|
TeamUpdateParams = GrowsurfRuby::Models::TeamUpdateParams
|
|
@@ -49,11 +53,17 @@ module GrowsurfRuby
|
|
|
49
53
|
|
|
50
54
|
CampaignAPI = GrowsurfRuby::Models::CampaignAPI
|
|
51
55
|
|
|
56
|
+
CampaignCreateAffiliateInviteParams = GrowsurfRuby::Models::CampaignCreateAffiliateInviteParams
|
|
57
|
+
|
|
52
58
|
CampaignCreateMobileParticipantTokenParams =
|
|
53
59
|
GrowsurfRuby::Models::CampaignCreateMobileParticipantTokenParams
|
|
54
60
|
|
|
55
61
|
CampaignCreateParams = GrowsurfRuby::Models::CampaignCreateParams
|
|
56
62
|
|
|
63
|
+
CampaignListAffiliateApplicationsParams = GrowsurfRuby::Models::CampaignListAffiliateApplicationsParams
|
|
64
|
+
|
|
65
|
+
CampaignListAffiliateInvitesParams = GrowsurfRuby::Models::CampaignListAffiliateInvitesParams
|
|
66
|
+
|
|
57
67
|
CampaignListCommissionsParams = GrowsurfRuby::Models::CampaignListCommissionsParams
|
|
58
68
|
|
|
59
69
|
CampaignListLeaderboardParams = GrowsurfRuby::Models::CampaignListLeaderboardParams
|
|
@@ -66,10 +76,19 @@ module GrowsurfRuby
|
|
|
66
76
|
|
|
67
77
|
CampaignListReferralsParams = GrowsurfRuby::Models::CampaignListReferralsParams
|
|
68
78
|
|
|
79
|
+
CampaignResendAffiliateInviteParams = GrowsurfRuby::Models::CampaignResendAffiliateInviteParams
|
|
80
|
+
|
|
81
|
+
CampaignRetrieveAffiliateApplicationParams =
|
|
82
|
+
GrowsurfRuby::Models::CampaignRetrieveAffiliateApplicationParams
|
|
83
|
+
|
|
69
84
|
CampaignRetrieveAnalyticsParams = GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams
|
|
70
85
|
|
|
71
86
|
CampaignRetrieveParams = GrowsurfRuby::Models::CampaignRetrieveParams
|
|
72
87
|
|
|
88
|
+
CampaignReviewAffiliateApplicationParams = GrowsurfRuby::Models::CampaignReviewAffiliateApplicationParams
|
|
89
|
+
|
|
90
|
+
CampaignRevokeAffiliateInviteParams = GrowsurfRuby::Models::CampaignRevokeAffiliateInviteParams
|
|
91
|
+
|
|
73
92
|
CampaignUpdateParams = GrowsurfRuby::Models::CampaignUpdateParams
|
|
74
93
|
|
|
75
94
|
CommissionStructure = GrowsurfRuby::Models::CommissionStructure
|
|
@@ -4,12 +4,13 @@ module GrowsurfRuby
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Campaign
|
|
6
6
|
class Design
|
|
7
|
-
# Retrieves a program's design
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
# available fields depend on the program type
|
|
12
|
-
#
|
|
7
|
+
# Retrieves a program's configured design fields: the dashboard Program Editor's **Design**
|
|
8
|
+
# tab plus the payout-destination confirmation page copy configured from payout integration
|
|
9
|
+
# cards. This includes the GrowSurf window layout, header, share channels and invites,
|
|
10
|
+
# signup form, portal and landing pages, theme styling, and referral or affiliate summary
|
|
11
|
+
# and status sections. The available fields depend on the program type.
|
|
12
|
+
# `payoutDestinationConfirmation` is omitted when no confirmation fields are stored. Stored
|
|
13
|
+
# `null` fields are returned as `null`; omitted and `null` fields use localized defaults.
|
|
13
14
|
#
|
|
14
15
|
# @overload retrieve(id, request_options: {})
|
|
15
16
|
#
|
|
@@ -27,17 +28,18 @@ module GrowsurfRuby
|
|
|
27
28
|
)
|
|
28
29
|
end
|
|
29
30
|
|
|
30
|
-
# Updates a program's design configuration
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
# editable via the API.
|
|
31
|
+
# Updates a program's design configuration, including the payout-destination confirmation
|
|
32
|
+
# page copy configured from payout integration cards. Only the fields you send are changed;
|
|
33
|
+
# anything you leave out is untouched (arrays such as `signup.fields` replace wholesale).
|
|
34
|
+
# Unknown fields, fields not available for the program type, and invalid values return a
|
|
35
|
+
# `400`. Landing-page custom code and JavaScript are not editable via the API.
|
|
35
36
|
#
|
|
36
37
|
# @overload update(id, body, request_options: {})
|
|
37
38
|
#
|
|
38
39
|
# @param id [String] GrowSurf program ID.
|
|
39
40
|
#
|
|
40
|
-
# @param body [Hash{Symbol=>Object}] Partial design configuration to merge
|
|
41
|
+
# @param body [Hash{Symbol=>Object}] Partial design configuration to merge, such as
|
|
42
|
+
# `{ payoutDestinationConfirmation: { headline: "Confirm your {{payoutProvider}} payout email" } }`.
|
|
41
43
|
#
|
|
42
44
|
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
43
45
|
#
|
|
@@ -6,9 +6,9 @@ module GrowsurfRuby
|
|
|
6
6
|
class Options
|
|
7
7
|
# Retrieves a program's options — the same surface as the dashboard Program
|
|
8
8
|
# Editor's **Options** tab. Includes reward/fraud approval, anti-fraud lists +
|
|
9
|
-
# toggles, referral cookie/credit windows, reCAPTCHA,
|
|
10
|
-
# settings (affiliate only), and
|
|
11
|
-
# `fraud.recaptcha.secretKey` is never returned.
|
|
9
|
+
# toggles, referral cookie/credit windows, reCAPTCHA, affiliate enrollment +
|
|
10
|
+
# application review, payout threshold + tax settings (affiliate only), and
|
|
11
|
+
# notification-email settings. `fraud.recaptcha.secretKey` is never returned.
|
|
12
12
|
#
|
|
13
13
|
# @overload retrieve(id, request_options: {})
|
|
14
14
|
#
|
|
@@ -28,10 +28,10 @@ module GrowsurfRuby
|
|
|
28
28
|
|
|
29
29
|
# Updates a program's options. Only the fields you send are changed. Some fields
|
|
30
30
|
# are program-type specific (`requireManualRewardApproval`/`autoFulfillRewards`
|
|
31
|
-
# are referral-only; `
|
|
32
|
-
#
|
|
33
|
-
# `fraud.recaptcha.secretKey`
|
|
34
|
-
# means "never expires".
|
|
31
|
+
# are referral-only; `affiliateApplicationMode`/`affiliateReapplicationPolicy`
|
|
32
|
+
# and `payoutThreshold`/`taxDocumentation` are affiliate-only, and affiliate
|
|
33
|
+
# programs require `requireParticipantAuth: true`). `fraud.recaptcha.secretKey`
|
|
34
|
+
# is write-only. `referralCreditWindowDays: null` means "never expires".
|
|
35
35
|
#
|
|
36
36
|
# @overload update(id, body, request_options: {})
|
|
37
37
|
#
|
|
@@ -31,14 +31,20 @@ module GrowsurfRuby
|
|
|
31
31
|
)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
# Updates a participant by GrowSurf participant ID or email address.
|
|
34
|
+
# Updates a participant by GrowSurf participant ID or email address. For affiliate
|
|
35
|
+
# programs, set `affiliateStatus` to `APPROVED`, `SUSPENDED`, or `BANNED`.
|
|
36
|
+
# `APPROVED` enrolls the participant as an affiliate. `SUSPENDED` and `BANNED`
|
|
37
|
+
# require an existing affiliate. This endpoint does not accept `isAffiliate`, and
|
|
38
|
+
# affiliate enrollment cannot be removed through REST.
|
|
35
39
|
#
|
|
36
|
-
# @overload update(participant_id_or_email, id:, email: nil, first_name: nil, last_name: nil, metadata: nil, notes: nil,
|
|
40
|
+
# @overload update(participant_id_or_email, id:, affiliate_status: nil, email: nil, first_name: nil, last_name: nil, metadata: nil, notes: nil, referral_status: nil, referred_by: nil, unsubscribed: nil, vanity_keys: nil, request_options: {})
|
|
37
41
|
#
|
|
38
42
|
# @param participant_id_or_email [String] Path param: GrowSurf participant ID or URL-encoded participant email address.
|
|
39
43
|
#
|
|
40
44
|
# @param id [String] Path param: GrowSurf program ID.
|
|
41
45
|
#
|
|
46
|
+
# @param affiliate_status [Symbol, GrowsurfRuby::Models::Campaign::ParticipantUpdateParams::AffiliateStatus] Body param: Affiliate programs only. Sets the affiliate status. `APPROVED` also enrolls a participant who is not yet an affiliate. `SUSPENDED` and `BANNED` are rejected for non-affiliates.
|
|
47
|
+
#
|
|
42
48
|
# @param email [String] Body param
|
|
43
49
|
#
|
|
44
50
|
# @param first_name [String] Body param
|
|
@@ -49,8 +55,6 @@ module GrowsurfRuby
|
|
|
49
55
|
#
|
|
50
56
|
# @param notes [String] Body param: Freeform internal notes about the participant (internal only, never ex
|
|
51
57
|
#
|
|
52
|
-
# @param paypal_email [String] Body param: The participant's PayPal email address, used for affiliate payouts.
|
|
53
|
-
#
|
|
54
58
|
# @param referral_status [Symbol, GrowsurfRuby::Models::Campaign::ParticipantUpdateParams::ReferralStatus] Body param
|
|
55
59
|
#
|
|
56
60
|
# @param referred_by [String] Body param
|
|
@@ -143,9 +147,15 @@ module GrowsurfRuby
|
|
|
143
147
|
# {GrowsurfRuby::Models::Campaign::ParticipantAddParams} for more details.
|
|
144
148
|
#
|
|
145
149
|
# Adds a new participant to the program. If the email already exists, the existing
|
|
146
|
-
# participant is returned.
|
|
150
|
+
# participant is returned unchanged. For affiliate programs, set `isAffiliate` to
|
|
151
|
+
# `true` to enroll a new participant as an approved affiliate or `false` to create
|
|
152
|
+
# a non-affiliate. If you omit `isAffiliate`, a valid `referredBy` creates a
|
|
153
|
+
# referred non-affiliate; without a valid referrer, the new participant is enrolled
|
|
154
|
+
# as an approved affiliate. You can send a valid `referredBy` with
|
|
155
|
+
# `isAffiliate: true` to keep the referral attribution and enroll the participant
|
|
156
|
+
# as an affiliate.
|
|
147
157
|
#
|
|
148
|
-
# @overload add(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_by: nil, request_options: {})
|
|
158
|
+
# @overload add(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, is_affiliate: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_by: nil, request_options: {})
|
|
149
159
|
#
|
|
150
160
|
# @param id [String] GrowSurf program ID.
|
|
151
161
|
#
|
|
@@ -157,6 +167,8 @@ module GrowsurfRuby
|
|
|
157
167
|
#
|
|
158
168
|
# @param ip_address [String]
|
|
159
169
|
#
|
|
170
|
+
# @param is_affiliate [Boolean] Affiliate programs only. Controls affiliate enrollment for a new participant. `true` enrolls the participant with `affiliateStatus: APPROVED`; `false` creates a non-affiliate without `affiliateStatus`. Existing participants are returned unchanged.
|
|
171
|
+
#
|
|
160
172
|
# @param last_name [String]
|
|
161
173
|
#
|
|
162
174
|
# @param metadata [Hash{Symbol=>Object}] Shallow custom metadata object.
|
|
@@ -670,9 +682,14 @@ module GrowsurfRuby
|
|
|
670
682
|
# details.
|
|
671
683
|
#
|
|
672
684
|
# Retrieves analytics for a single participant — all-time engagement counters,
|
|
673
|
-
# leaderboard ranks, and per-channel share counts (plus affiliate
|
|
674
|
-
# for affiliate programs).
|
|
675
|
-
#
|
|
685
|
+
# leaderboard ranks, and per-channel share counts (plus affiliate revenue,
|
|
686
|
+
# commission, and payout metrics for affiliate programs). Pass `include=email`
|
|
687
|
+
# for `sent` (accepted for delivery), `delivered`, `opened`, `clicked`,
|
|
688
|
+
# `bounced`, and `spamComplaints` metrics attributed to this participant,
|
|
689
|
+
# including invitations they sent. Use `include=email,series` to include the
|
|
690
|
+
# same counts in each UTC series bucket. `days`, `startDate`, and `endDate`
|
|
691
|
+
# filter only the optional `series` and `email` data. They do not filter the
|
|
692
|
+
# top-level `analytics`, `ranks`, or `shareCount` values.
|
|
676
693
|
#
|
|
677
694
|
# @overload retrieve_analytics(participant_id_or_email, id:, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
|
|
678
695
|
#
|
|
@@ -680,15 +697,15 @@ module GrowsurfRuby
|
|
|
680
697
|
#
|
|
681
698
|
# @param id [String] GrowSurf program ID.
|
|
682
699
|
#
|
|
683
|
-
# @param days [Integer] Last number of days
|
|
700
|
+
# @param days [Integer] Last number of days for optional `series` and `email` analytics. Defaults to 365. Maxi
|
|
684
701
|
#
|
|
685
|
-
# @param end_date [Integer] End
|
|
702
|
+
# @param end_date [Integer] End of a custom `series` and `email` analytics window as a Unix timestamp in milli
|
|
686
703
|
#
|
|
687
|
-
# @param include [
|
|
704
|
+
# @param include [String] Comma-separated optional data. `series` returns this participant's own activity
|
|
688
705
|
#
|
|
689
|
-
# @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used
|
|
706
|
+
# @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used when `include` contains `series`).
|
|
690
707
|
#
|
|
691
|
-
# @param start_date [Integer] Start
|
|
708
|
+
# @param start_date [Integer] Start of a custom `series` and `email` analytics window as a Unix timestamp in mi
|
|
692
709
|
#
|
|
693
710
|
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
694
711
|
#
|
|
@@ -711,6 +728,76 @@ module GrowsurfRuby
|
|
|
711
728
|
)
|
|
712
729
|
end
|
|
713
730
|
|
|
731
|
+
# Returns a participant's payout-destination status across every payout provider
|
|
732
|
+
# enabled for the program (PayPal and/or Wise). For each provider it reports the
|
|
733
|
+
# current status, the confirmed claim email, the legal recipient type, and — when a
|
|
734
|
+
# delivery bounced or a recipient was invalidated — the repair reason.
|
|
735
|
+
# `activeProvider` is the provider that currently gets paid, or `null` until the
|
|
736
|
+
# participant confirms one.
|
|
737
|
+
#
|
|
738
|
+
# @overload get_payout_destination(participant_id_or_email, id:, request_options: {})
|
|
739
|
+
#
|
|
740
|
+
# @param participant_id_or_email [String] Path param: GrowSurf participant ID or URL-encoded participant email address.
|
|
741
|
+
#
|
|
742
|
+
# @param id [String] Path param: GrowSurf program ID.
|
|
743
|
+
#
|
|
744
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
745
|
+
#
|
|
746
|
+
# @return [GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationResponse]
|
|
747
|
+
#
|
|
748
|
+
# @see GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationParams
|
|
749
|
+
def get_payout_destination(participant_id_or_email, params)
|
|
750
|
+
parsed, options = GrowsurfRuby::Campaign::ParticipantGetPayoutDestinationParams.dump_request(params)
|
|
751
|
+
id =
|
|
752
|
+
parsed.delete(:id) do
|
|
753
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
754
|
+
end
|
|
755
|
+
@client.request(
|
|
756
|
+
method: :get,
|
|
757
|
+
path: ["campaign/%1$s/participant/%2$s/payout-destination", id, participant_id_or_email],
|
|
758
|
+
model: GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationResponse,
|
|
759
|
+
options: options
|
|
760
|
+
)
|
|
761
|
+
end
|
|
762
|
+
|
|
763
|
+
# Sends the participant a one-time link to confirm their payout destination for
|
|
764
|
+
# the chosen provider. Only the participant can open the link and confirm — this
|
|
765
|
+
# endpoint just triggers the message. The provider must be enabled for the
|
|
766
|
+
# program.
|
|
767
|
+
#
|
|
768
|
+
# @overload request_payout_destination_confirmation(participant_id_or_email, id:, provider:, request_options: {})
|
|
769
|
+
#
|
|
770
|
+
# @param participant_id_or_email [String] Path param: GrowSurf participant ID or URL-encoded participant email address.
|
|
771
|
+
#
|
|
772
|
+
# @param id [String] Path param: GrowSurf program ID.
|
|
773
|
+
#
|
|
774
|
+
# @param provider [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationParams::Provider] Body param: The payout provider the participant should confirm a destination for.
|
|
775
|
+
#
|
|
776
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
777
|
+
#
|
|
778
|
+
# @return [GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationResponse]
|
|
779
|
+
#
|
|
780
|
+
# @see GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationParams
|
|
781
|
+
def request_payout_destination_confirmation(participant_id_or_email, params)
|
|
782
|
+
parsed, options =
|
|
783
|
+
GrowsurfRuby::Campaign::ParticipantRequestPayoutDestinationConfirmationParams.dump_request(params)
|
|
784
|
+
id =
|
|
785
|
+
parsed.delete(:id) do
|
|
786
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
787
|
+
end
|
|
788
|
+
@client.request(
|
|
789
|
+
method: :post,
|
|
790
|
+
path: [
|
|
791
|
+
"campaign/%1$s/participant/%2$s/payout-destination/request-confirmation",
|
|
792
|
+
id,
|
|
793
|
+
participant_id_or_email
|
|
794
|
+
],
|
|
795
|
+
body: parsed,
|
|
796
|
+
model: GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationResponse,
|
|
797
|
+
options: options
|
|
798
|
+
)
|
|
799
|
+
end
|
|
800
|
+
|
|
714
801
|
# @api private
|
|
715
802
|
#
|
|
716
803
|
# @param client [GrowsurfRuby::Client]
|
|
@@ -30,7 +30,7 @@ module GrowsurfRuby
|
|
|
30
30
|
# Enabling an active reward of a type automatically enables that reward type on
|
|
31
31
|
# the program.
|
|
32
32
|
#
|
|
33
|
-
# @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
|
|
33
|
+
# @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
|
|
34
34
|
#
|
|
35
35
|
# @param id [String] Path param: GrowSurf program ID.
|
|
36
36
|
#
|
|
@@ -44,6 +44,8 @@ module GrowsurfRuby
|
|
|
44
44
|
#
|
|
45
45
|
# @param description [String] Body param
|
|
46
46
|
#
|
|
47
|
+
# @param event [Symbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::Event] Body param: The referral event that earns this Campaign Reward. Use `LEAD` or `CONVERSION`. `LEAD` requires the program installation's `referralTrigger` to be `CUSTOM`. This field applies only to `SINGLE_SIDED`, `DOUBLE_SIDED`, and `MILESTONE` rewards. When omitted, it defaults to `CONVERSION`.
|
|
48
|
+
#
|
|
47
49
|
# @param image_url [String] Body param
|
|
48
50
|
#
|
|
49
51
|
# @param is_unlimited [Boolean] Body param: Whether the reward can be earned an unlimited number of times. Defaul
|
|
@@ -70,7 +72,7 @@ module GrowsurfRuby
|
|
|
70
72
|
#
|
|
71
73
|
# @param referred_reward_upfront [Boolean] Body param
|
|
72
74
|
#
|
|
73
|
-
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax
|
|
75
|
+
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax treatment override for the referred friend's side of a double-sided rewa
|
|
74
76
|
#
|
|
75
77
|
# @param title [String] Body param
|
|
76
78
|
#
|
|
@@ -98,7 +100,7 @@ module GrowsurfRuby
|
|
|
98
100
|
# copy; removing a key that campaign copy still references returns a `409` listing
|
|
99
101
|
# the referencing fields.
|
|
100
102
|
#
|
|
101
|
-
# @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
|
|
103
|
+
# @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
|
|
102
104
|
#
|
|
103
105
|
# @param campaign_reward_id [String] Path param: Campaign reward ID.
|
|
104
106
|
#
|
|
@@ -112,6 +114,8 @@ module GrowsurfRuby
|
|
|
112
114
|
#
|
|
113
115
|
# @param description [String] Body param
|
|
114
116
|
#
|
|
117
|
+
# @param event [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::Event] Body param: The referral event that earns this Campaign Reward. Use `LEAD` or `CONVERSION`. `LEAD` requires the program installation's `referralTrigger` to be `CUSTOM`. This field applies only to `SINGLE_SIDED`, `DOUBLE_SIDED`, and `MILESTONE` rewards. When omitted, the stored event is preserved.
|
|
118
|
+
#
|
|
115
119
|
# @param image_url [String] Body param
|
|
116
120
|
#
|
|
117
121
|
# @param is_unlimited [Boolean] Body param: Whether the reward can be earned an unlimited number of times. Defaul
|
|
@@ -138,7 +142,7 @@ module GrowsurfRuby
|
|
|
138
142
|
#
|
|
139
143
|
# @param referred_reward_upfront [Boolean] Body param
|
|
140
144
|
#
|
|
141
|
-
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax
|
|
145
|
+
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax treatment override for the referred friend's side of a double-sided rewa
|
|
142
146
|
#
|
|
143
147
|
# @param title [String] Body param
|
|
144
148
|
#
|
|
@@ -76,7 +76,7 @@ module GrowsurfRuby
|
|
|
76
76
|
)
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
-
# Creates a new program, plus any optional
|
|
79
|
+
# Creates a new program, plus any optional campaign rewards. The new program is
|
|
80
80
|
# created in `DRAFT` status and owned by the API key's bound team.
|
|
81
81
|
#
|
|
82
82
|
# @overload create(type:, company_logo_image_url: nil, company_name: nil, currency_iso: nil, name: nil, rewards: nil, request_options: {})
|
|
@@ -89,7 +89,7 @@ module GrowsurfRuby
|
|
|
89
89
|
#
|
|
90
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.
|
|
91
91
|
#
|
|
92
|
-
# @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.
|
|
93
93
|
#
|
|
94
94
|
# @param rewards [Array<GrowsurfRuby::Models::Campaign::RewardCreateParams>] Optional inline rewards to create with the program.
|
|
95
95
|
#
|
|
@@ -162,6 +162,36 @@ module GrowsurfRuby
|
|
|
162
162
|
)
|
|
163
163
|
end
|
|
164
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
|
+
|
|
165
195
|
# Some parameter documentations has been truncated, see
|
|
166
196
|
# {GrowsurfRuby::Models::CampaignCreateMobileParticipantTokenParams} for more
|
|
167
197
|
# details.
|
|
@@ -209,6 +239,67 @@ module GrowsurfRuby
|
|
|
209
239
|
)
|
|
210
240
|
end
|
|
211
241
|
|
|
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
|
+
|
|
212
303
|
# **Affiliate programs only.** Retrieves a paged list of all participant
|
|
213
304
|
# commissions in an affiliate program.
|
|
214
305
|
#
|
|
@@ -379,12 +470,72 @@ module GrowsurfRuby
|
|
|
379
470
|
)
|
|
380
471
|
end
|
|
381
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
|
+
|
|
382
529
|
# Some parameter documentations has been truncated, see
|
|
383
530
|
# {GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams} for more details.
|
|
384
531
|
#
|
|
385
532
|
# Retrieves analytics for a program. Pass `interval` to also get a time-series
|
|
386
533
|
# (`series`) alongside the totals, and `include` to add previous-period totals,
|
|
387
|
-
# status breakdowns,
|
|
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.
|
|
388
539
|
#
|
|
389
540
|
# @overload retrieve_analytics(id, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
|
|
390
541
|
#
|
|
@@ -394,7 +545,7 @@ module GrowsurfRuby
|
|
|
394
545
|
#
|
|
395
546
|
# @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
|
|
396
547
|
#
|
|
397
|
-
# @param include [String] Comma-separated list of optional
|
|
548
|
+
# @param include [String] Comma-separated list of optional data to include: `previousPeriod` adds totals for
|
|
398
549
|
#
|
|
399
550
|
# @param interval [Symbol, GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Interval] When set to `day`, `week`, or `month`, the response also includes a `series` array
|
|
400
551
|
#
|
|
@@ -417,6 +568,82 @@ module GrowsurfRuby
|
|
|
417
568
|
)
|
|
418
569
|
end
|
|
419
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
|
+
|
|
420
647
|
# @api private
|
|
421
648
|
#
|
|
422
649
|
# @param client [GrowsurfRuby::Client]
|