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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/LICENSE +201 -0
  4. data/README.md +1 -1
  5. data/lib/growsurf_ruby/internal/transport/base_client.rb +21 -4
  6. data/lib/growsurf_ruby/models/affiliate_application.rb +249 -0
  7. data/lib/growsurf_ruby/models/affiliate_application_list_response.rb +42 -0
  8. data/lib/growsurf_ruby/models/affiliate_invite.rb +109 -0
  9. data/lib/growsurf_ruby/models/affiliate_invite_list_response.rb +41 -0
  10. data/lib/growsurf_ruby/models/campaign/create.rb +12 -1
  11. data/lib/growsurf_ruby/models/campaign/participant.rb +79 -4
  12. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +28 -17
  13. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rb +28 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rb +126 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_list_payouts_params.rb +1 -0
  16. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rb +50 -0
  17. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rb +56 -0
  18. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +14 -17
  19. data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +25 -9
  20. data/lib/growsurf_ruby/models/campaign/referral_source.rb +3 -0
  21. data/lib/growsurf_ruby/models/campaign/reward.rb +20 -3
  22. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +3 -3
  23. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +3 -3
  24. data/lib/growsurf_ruby/models/campaign.rb +2 -2
  25. data/lib/growsurf_ruby/models/campaign_create_affiliate_invite_params.rb +45 -0
  26. data/lib/growsurf_ruby/models/campaign_list_affiliate_applications_params.rb +57 -0
  27. data/lib/growsurf_ruby/models/campaign_list_affiliate_invites_params.rb +58 -0
  28. data/lib/growsurf_ruby/models/campaign_list_payouts_params.rb +1 -0
  29. data/lib/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rb +26 -0
  30. data/lib/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rb +26 -0
  31. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +9 -6
  32. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +59 -11
  33. data/lib/growsurf_ruby/models/campaign_review_affiliate_application_params.rb +94 -0
  34. data/lib/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rb +26 -0
  35. data/lib/growsurf_ruby/models/email_analytics.rb +41 -0
  36. data/lib/growsurf_ruby/models/participant_payout_list.rb +8 -1
  37. data/lib/growsurf_ruby/models/reward_tax_valuation.rb +24 -9
  38. data/lib/growsurf_ruby/models.rb +19 -0
  39. data/lib/growsurf_ruby/resources/campaign/design.rb +14 -12
  40. data/lib/growsurf_ruby/resources/campaign/options.rb +7 -7
  41. data/lib/growsurf_ruby/resources/campaign/participant.rb +96 -11
  42. data/lib/growsurf_ruby/resources/campaign/rewards.rb +2 -2
  43. data/lib/growsurf_ruby/resources/campaign.rb +231 -4
  44. data/lib/growsurf_ruby/version.rb +1 -1
  45. data/lib/growsurf_ruby.rb +16 -0
  46. data/rbi/growsurf_ruby/models/affiliate_application.rbi +431 -0
  47. data/rbi/growsurf_ruby/models/affiliate_application_list_response.rbi +70 -0
  48. data/rbi/growsurf_ruby/models/affiliate_invite.rbi +167 -0
  49. data/rbi/growsurf_ruby/models/affiliate_invite_list_response.rbi +70 -0
  50. data/rbi/growsurf_ruby/models/campaign/create.rbi +17 -0
  51. data/rbi/growsurf_ruby/models/campaign/participant.rbi +169 -3
  52. data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +3 -5
  53. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -20
  54. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +3 -1
  55. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbi +48 -0
  56. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +243 -0
  57. data/rbi/growsurf_ruby/models/campaign/participant_list_payouts_params.rbi +5 -0
  58. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbi +100 -0
  59. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +118 -0
  60. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +22 -52
  61. data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +67 -11
  62. data/rbi/growsurf_ruby/models/campaign/referral_source.rbi +9 -0
  63. data/rbi/growsurf_ruby/models/campaign/reward.rbi +23 -2
  64. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +4 -4
  65. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +4 -4
  66. data/rbi/growsurf_ruby/models/campaign.rbi +2 -2
  67. data/rbi/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbi +74 -0
  68. data/rbi/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbi +130 -0
  69. data/rbi/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbi +135 -0
  70. data/rbi/growsurf_ruby/models/campaign_list_payouts_params.rbi +5 -0
  71. data/rbi/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbi +46 -0
  72. data/rbi/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbi +46 -0
  73. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +15 -10
  74. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +68 -18
  75. data/rbi/growsurf_ruby/models/campaign_review_affiliate_application_params.rbi +167 -0
  76. data/rbi/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbi +46 -0
  77. data/rbi/growsurf_ruby/models/email_analytics.rbi +200 -0
  78. data/rbi/growsurf_ruby/models/participant_payout_list.rbi +17 -3
  79. data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +66 -9
  80. data/rbi/growsurf_ruby/models.rbi +25 -0
  81. data/rbi/growsurf_ruby/resources/campaign/design.rbi +9 -8
  82. data/rbi/growsurf_ruby/resources/campaign/options.rbi +7 -7
  83. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +89 -13
  84. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +4 -4
  85. data/rbi/growsurf_ruby/resources/campaign.rbi +188 -10
  86. data/sig/growsurf_ruby/models/affiliate_application.rbs +192 -0
  87. data/sig/growsurf_ruby/models/affiliate_application_list_response.rbs +39 -0
  88. data/sig/growsurf_ruby/models/affiliate_invite.rbs +92 -0
  89. data/sig/growsurf_ruby/models/affiliate_invite_list_response.rbs +39 -0
  90. data/sig/growsurf_ruby/models/campaign/create.rbs +7 -0
  91. data/sig/growsurf_ruby/models/campaign/participant.rbs +62 -2
  92. data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +2 -11
  93. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +12 -12
  94. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbs +30 -0
  95. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +107 -0
  96. data/sig/growsurf_ruby/models/campaign/participant_list_payouts_params.rbs +2 -1
  97. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbs +49 -0
  98. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +57 -0
  99. data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +5 -13
  100. data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +21 -7
  101. data/sig/growsurf_ruby/models/campaign/referral_source.rbs +4 -1
  102. data/sig/growsurf_ruby/models/campaign/reward.rbs +12 -0
  103. data/sig/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbs +40 -0
  104. data/sig/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbs +61 -0
  105. data/sig/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbs +62 -0
  106. data/sig/growsurf_ruby/models/campaign_list_payouts_params.rbs +2 -1
  107. data/sig/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbs +28 -0
  108. data/sig/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbs +28 -0
  109. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +36 -16
  110. data/sig/growsurf_ruby/models/campaign_review_affiliate_application_params.rbs +79 -0
  111. data/sig/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbs +28 -0
  112. data/sig/growsurf_ruby/models/email_analytics.rbs +92 -0
  113. data/sig/growsurf_ruby/models/participant_payout_list.rbs +12 -4
  114. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +26 -4
  115. data/sig/growsurf_ruby/models.rbs +18 -0
  116. data/sig/growsurf_ruby/resources/campaign/participant.rbs +16 -2
  117. data/sig/growsurf_ruby/resources/campaign.rbs +53 -0
  118. metadata +54 -3
@@ -115,6 +115,12 @@ module GrowsurfRuby
115
115
  sig { params(queued_at: Integer).void }
116
116
  attr_writer :queued_at
117
117
 
118
+ sig { returns(T.nilable(Integer)) }
119
+ attr_reader :reversed_at
120
+
121
+ sig { params(reversed_at: Integer).void }
122
+ attr_writer :reversed_at
123
+
118
124
  sig do
119
125
  params(
120
126
  id: String,
@@ -133,7 +139,8 @@ module GrowsurfRuby
133
139
  fx_error: T.nilable(String),
134
140
  issued_at: Integer,
135
141
  provider: T.nilable(String),
136
- queued_at: Integer
142
+ queued_at: Integer,
143
+ reversed_at: Integer
137
144
  ).returns(T.attached_class)
138
145
  end
139
146
  def self.new(
@@ -152,7 +159,8 @@ module GrowsurfRuby
152
159
  fx_error: nil,
153
160
  issued_at: nil,
154
161
  provider: nil,
155
- queued_at: nil
162
+ queued_at: nil,
163
+ reversed_at: nil
156
164
  )
157
165
  end
158
166
 
@@ -175,7 +183,8 @@ module GrowsurfRuby
175
183
  fx_error: T.nilable(String),
176
184
  issued_at: Integer,
177
185
  provider: T.nilable(String),
178
- queued_at: Integer
186
+ queued_at: Integer,
187
+ reversed_at: Integer
179
188
  }
180
189
  )
181
190
  end
@@ -211,6 +220,11 @@ module GrowsurfRuby
211
220
  :FAILED,
212
221
  GrowsurfRuby::ParticipantPayoutList::Payout::Status::TaggedSymbol
213
222
  )
223
+ REVERSED =
224
+ T.let(
225
+ :REVERSED,
226
+ GrowsurfRuby::ParticipantPayoutList::Payout::Status::TaggedSymbol
227
+ )
214
228
 
215
229
  sig do
216
230
  override.returns(
@@ -18,26 +18,33 @@ module GrowsurfRuby
18
18
  sig { returns(T.nilable(Float)) }
19
19
  attr_accessor :fair_market_value_usd
20
20
 
21
- # Whether the reward's value counts toward 1099 thresholds/totals. `null` = use
22
- # the smart default for the reward's source.
23
- sig { returns(T.nilable(T::Boolean)) }
24
- attr_accessor :is_tax_reportable
21
+ # The reason the recipient earns this reward. `null` inherits the program's
22
+ # confirmed tax treatment for configurable non-commission rewards. Commission
23
+ # rewards always use `NONEMPLOYEE_SERVICES`.
24
+ sig do
25
+ returns(
26
+ T.nilable(GrowsurfRuby::RewardTaxValuation::TaxCharacter::OrSymbol)
27
+ )
28
+ end
29
+ attr_accessor :tax_character
25
30
 
26
31
  # Tax valuation settings for a reward. Only relevant when the program collects
27
32
  # tax documentation.
28
33
  sig do
29
34
  params(
30
35
  fair_market_value_usd: T.nilable(Float),
31
- is_tax_reportable: T.nilable(T::Boolean)
36
+ tax_character:
37
+ T.nilable(GrowsurfRuby::RewardTaxValuation::TaxCharacter::OrSymbol)
32
38
  ).returns(T.attached_class)
33
39
  end
34
40
  def self.new(
35
41
  # Manual fair-market value in USD (major units) used as the fallback when the
36
42
  # reward value cannot be resolved automatically. `null` = no manual value.
37
43
  fair_market_value_usd: nil,
38
- # Whether the reward's value counts toward 1099 thresholds/totals. `null` = use
39
- # the smart default for the reward's source.
40
- is_tax_reportable: nil
44
+ # The reason the recipient earns this reward. `null` inherits the program's
45
+ # confirmed tax treatment for configurable non-commission rewards. Commission
46
+ # rewards always use `NONEMPLOYEE_SERVICES`.
47
+ tax_character: nil
41
48
  )
42
49
  end
43
50
 
@@ -45,12 +52,62 @@ module GrowsurfRuby
45
52
  override.returns(
46
53
  {
47
54
  fair_market_value_usd: T.nilable(Float),
48
- is_tax_reportable: T.nilable(T::Boolean)
55
+ tax_character:
56
+ T.nilable(
57
+ GrowsurfRuby::RewardTaxValuation::TaxCharacter::OrSymbol
58
+ )
49
59
  }
50
60
  )
51
61
  end
52
62
  def to_hash
53
63
  end
64
+
65
+ # The U.S. federal tax character of a reward.
66
+ module TaxCharacter
67
+ extend GrowsurfRuby::Internal::Type::Enum
68
+
69
+ TaggedSymbol =
70
+ T.type_alias do
71
+ T.all(Symbol, GrowsurfRuby::RewardTaxValuation::TaxCharacter)
72
+ end
73
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
74
+
75
+ NONEMPLOYEE_SERVICES =
76
+ T.let(
77
+ :NONEMPLOYEE_SERVICES,
78
+ GrowsurfRuby::RewardTaxValuation::TaxCharacter::TaggedSymbol
79
+ )
80
+ PRIZE_OR_AWARD =
81
+ T.let(
82
+ :PRIZE_OR_AWARD,
83
+ GrowsurfRuby::RewardTaxValuation::TaxCharacter::TaggedSymbol
84
+ )
85
+ PURCHASE_REBATE =
86
+ T.let(
87
+ :PURCHASE_REBATE,
88
+ GrowsurfRuby::RewardTaxValuation::TaxCharacter::TaggedSymbol
89
+ )
90
+ OTHER_INCOME =
91
+ T.let(
92
+ :OTHER_INCOME,
93
+ GrowsurfRuby::RewardTaxValuation::TaxCharacter::TaggedSymbol
94
+ )
95
+ REVIEW_REQUIRED =
96
+ T.let(
97
+ :REVIEW_REQUIRED,
98
+ GrowsurfRuby::RewardTaxValuation::TaxCharacter::TaggedSymbol
99
+ )
100
+
101
+ sig do
102
+ override.returns(
103
+ T::Array[
104
+ GrowsurfRuby::RewardTaxValuation::TaxCharacter::TaggedSymbol
105
+ ]
106
+ )
107
+ end
108
+ def self.values
109
+ end
110
+ end
54
111
  end
55
112
  end
56
113
  end
@@ -3,6 +3,10 @@
3
3
  module GrowsurfRuby
4
4
  AccountCreateParams = GrowsurfRuby::Models::AccountCreateParams
5
5
 
6
+ AffiliateApplication = GrowsurfRuby::Models::AffiliateApplication
7
+
8
+ AffiliateInvite = GrowsurfRuby::Models::AffiliateInvite
9
+
6
10
  Team = GrowsurfRuby::Models::Team
7
11
 
8
12
  TeamUpdateParams = GrowsurfRuby::Models::TeamUpdateParams
@@ -11,11 +15,20 @@ module GrowsurfRuby
11
15
 
12
16
  CampaignAPI = GrowsurfRuby::Models::CampaignAPI
13
17
 
18
+ CampaignCreateAffiliateInviteParams =
19
+ GrowsurfRuby::Models::CampaignCreateAffiliateInviteParams
20
+
14
21
  CampaignCreateMobileParticipantTokenParams =
15
22
  GrowsurfRuby::Models::CampaignCreateMobileParticipantTokenParams
16
23
 
17
24
  CampaignCreateParams = GrowsurfRuby::Models::CampaignCreateParams
18
25
 
26
+ CampaignListAffiliateApplicationsParams =
27
+ GrowsurfRuby::Models::CampaignListAffiliateApplicationsParams
28
+
29
+ CampaignListAffiliateInvitesParams =
30
+ GrowsurfRuby::Models::CampaignListAffiliateInvitesParams
31
+
19
32
  CampaignListCommissionsParams =
20
33
  GrowsurfRuby::Models::CampaignListCommissionsParams
21
34
 
@@ -32,11 +45,23 @@ module GrowsurfRuby
32
45
  CampaignListReferralsParams =
33
46
  GrowsurfRuby::Models::CampaignListReferralsParams
34
47
 
48
+ CampaignResendAffiliateInviteParams =
49
+ GrowsurfRuby::Models::CampaignResendAffiliateInviteParams
50
+
51
+ CampaignRetrieveAffiliateApplicationParams =
52
+ GrowsurfRuby::Models::CampaignRetrieveAffiliateApplicationParams
53
+
35
54
  CampaignRetrieveAnalyticsParams =
36
55
  GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams
37
56
 
38
57
  CampaignRetrieveParams = GrowsurfRuby::Models::CampaignRetrieveParams
39
58
 
59
+ CampaignReviewAffiliateApplicationParams =
60
+ GrowsurfRuby::Models::CampaignReviewAffiliateApplicationParams
61
+
62
+ CampaignRevokeAffiliateInviteParams =
63
+ GrowsurfRuby::Models::CampaignRevokeAffiliateInviteParams
64
+
40
65
  CampaignUpdateParams = GrowsurfRuby::Models::CampaignUpdateParams
41
66
 
42
67
  CommissionStructure = GrowsurfRuby::Models::CommissionStructure
@@ -7,9 +7,9 @@ module GrowsurfRuby
7
7
  # Retrieves a program's design configuration — the same surface as the dashboard
8
8
  # Program Editor's **Design** tab: the GrowSurf window layout, header, share
9
9
  # channels + invite, signup form, portal/landing pages, theme styling, and the
10
- # referral/affiliate summary + status sections. This is a large object whose
11
- # available fields depend on the program type; the response includes every field
12
- # and its current value, which is the same shape you send back on `PATCH`.
10
+ # referral/affiliate summary + status sections. Available fields depend on the program type.
11
+ # `payoutDestinationConfirmation` is omitted when no confirmation fields are stored. Stored
12
+ # `null` fields are returned as `null`; omitted and `null` fields use localized defaults.
13
13
  sig do
14
14
  params(
15
15
  id: String,
@@ -23,11 +23,12 @@ module GrowsurfRuby
23
23
  )
24
24
  end
25
25
 
26
- # Updates a program's design configuration. Only the fields you send are changed;
27
- # anything you leave out is untouched (arrays such as `signup.fields` replace
28
- # wholesale). Unknown fields, fields not available for the program type, and
29
- # invalid values return a `400`. Landing-page custom code and JavaScript are not
30
- # editable via the API.
26
+ # Updates a program's design configuration, including the payout-destination confirmation
27
+ # page copy configured from payout integration cards. Only the fields you send are
28
+ # changed; anything you leave out is untouched (arrays such as `signup.fields` replace
29
+ # wholesale). Unknown fields, fields not available for the program type, and invalid
30
+ # values return a `400`. Landing-page custom code and JavaScript are not editable via the
31
+ # API.
31
32
  sig do
32
33
  params(
33
34
  id: String,
@@ -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, payout threshold + tax
10
- # settings (affiliate only), and notification-email settings.
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
  sig do
13
13
  params(
14
14
  id: String,
@@ -24,10 +24,10 @@ module GrowsurfRuby
24
24
 
25
25
  # Updates a program's options. Only the fields you send are changed. Some fields
26
26
  # are program-type specific (`requireManualRewardApproval`/`autoFulfillRewards`
27
- # are referral-only; `payoutThreshold`/`taxDocumentation` are affiliate-only, and
28
- # affiliate programs require `requireParticipantAuth: true`).
29
- # `fraud.recaptcha.secretKey` is write-only. `referralCreditWindowDays: null`
30
- # means "never expires".
27
+ # are referral-only; `affiliateApplicationMode`/`affiliateReapplicationPolicy`
28
+ # and `payoutThreshold`/`taxDocumentation` are affiliate-only, and affiliate
29
+ # programs require `requireParticipantAuth: true`). `fraud.recaptcha.secretKey`
30
+ # is write-only. `referralCreditWindowDays: null` means "never expires".
31
31
  sig do
32
32
  params(
33
33
  id: String,
@@ -21,17 +21,22 @@ module GrowsurfRuby
21
21
  )
22
22
  end
23
23
 
24
- # Updates a participant by GrowSurf participant ID or email address.
24
+ # Updates a participant by GrowSurf participant ID or email address. For affiliate
25
+ # programs, set `affiliateStatus` to `APPROVED`, `SUSPENDED`, or `BANNED`.
26
+ # `APPROVED` enrolls the participant as an affiliate. `SUSPENDED` and `BANNED`
27
+ # require an existing affiliate. This endpoint does not accept `isAffiliate`, and
28
+ # affiliate enrollment cannot be removed through REST.
25
29
  sig do
26
30
  params(
27
31
  participant_id_or_email: String,
28
32
  id: String,
33
+ affiliate_status:
34
+ GrowsurfRuby::Campaign::ParticipantUpdateParams::AffiliateStatus::OrSymbol,
29
35
  email: String,
30
36
  first_name: String,
31
37
  last_name: String,
32
38
  metadata: T::Hash[Symbol, T.anything],
33
39
  notes: String,
34
- paypal_email: String,
35
40
  referral_status:
36
41
  GrowsurfRuby::Campaign::ParticipantUpdateParams::ReferralStatus::OrSymbol,
37
42
  referred_by: String,
@@ -45,6 +50,10 @@ module GrowsurfRuby
45
50
  participant_id_or_email,
46
51
  # Path param: GrowSurf program ID.
47
52
  id:,
53
+ # Body param: Affiliate programs only. Sets the affiliate status. `APPROVED` also
54
+ # enrolls a participant who is not yet an affiliate. `SUSPENDED` and `BANNED`
55
+ # are rejected for non-affiliates.
56
+ affiliate_status: nil,
48
57
  # Body param
49
58
  email: nil,
50
59
  # Body param
@@ -56,8 +65,6 @@ module GrowsurfRuby
56
65
  # Body param: Freeform internal notes about the participant (internal only, never
57
66
  # exposed to participants).
58
67
  notes: nil,
59
- # Body param: The participant's PayPal email address, used for affiliate payouts.
60
- paypal_email: nil,
61
68
  # Body param
62
69
  referral_status: nil,
63
70
  # Body param
@@ -114,7 +121,13 @@ module GrowsurfRuby
114
121
  end
115
122
 
116
123
  # Adds a new participant to the program. If the email already exists, the existing
117
- # participant is returned.
124
+ # participant is returned unchanged. For affiliate programs, set `isAffiliate` to
125
+ # `true` to enroll a new participant as an approved affiliate or `false` to create
126
+ # a non-affiliate. If you omit `isAffiliate`, a valid `referredBy` creates a
127
+ # referred non-affiliate; without a valid referrer, the new participant is enrolled
128
+ # as an approved affiliate. You can send a valid `referredBy` with
129
+ # `isAffiliate: true` to keep the referral attribution and enroll the participant
130
+ # as an affiliate.
118
131
  sig do
119
132
  params(
120
133
  id: String,
@@ -122,6 +135,7 @@ module GrowsurfRuby
122
135
  fingerprint: String,
123
136
  first_name: String,
124
137
  ip_address: String,
138
+ is_affiliate: T::Boolean,
125
139
  last_name: String,
126
140
  metadata: T::Hash[Symbol, T.anything],
127
141
  mobile_instance_id: String,
@@ -138,6 +152,11 @@ module GrowsurfRuby
138
152
  fingerprint: nil,
139
153
  first_name: nil,
140
154
  ip_address: nil,
155
+ # Affiliate programs only. Controls affiliate enrollment for a new participant.
156
+ # `true` enrolls the participant with `affiliateStatus: APPROVED`; `false`
157
+ # creates a non-affiliate without `affiliateStatus`. Existing participants are
158
+ # returned unchanged.
159
+ is_affiliate: nil,
141
160
  last_name: nil,
142
161
  # Shallow custom metadata object.
143
162
  metadata: nil,
@@ -602,18 +621,19 @@ module GrowsurfRuby
602
621
  )
603
622
  end
604
623
 
605
- # Retrieves analytics for a single participant — all-time engagement counters,
606
- # leaderboard ranks, and per-channel share counts (plus affiliate money metrics
607
- # for affiliate programs). Useful for segmenting and re-engaging participants.
608
- # Pass `include=series` to also get this participant's own activity over time.
624
+ # Retrieves analytics for a single participant — all-time engagement counters, leaderboard
625
+ # ranks, and per-channel share counts (plus affiliate revenue, commission, and payout
626
+ # metrics for affiliate programs). Pass `include=email` for `sent` (accepted for
627
+ # delivery), `delivered`, `opened`, `clicked`, `bounced`, and `spamComplaints` metrics
628
+ # attributed to this participant, including invitations they sent. Use
629
+ # `include=email,series` to include the same counts in each UTC series bucket.
609
630
  sig do
610
631
  params(
611
632
  participant_id_or_email: String,
612
633
  id: String,
613
634
  days: Integer,
614
635
  end_date: Integer,
615
- include:
616
- GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include::OrSymbol,
636
+ include: String,
617
637
  interval:
618
638
  GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::OrSymbol,
619
639
  start_date: Integer,
@@ -632,9 +652,15 @@ module GrowsurfRuby
632
652
  # End date of the analytics timeframe as a Unix timestamp in milliseconds.
633
653
  # Required if `days` is not set.
634
654
  end_date: nil,
635
- # Set to `series` to also return this participant's own activity per period.
655
+ # Comma-separated optional data. `series` returns this participant's own activity per
656
+ # period; `email` returns `sent`, `delivered`, `opened`, `clicked`, `bounced`,
657
+ # `spamComplaints`, and per-email-type metrics attributed to the participant for the
658
+ # requested analytics window (including invitations they sent). Request both in either
659
+ # order to add email counts to every series item for emails sent during that period.
660
+ # Only documented tokens are accepted; an unknown token returns `400`.
636
661
  include: nil,
637
- # Bucket size for the `series` (only used with `include=series`). Defaults to `day`.
662
+ # Bucket size for the `series` (only used when `include` contains `series`). Defaults to
663
+ # `day`.
638
664
  interval: nil,
639
665
  # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
640
666
  # Required if `days` is not set.
@@ -643,6 +669,56 @@ module GrowsurfRuby
643
669
  )
644
670
  end
645
671
 
672
+ # Returns a participant's payout-destination status across every payout provider
673
+ # enabled for the program (PayPal and/or Wise). For each provider it reports the
674
+ # current status, the confirmed claim email, the legal recipient type, and — when a
675
+ # delivery bounced or a recipient was invalidated — the repair reason.
676
+ # `activeProvider` is the provider that currently gets paid, or `null` until the
677
+ # participant confirms one.
678
+ sig do
679
+ params(
680
+ participant_id_or_email: String,
681
+ id: String,
682
+ request_options: GrowsurfRuby::RequestOptions::OrHash
683
+ ).returns(
684
+ GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationResponse
685
+ )
686
+ end
687
+ def get_payout_destination(
688
+ # GrowSurf participant ID or URL-encoded participant email address.
689
+ participant_id_or_email,
690
+ # GrowSurf program ID.
691
+ id:,
692
+ request_options: {}
693
+ )
694
+ end
695
+
696
+ # Sends the participant a one-time link to confirm their payout destination for
697
+ # the chosen provider. Only the participant can open the link and confirm — this
698
+ # endpoint just triggers the message. The provider must be enabled for the
699
+ # program.
700
+ sig do
701
+ params(
702
+ participant_id_or_email: String,
703
+ id: String,
704
+ provider:
705
+ GrowsurfRuby::Campaign::ParticipantRequestPayoutDestinationConfirmationParams::Provider::OrSymbol,
706
+ request_options: GrowsurfRuby::RequestOptions::OrHash
707
+ ).returns(
708
+ GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationResponse
709
+ )
710
+ end
711
+ def request_payout_destination_confirmation(
712
+ # Path param: GrowSurf participant ID or URL-encoded participant email address.
713
+ participant_id_or_email,
714
+ # Path param: GrowSurf program ID.
715
+ id:,
716
+ # Body param: The payout provider the participant should confirm a destination for.
717
+ provider:,
718
+ request_options: {}
719
+ )
720
+ end
721
+
646
722
  # @api private
647
723
  sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
648
724
  def self.new(client:)
@@ -105,8 +105,8 @@ module GrowsurfRuby
105
105
  referral_description: nil,
106
106
  # Body param
107
107
  referred_reward_upfront: nil,
108
- # Body param: Tax valuation for the referred friend's side of a double-sided
109
- # reward. Defaults to not tax-reportable (a purchase rebate).
108
+ # Body param: Tax treatment override for the referred friend's side of a double-sided
109
+ # reward. Defaults to the program's confirmed default.
110
110
  referred_value: nil,
111
111
  # Body param
112
112
  title: nil,
@@ -201,8 +201,8 @@ module GrowsurfRuby
201
201
  referral_description: nil,
202
202
  # Body param
203
203
  referred_reward_upfront: nil,
204
- # Body param: Tax valuation for the referred friend's side of a double-sided
205
- # reward. Defaults to not tax-reportable (a purchase rebate).
204
+ # Body param: Tax treatment override for the referred friend's side of a double-sided
205
+ # reward. Defaults to the program's confirmed default.
206
206
  referred_value: nil,
207
207
  # Body param
208
208
  title: nil,