growsurf-ruby 1.2.1 → 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 +14 -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/campaign/design.rb +14 -12
- data/lib/growsurf_ruby/resources/campaign/options.rb +7 -7
- data/lib/growsurf_ruby/resources/campaign/participant.rb +96 -11
- data/lib/growsurf_ruby/resources/campaign/rewards.rb +2 -2
- 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 +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/campaign/design.rbi +9 -8
- data/rbi/growsurf_ruby/resources/campaign/options.rbi +7 -7
- data/rbi/growsurf_ruby/resources/campaign/participant.rbi +89 -13
- data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +4 -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_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
|
@@ -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,12 @@ 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.
|
|
676
691
|
#
|
|
677
692
|
# @overload retrieve_analytics(participant_id_or_email, id:, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
|
|
678
693
|
#
|
|
@@ -684,9 +699,9 @@ module GrowsurfRuby
|
|
|
684
699
|
#
|
|
685
700
|
# @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
|
|
686
701
|
#
|
|
687
|
-
# @param include [
|
|
702
|
+
# @param include [String] Comma-separated optional data. `series` returns this participant's own activity
|
|
688
703
|
#
|
|
689
|
-
# @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used
|
|
704
|
+
# @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used when `include` contains `series`).
|
|
690
705
|
#
|
|
691
706
|
# @param start_date [Integer] Start date of the analytics timeframe as a Unix timestamp in milliseconds. Requi
|
|
692
707
|
#
|
|
@@ -711,6 +726,76 @@ module GrowsurfRuby
|
|
|
711
726
|
)
|
|
712
727
|
end
|
|
713
728
|
|
|
729
|
+
# Returns a participant's payout-destination status across every payout provider
|
|
730
|
+
# enabled for the program (PayPal and/or Wise). For each provider it reports the
|
|
731
|
+
# current status, the confirmed claim email, the legal recipient type, and — when a
|
|
732
|
+
# delivery bounced or a recipient was invalidated — the repair reason.
|
|
733
|
+
# `activeProvider` is the provider that currently gets paid, or `null` until the
|
|
734
|
+
# participant confirms one.
|
|
735
|
+
#
|
|
736
|
+
# @overload get_payout_destination(participant_id_or_email, id:, request_options: {})
|
|
737
|
+
#
|
|
738
|
+
# @param participant_id_or_email [String] Path param: GrowSurf participant ID or URL-encoded participant email address.
|
|
739
|
+
#
|
|
740
|
+
# @param id [String] Path param: GrowSurf program ID.
|
|
741
|
+
#
|
|
742
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
743
|
+
#
|
|
744
|
+
# @return [GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationResponse]
|
|
745
|
+
#
|
|
746
|
+
# @see GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationParams
|
|
747
|
+
def get_payout_destination(participant_id_or_email, params)
|
|
748
|
+
parsed, options = GrowsurfRuby::Campaign::ParticipantGetPayoutDestinationParams.dump_request(params)
|
|
749
|
+
id =
|
|
750
|
+
parsed.delete(:id) do
|
|
751
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
752
|
+
end
|
|
753
|
+
@client.request(
|
|
754
|
+
method: :get,
|
|
755
|
+
path: ["campaign/%1$s/participant/%2$s/payout-destination", id, participant_id_or_email],
|
|
756
|
+
model: GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationResponse,
|
|
757
|
+
options: options
|
|
758
|
+
)
|
|
759
|
+
end
|
|
760
|
+
|
|
761
|
+
# Sends the participant a one-time link to confirm their payout destination for
|
|
762
|
+
# the chosen provider. Only the participant can open the link and confirm — this
|
|
763
|
+
# endpoint just triggers the message. The provider must be enabled for the
|
|
764
|
+
# program.
|
|
765
|
+
#
|
|
766
|
+
# @overload request_payout_destination_confirmation(participant_id_or_email, id:, provider:, request_options: {})
|
|
767
|
+
#
|
|
768
|
+
# @param participant_id_or_email [String] Path param: GrowSurf participant ID or URL-encoded participant email address.
|
|
769
|
+
#
|
|
770
|
+
# @param id [String] Path param: GrowSurf program ID.
|
|
771
|
+
#
|
|
772
|
+
# @param provider [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationParams::Provider] Body param: The payout provider the participant should confirm a destination for.
|
|
773
|
+
#
|
|
774
|
+
# @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
775
|
+
#
|
|
776
|
+
# @return [GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationResponse]
|
|
777
|
+
#
|
|
778
|
+
# @see GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationParams
|
|
779
|
+
def request_payout_destination_confirmation(participant_id_or_email, params)
|
|
780
|
+
parsed, options =
|
|
781
|
+
GrowsurfRuby::Campaign::ParticipantRequestPayoutDestinationConfirmationParams.dump_request(params)
|
|
782
|
+
id =
|
|
783
|
+
parsed.delete(:id) do
|
|
784
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
785
|
+
end
|
|
786
|
+
@client.request(
|
|
787
|
+
method: :post,
|
|
788
|
+
path: [
|
|
789
|
+
"campaign/%1$s/participant/%2$s/payout-destination/request-confirmation",
|
|
790
|
+
id,
|
|
791
|
+
participant_id_or_email
|
|
792
|
+
],
|
|
793
|
+
body: parsed,
|
|
794
|
+
model: GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationResponse,
|
|
795
|
+
options: options
|
|
796
|
+
)
|
|
797
|
+
end
|
|
798
|
+
|
|
714
799
|
# @api private
|
|
715
800
|
#
|
|
716
801
|
# @param client [GrowsurfRuby::Client]
|
|
@@ -70,7 +70,7 @@ module GrowsurfRuby
|
|
|
70
70
|
#
|
|
71
71
|
# @param referred_reward_upfront [Boolean] Body param
|
|
72
72
|
#
|
|
73
|
-
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax
|
|
73
|
+
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax treatment override for the referred friend's side of a double-sided rewa
|
|
74
74
|
#
|
|
75
75
|
# @param title [String] Body param
|
|
76
76
|
#
|
|
@@ -138,7 +138,7 @@ module GrowsurfRuby
|
|
|
138
138
|
#
|
|
139
139
|
# @param referred_reward_upfront [Boolean] Body param
|
|
140
140
|
#
|
|
141
|
-
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax
|
|
141
|
+
# @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax treatment override for the referred friend's side of a double-sided rewa
|
|
142
142
|
#
|
|
143
143
|
# @param title [String] Body param
|
|
144
144
|
#
|
|
@@ -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]
|
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"
|