growsurf-ruby 0.8.0 → 1.1.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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/client.rb +4 -0
  5. data/lib/growsurf_ruby/models/account.rb +90 -0
  6. data/lib/growsurf_ruby/models/account_create_params.rb +46 -0
  7. data/lib/growsurf_ruby/models/account_create_response.rb +64 -0
  8. data/lib/growsurf_ruby/models/account_resend_verification_email_response.rb +33 -0
  9. data/lib/growsurf_ruby/models/account_rotate_api_key_response.rb +17 -0
  10. data/lib/growsurf_ruby/models/account_update_params.rb +35 -0
  11. data/lib/growsurf_ruby/models/campaign/campaign_reward_list_response.rb +2 -2
  12. data/lib/growsurf_ruby/models/campaign/create.rb +5 -1
  13. data/lib/growsurf_ruby/models/campaign/participant_activity_logs_response.rb +65 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +421 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_bulk_delete_params.rb +35 -0
  16. data/lib/growsurf_ruby/models/campaign/participant_bulk_delete_response.rb +151 -0
  17. data/lib/growsurf_ruby/models/campaign/participant_email_params.rb +76 -0
  18. data/lib/growsurf_ruby/models/campaign/participant_email_response.rb +38 -0
  19. data/lib/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rb +46 -0
  20. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +98 -0
  21. data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +21 -1
  22. data/lib/growsurf_ruby/models/campaign/reward.rb +43 -5
  23. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +48 -15
  24. data/lib/growsurf_ruby/models/campaign/reward_delete_params.rb +4 -4
  25. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +51 -18
  26. data/lib/growsurf_ruby/models/campaign/webhook.rb +72 -0
  27. data/lib/growsurf_ruby/models/campaign/webhook_create_params.rb +52 -0
  28. data/lib/growsurf_ruby/models/campaign/webhook_delete_params.rb +28 -0
  29. data/lib/growsurf_ruby/models/campaign/webhook_delete_response.rb +24 -0
  30. data/lib/growsurf_ruby/models/campaign/webhook_event.rb +23 -0
  31. data/lib/growsurf_ruby/models/campaign/webhook_list_response.rb +18 -0
  32. data/lib/growsurf_ruby/models/campaign/webhook_test_params.rb +42 -0
  33. data/lib/growsurf_ruby/models/campaign/webhook_test_response.rb +50 -0
  34. data/lib/growsurf_ruby/models/campaign/webhook_update_params.rb +59 -0
  35. data/lib/growsurf_ruby/models/campaign.rb +43 -5
  36. data/lib/growsurf_ruby/models/campaign_create_params.rb +1 -15
  37. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +36 -1
  38. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +538 -1
  39. data/lib/growsurf_ruby/models/campaign_update_params.rb +1 -53
  40. data/lib/growsurf_ruby/models/commission_structure.rb +8 -2
  41. data/lib/growsurf_ruby/models/referral_flow_screenshots_response.rb +72 -0
  42. data/lib/growsurf_ruby/models/reward_tax_valuation.rb +35 -0
  43. data/lib/growsurf_ruby/models.rb +10 -0
  44. data/lib/growsurf_ruby/resources/account.rb +159 -0
  45. data/lib/growsurf_ruby/resources/campaign/design.rb +68 -0
  46. data/lib/growsurf_ruby/resources/campaign/emails.rb +66 -0
  47. data/lib/growsurf_ruby/resources/campaign/installation.rb +67 -0
  48. data/lib/growsurf_ruby/resources/campaign/options.rb +66 -0
  49. data/lib/growsurf_ruby/resources/campaign/participant.rb +170 -2
  50. data/lib/growsurf_ruby/resources/campaign/rewards.rb +36 -32
  51. data/lib/growsurf_ruby/resources/campaign/webhooks.rb +157 -0
  52. data/lib/growsurf_ruby/resources/campaign.rb +62 -27
  53. data/lib/growsurf_ruby/version.rb +1 -1
  54. data/lib/growsurf_ruby.rb +31 -0
  55. data/rbi/growsurf_ruby/client.rbi +3 -0
  56. data/rbi/growsurf_ruby/models/account.rbi +125 -0
  57. data/rbi/growsurf_ruby/models/account_create_params.rbi +73 -0
  58. data/rbi/growsurf_ruby/models/account_create_response.rbi +115 -0
  59. data/rbi/growsurf_ruby/models/account_resend_verification_email_response.rbi +76 -0
  60. data/rbi/growsurf_ruby/models/account_rotate_api_key_response.rbi +30 -0
  61. data/rbi/growsurf_ruby/models/account_update_params.rbi +65 -0
  62. data/rbi/growsurf_ruby/models/campaign/campaign_reward_list_response.rbi +2 -2
  63. data/rbi/growsurf_ruby/models/campaign/create.rbi +8 -0
  64. data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +111 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +630 -0
  66. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_params.rbi +56 -0
  67. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +285 -0
  68. data/rbi/growsurf_ruby/models/campaign/participant_email_params.rbi +118 -0
  69. data/rbi/growsurf_ruby/models/campaign/participant_email_response.rbi +84 -0
  70. data/rbi/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rbi +74 -0
  71. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +207 -0
  72. data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +24 -0
  73. data/rbi/growsurf_ruby/models/campaign/reward.rbi +63 -3
  74. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +62 -9
  75. data/rbi/growsurf_ruby/models/campaign/reward_delete_params.rbi +4 -4
  76. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +66 -13
  77. data/rbi/growsurf_ruby/models/campaign/webhook.rbi +93 -0
  78. data/rbi/growsurf_ruby/models/campaign/webhook_create_params.rbi +91 -0
  79. data/rbi/growsurf_ruby/models/campaign/webhook_delete_params.rbi +48 -0
  80. data/rbi/growsurf_ruby/models/campaign/webhook_delete_response.rbi +33 -0
  81. data/rbi/growsurf_ruby/models/campaign/webhook_event.rbi +60 -0
  82. data/rbi/growsurf_ruby/models/campaign/webhook_list_response.rbi +36 -0
  83. data/rbi/growsurf_ruby/models/campaign/webhook_test_params.rbi +69 -0
  84. data/rbi/growsurf_ruby/models/campaign/webhook_test_response.rbi +102 -0
  85. data/rbi/growsurf_ruby/models/campaign/webhook_update_params.rbi +98 -0
  86. data/rbi/growsurf_ruby/models/campaign.rbi +63 -3
  87. data/rbi/growsurf_ruby/models/campaign_create_params.rbi +0 -18
  88. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +91 -0
  89. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +1011 -3
  90. data/rbi/growsurf_ruby/models/campaign_update_params.rbi +0 -78
  91. data/rbi/growsurf_ruby/models/commission_structure.rbi +8 -2
  92. data/rbi/growsurf_ruby/models/referral_flow_screenshots_response.rbi +94 -0
  93. data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +56 -0
  94. data/rbi/growsurf_ruby/models.rbi +11 -0
  95. data/rbi/growsurf_ruby/resources/account.rbi +112 -0
  96. data/rbi/growsurf_ruby/resources/campaign/design.rbi +52 -0
  97. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +51 -0
  98. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +53 -0
  99. data/rbi/growsurf_ruby/resources/campaign/options.rbi +51 -0
  100. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +160 -0
  101. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +61 -29
  102. data/rbi/growsurf_ruby/resources/campaign/webhooks.rbi +123 -0
  103. data/rbi/growsurf_ruby/resources/campaign.rbi +58 -32
  104. data/sig/growsurf_ruby/client.rbs +2 -0
  105. data/sig/growsurf_ruby/models/account.rbs +67 -0
  106. data/sig/growsurf_ruby/models/account_create_params.rbs +42 -0
  107. data/sig/growsurf_ruby/models/account_create_response.rbs +47 -0
  108. data/sig/growsurf_ruby/models/account_resend_verification_email_response.rbs +35 -0
  109. data/sig/growsurf_ruby/models/account_rotate_api_key_response.rbs +13 -0
  110. data/sig/growsurf_ruby/models/account_update_params.rbs +42 -0
  111. data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +59 -0
  112. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +407 -0
  113. data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_params.rbs +30 -0
  114. data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbs +125 -0
  115. data/sig/growsurf_ruby/models/campaign/participant_email_params.rbs +61 -0
  116. data/sig/growsurf_ruby/models/campaign/participant_email_response.rbs +37 -0
  117. data/sig/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rbs +47 -0
  118. data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +90 -0
  119. data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +14 -0
  120. data/sig/growsurf_ruby/models/campaign/reward.rbs +18 -3
  121. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +19 -8
  122. data/sig/growsurf_ruby/models/campaign/reward_delete_params.rbs +4 -4
  123. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +23 -12
  124. data/sig/growsurf_ruby/models/campaign/webhook.rbs +52 -0
  125. data/sig/growsurf_ruby/models/campaign/webhook_create_params.rbs +51 -0
  126. data/sig/growsurf_ruby/models/campaign/webhook_delete_params.rbs +30 -0
  127. data/sig/growsurf_ruby/models/campaign/webhook_delete_response.rbs +17 -0
  128. data/sig/growsurf_ruby/models/campaign/webhook_event.rbs +28 -0
  129. data/sig/growsurf_ruby/models/campaign/webhook_list_response.rbs +18 -0
  130. data/sig/growsurf_ruby/models/campaign/webhook_test_params.rbs +42 -0
  131. data/sig/growsurf_ruby/models/campaign/webhook_test_response.rbs +54 -0
  132. data/sig/growsurf_ruby/models/campaign/webhook_update_params.rbs +63 -0
  133. data/sig/growsurf_ruby/models/campaign.rbs +18 -3
  134. data/sig/growsurf_ruby/models/campaign_create_params.rbs +0 -14
  135. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_params.rbs +35 -1
  136. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +533 -3
  137. data/sig/growsurf_ruby/models/campaign_update_params.rbs +1 -53
  138. data/sig/growsurf_ruby/models/commission_structure.rbs +7 -2
  139. data/sig/growsurf_ruby/models/referral_flow_screenshots_response.rbs +54 -0
  140. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +22 -0
  141. data/sig/growsurf_ruby/models.rbs +10 -0
  142. data/sig/growsurf_ruby/resources/account.rbs +38 -0
  143. data/sig/growsurf_ruby/resources/campaign/design.rbs +20 -0
  144. data/sig/growsurf_ruby/resources/campaign/emails.rbs +20 -0
  145. data/sig/growsurf_ruby/resources/campaign/installation.rbs +20 -0
  146. data/sig/growsurf_ruby/resources/campaign/options.rbs +20 -0
  147. data/sig/growsurf_ruby/resources/campaign/participant.rbs +37 -0
  148. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +6 -4
  149. data/sig/growsurf_ruby/resources/campaign/webhooks.rbs +46 -0
  150. data/sig/growsurf_ruby/resources/campaign.rbs +17 -9
  151. metadata +95 -2
@@ -0,0 +1,207 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ module Campaign
6
+ class ParticipantRetrieveAnalyticsParams < GrowsurfRuby::Internal::Type::BaseModel
7
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
8
+ include GrowsurfRuby::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams,
14
+ GrowsurfRuby::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :participant_id_or_email
23
+
24
+ # Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
25
+ sig { returns(T.nilable(Integer)) }
26
+ attr_reader :days
27
+
28
+ sig { params(days: Integer).void }
29
+ attr_writer :days
30
+
31
+ # End date of the analytics timeframe as a Unix timestamp in milliseconds.
32
+ # Required if `days` is not set.
33
+ sig { returns(T.nilable(Integer)) }
34
+ attr_reader :end_date
35
+
36
+ sig { params(end_date: Integer).void }
37
+ attr_writer :end_date
38
+
39
+ # Set to `series` to also return this participant's own activity per period.
40
+ sig do
41
+ returns(
42
+ T.nilable(
43
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include::OrSymbol
44
+ )
45
+ )
46
+ end
47
+ attr_reader :include
48
+
49
+ sig do
50
+ params(
51
+ include:
52
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include::OrSymbol
53
+ ).void
54
+ end
55
+ attr_writer :include
56
+
57
+ # Bucket size for the `series` (only used with `include=series`). Defaults to `day`.
58
+ sig do
59
+ returns(
60
+ T.nilable(
61
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::OrSymbol
62
+ )
63
+ )
64
+ end
65
+ attr_reader :interval
66
+
67
+ sig do
68
+ params(
69
+ interval:
70
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::OrSymbol
71
+ ).void
72
+ end
73
+ attr_writer :interval
74
+
75
+ # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
76
+ # Required if `days` is not set.
77
+ sig { returns(T.nilable(Integer)) }
78
+ attr_reader :start_date
79
+
80
+ sig { params(start_date: Integer).void }
81
+ attr_writer :start_date
82
+
83
+ sig do
84
+ params(
85
+ id: String,
86
+ participant_id_or_email: String,
87
+ days: Integer,
88
+ end_date: Integer,
89
+ include:
90
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include::OrSymbol,
91
+ interval:
92
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::OrSymbol,
93
+ start_date: Integer,
94
+ request_options: GrowsurfRuby::RequestOptions::OrHash
95
+ ).returns(T.attached_class)
96
+ end
97
+ def self.new(
98
+ id:,
99
+ participant_id_or_email:,
100
+ # Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
101
+ days: nil,
102
+ # End date of the analytics timeframe as a Unix timestamp in milliseconds.
103
+ # Required if `days` is not set.
104
+ end_date: nil,
105
+ # Set to `series` to also return this participant's own activity per period.
106
+ include: nil,
107
+ # Bucket size for the `series` (only used with `include=series`). Defaults to `day`.
108
+ interval: nil,
109
+ # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
110
+ # Required if `days` is not set.
111
+ start_date: nil,
112
+ request_options: {}
113
+ )
114
+ end
115
+
116
+ sig do
117
+ override.returns(
118
+ {
119
+ id: String,
120
+ participant_id_or_email: String,
121
+ days: Integer,
122
+ end_date: Integer,
123
+ include:
124
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include::OrSymbol,
125
+ interval:
126
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::OrSymbol,
127
+ start_date: Integer,
128
+ request_options: GrowsurfRuby::RequestOptions
129
+ }
130
+ )
131
+ end
132
+ def to_hash
133
+ end
134
+
135
+ # Set to `series` to also return this participant's own activity per period.
136
+ module Include
137
+ extend GrowsurfRuby::Internal::Type::Enum
138
+
139
+ TaggedSymbol =
140
+ T.type_alias do
141
+ T.all(
142
+ Symbol,
143
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include
144
+ )
145
+ end
146
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
147
+
148
+ SERIES =
149
+ T.let(
150
+ :series,
151
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include::TaggedSymbol
152
+ )
153
+
154
+ sig do
155
+ override.returns(
156
+ T::Array[
157
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include::TaggedSymbol
158
+ ]
159
+ )
160
+ end
161
+ def self.values
162
+ end
163
+ end
164
+
165
+ # Bucket size for the `series` (only used with `include=series`). Defaults to `day`.
166
+ module Interval
167
+ extend GrowsurfRuby::Internal::Type::Enum
168
+
169
+ TaggedSymbol =
170
+ T.type_alias do
171
+ T.all(
172
+ Symbol,
173
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval
174
+ )
175
+ end
176
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
177
+
178
+ DAY =
179
+ T.let(
180
+ :day,
181
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::TaggedSymbol
182
+ )
183
+ WEEK =
184
+ T.let(
185
+ :week,
186
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::TaggedSymbol
187
+ )
188
+ MONTH =
189
+ T.let(
190
+ :month,
191
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::TaggedSymbol
192
+ )
193
+
194
+ sig do
195
+ override.returns(
196
+ T::Array[
197
+ GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::TaggedSymbol
198
+ ]
199
+ )
200
+ end
201
+ def self.values
202
+ end
203
+ end
204
+ end
205
+ end
206
+ end
207
+ end
@@ -46,6 +46,21 @@ module GrowsurfRuby
46
46
  sig { params(metadata: T::Hash[Symbol, T.anything]).void }
47
47
  attr_writer :metadata
48
48
 
49
+ # Freeform internal notes about the participant (internal only, never exposed to
50
+ # participants).
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :notes
53
+
54
+ sig { params(notes: String).void }
55
+ attr_writer :notes
56
+
57
+ # The participant's PayPal email address, used for affiliate payouts.
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :paypal_email
60
+
61
+ sig { params(paypal_email: String).void }
62
+ attr_writer :paypal_email
63
+
49
64
  sig do
50
65
  returns(
51
66
  T.nilable(
@@ -89,6 +104,8 @@ module GrowsurfRuby
89
104
  first_name: String,
90
105
  last_name: String,
91
106
  metadata: T::Hash[Symbol, T.anything],
107
+ notes: String,
108
+ paypal_email: String,
92
109
  referral_status:
93
110
  GrowsurfRuby::Campaign::ParticipantUpdateParams::ReferralStatus::OrSymbol,
94
111
  referred_by: String,
@@ -105,6 +122,11 @@ module GrowsurfRuby
105
122
  last_name: nil,
106
123
  # Shallow custom metadata object.
107
124
  metadata: nil,
125
+ # Freeform internal notes about the participant (internal only, never exposed to
126
+ # participants).
127
+ notes: nil,
128
+ # The participant's PayPal email address, used for affiliate payouts.
129
+ paypal_email: nil,
108
130
  referral_status: nil,
109
131
  referred_by: nil,
110
132
  unsubscribed: nil,
@@ -122,6 +144,8 @@ module GrowsurfRuby
122
144
  first_name: String,
123
145
  last_name: String,
124
146
  metadata: T::Hash[Symbol, T.anything],
147
+ notes: String,
148
+ paypal_email: String,
125
149
  referral_status:
126
150
  GrowsurfRuby::Campaign::ParticipantUpdateParams::ReferralStatus::OrSymbol,
127
151
  referred_by: String,
@@ -41,6 +41,9 @@ module GrowsurfRuby
41
41
  sig { returns(T.nilable(Integer)) }
42
42
  attr_accessor :conversions_required
43
43
 
44
+ # Legacy static coupon code shown to the referrer in the reward-won email and
45
+ # webhook. Display text only; superseded by a connected billing integration's
46
+ # issued coupon when one exists.
44
47
  sig { returns(T.nilable(String)) }
45
48
  attr_accessor :coupon_code
46
49
 
@@ -63,18 +66,30 @@ module GrowsurfRuby
63
66
  end
64
67
  attr_accessor :limit_duration
65
68
 
69
+ # Text shown before a participant's referral count in milestone-progress copy.
70
+ # Applies to `MILESTONE` rewards.
66
71
  sig { returns(T.nilable(String)) }
67
72
  attr_accessor :next_milestone_prefix
68
73
 
74
+ # Text shown after a participant's referral count in milestone-progress copy.
75
+ # Applies to `MILESTONE` rewards.
69
76
  sig { returns(T.nilable(String)) }
70
77
  attr_accessor :next_milestone_suffix
71
78
 
79
+ # The number of winners (`LEADERBOARD` rewards only). With `limitDuration`
80
+ # `PER_MONTH` this many win each month, otherwise this many win in total.
72
81
  sig { returns(T.nilable(Integer)) }
73
82
  attr_accessor :number_of_winners
74
83
 
75
84
  sig { returns(T.nilable(Integer)) }
76
85
  attr_accessor :order
77
86
 
87
+ # Legacy static coupon code shown to the referred friend (double-sided rewards)
88
+ # in the reward-won email and webhook. Display text only; superseded by a
89
+ # connected billing integration's issued coupon when one exists.
90
+ sig { returns(T.nilable(String)) }
91
+ attr_accessor :referral_coupon_code
92
+
78
93
  sig { returns(T.nilable(String)) }
79
94
  attr_accessor :referral_description
80
95
 
@@ -84,6 +99,28 @@ module GrowsurfRuby
84
99
  sig { params(referred_reward_upfront: T::Boolean).void }
85
100
  attr_writer :referred_reward_upfront
86
101
 
102
+ # Tax valuation for the referred friend's side of a double-sided reward.
103
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
104
+ attr_reader :referred_value
105
+
106
+ sig do
107
+ params(
108
+ referred_value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
109
+ ).void
110
+ end
111
+ attr_writer :referred_value
112
+
113
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
114
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
115
+ attr_reader :value
116
+
117
+ sig do
118
+ params(
119
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
120
+ ).void
121
+ end
122
+ attr_writer :value
123
+
87
124
  sig do
88
125
  params(
89
126
  id: String,
@@ -105,8 +142,11 @@ module GrowsurfRuby
105
142
  next_milestone_suffix: T.nilable(String),
106
143
  number_of_winners: T.nilable(Integer),
107
144
  order: T.nilable(Integer),
145
+ referral_coupon_code: T.nilable(String),
108
146
  referral_description: T.nilable(String),
109
- referred_reward_upfront: T::Boolean
147
+ referred_reward_upfront: T::Boolean,
148
+ referred_value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash),
149
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
110
150
  ).returns(T.attached_class)
111
151
  end
112
152
  def self.new(
@@ -117,18 +157,35 @@ module GrowsurfRuby
117
157
  type:,
118
158
  commission_structure: nil,
119
159
  conversions_required: nil,
160
+ # Legacy static coupon code shown to the referrer in the reward-won email and
161
+ # webhook. Display text only; superseded by a connected billing integration's
162
+ # issued coupon when one exists.
120
163
  coupon_code: nil,
121
164
  description: nil,
122
165
  image_url: nil,
123
166
  # `-1` represents an unlimited reward in REST responses.
124
167
  limit: nil,
125
168
  limit_duration: nil,
169
+ # Text shown before a participant's referral count in milestone-progress copy.
170
+ # Applies to `MILESTONE` rewards.
126
171
  next_milestone_prefix: nil,
172
+ # Text shown after a participant's referral count in milestone-progress copy.
173
+ # Applies to `MILESTONE` rewards.
127
174
  next_milestone_suffix: nil,
175
+ # The number of winners (`LEADERBOARD` rewards only). With `limitDuration`
176
+ # `PER_MONTH` this many win each month, otherwise this many win in total.
128
177
  number_of_winners: nil,
129
178
  order: nil,
179
+ # Legacy static coupon code shown to the referred friend (double-sided rewards)
180
+ # in the reward-won email and webhook. Display text only; superseded by a
181
+ # connected billing integration's issued coupon when one exists.
182
+ referral_coupon_code: nil,
130
183
  referral_description: nil,
131
- referred_reward_upfront: nil
184
+ referred_reward_upfront: nil,
185
+ # Tax valuation for the referred friend's side of a double-sided reward.
186
+ referred_value: nil,
187
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
188
+ value: nil
132
189
  )
133
190
  end
134
191
 
@@ -154,8 +211,11 @@ module GrowsurfRuby
154
211
  next_milestone_suffix: T.nilable(String),
155
212
  number_of_winners: T.nilable(Integer),
156
213
  order: T.nilable(Integer),
214
+ referral_coupon_code: T.nilable(String),
157
215
  referral_description: T.nilable(String),
158
- referred_reward_upfront: T::Boolean
216
+ referred_reward_upfront: T::Boolean,
217
+ referred_value: T.nilable(GrowsurfRuby::RewardTaxValuation),
218
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation)
159
219
  }
160
220
  )
161
221
  end
@@ -38,6 +38,9 @@ module GrowsurfRuby
38
38
  sig { params(conversions_required: Integer).void }
39
39
  attr_writer :conversions_required
40
40
 
41
+ # Legacy static coupon code shown to the referrer in the reward-won email and
42
+ # webhook. Display text only; superseded by a connected billing integration's
43
+ # issued coupon when one exists.
41
44
  sig { returns(T.nilable(String)) }
42
45
  attr_reader :coupon_code
43
46
 
@@ -56,18 +59,16 @@ module GrowsurfRuby
56
59
  sig { params(image_url: String).void }
57
60
  attr_writer :image_url
58
61
 
59
- sig { returns(T.nilable(T::Boolean)) }
60
- attr_reader :is_active
61
-
62
- sig { params(is_active: T::Boolean).void }
63
- attr_writer :is_active
64
-
62
+ # Whether the reward can be earned an unlimited number of times. Defaults to
63
+ # `true`, except `MILESTONE` rewards, which can only be earned once.
65
64
  sig { returns(T.nilable(T::Boolean)) }
66
65
  attr_reader :is_unlimited
67
66
 
68
67
  sig { params(is_unlimited: T::Boolean).void }
69
68
  attr_writer :is_unlimited
70
69
 
70
+ # Whether the reward is enabled. When `false` the reward is disabled: hidden from
71
+ # participants and no longer awarded, including those who already earned it.
71
72
  sig { returns(T.nilable(T::Boolean)) }
72
73
  attr_reader :is_visible
73
74
 
@@ -104,18 +105,25 @@ module GrowsurfRuby
104
105
  sig { params(metadata: T::Hash[Symbol, T.anything]).void }
105
106
  attr_writer :metadata
106
107
 
108
+ # Text shown before a participant's referral count in milestone-progress copy.
109
+ # Applies to `MILESTONE` rewards.
107
110
  sig { returns(T.nilable(String)) }
108
111
  attr_reader :next_milestone_prefix
109
112
 
110
113
  sig { params(next_milestone_prefix: String).void }
111
114
  attr_writer :next_milestone_prefix
112
115
 
116
+ # Text shown after a participant's referral count in milestone-progress copy.
117
+ # Applies to `MILESTONE` rewards.
113
118
  sig { returns(T.nilable(String)) }
114
119
  attr_reader :next_milestone_suffix
115
120
 
116
121
  sig { params(next_milestone_suffix: String).void }
117
122
  attr_writer :next_milestone_suffix
118
123
 
124
+ # The number of winners (`LEADERBOARD` rewards only). With `limitDuration`
125
+ # `PER_MONTH` this many win each month, otherwise this many win in total;
126
+ # omitting it defaults to `3`.
119
127
  sig { returns(T.nilable(Integer)) }
120
128
  attr_reader :number_of_winners
121
129
 
@@ -128,6 +136,9 @@ module GrowsurfRuby
128
136
  sig { params(order: Integer).void }
129
137
  attr_writer :order
130
138
 
139
+ # Legacy static coupon code shown to the referred friend (double-sided rewards)
140
+ # in the reward-won email and webhook. Display text only; superseded by a
141
+ # connected billing integration's issued coupon when one exists.
131
142
  sig { returns(T.nilable(String)) }
132
143
  attr_reader :referral_coupon_code
133
144
 
@@ -146,12 +157,30 @@ module GrowsurfRuby
146
157
  sig { params(referred_reward_upfront: T::Boolean).void }
147
158
  attr_writer :referred_reward_upfront
148
159
 
160
+ # Tax valuation for the referred friend's side of a double-sided reward.
161
+ # Defaults to not tax-reportable (a purchase rebate).
162
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
163
+ attr_reader :referred_value
164
+
165
+ sig do
166
+ params(referred_value: GrowsurfRuby::RewardTaxValuation::OrHash).void
167
+ end
168
+ attr_writer :referred_value
169
+
149
170
  sig { returns(T.nilable(String)) }
150
171
  attr_reader :title
151
172
 
152
173
  sig { params(title: String).void }
153
174
  attr_writer :title
154
175
 
176
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
177
+ # Used by tax documentation / 1099 reporting.
178
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
179
+ attr_reader :value
180
+
181
+ sig { params(value: GrowsurfRuby::RewardTaxValuation::OrHash).void }
182
+ attr_writer :value
183
+
155
184
  sig do
156
185
  params(
157
186
  type:
@@ -161,7 +190,6 @@ module GrowsurfRuby
161
190
  coupon_code: String,
162
191
  description: String,
163
192
  image_url: String,
164
- is_active: T::Boolean,
165
193
  is_unlimited: T::Boolean,
166
194
  is_visible: T::Boolean,
167
195
  limit: Integer,
@@ -175,7 +203,9 @@ module GrowsurfRuby
175
203
  referral_coupon_code: String,
176
204
  referral_description: String,
177
205
  referred_reward_upfront: T::Boolean,
206
+ referred_value: GrowsurfRuby::RewardTaxValuation::OrHash,
178
207
  title: String,
208
+ value: GrowsurfRuby::RewardTaxValuation::OrHash,
179
209
  request_options: GrowsurfRuby::RequestOptions::OrHash
180
210
  ).returns(T.attached_class)
181
211
  end
@@ -183,24 +213,46 @@ module GrowsurfRuby
183
213
  type:,
184
214
  commission_structure: nil,
185
215
  conversions_required: nil,
216
+ # Legacy static coupon code shown to the referrer in the reward-won email and
217
+ # webhook. Display text only; superseded by a connected billing integration's
218
+ # issued coupon when one exists.
186
219
  coupon_code: nil,
187
220
  description: nil,
188
221
  image_url: nil,
189
- is_active: nil,
222
+ # Whether the reward can be earned an unlimited number of times. Defaults to
223
+ # `true`, except `MILESTONE` rewards, which can only be earned once.
190
224
  is_unlimited: nil,
225
+ # Whether the reward is enabled. When `false` the reward is disabled: hidden from
226
+ # participants and no longer awarded, including those who already earned it.
191
227
  is_visible: nil,
192
228
  limit: nil,
193
229
  limit_duration: nil,
194
230
  # Custom key/value metadata (single-level; values are stored as strings).
195
231
  metadata: nil,
232
+ # Text shown before a participant's referral count in milestone-progress copy.
233
+ # Applies to `MILESTONE` rewards.
196
234
  next_milestone_prefix: nil,
235
+ # Text shown after a participant's referral count in milestone-progress copy.
236
+ # Applies to `MILESTONE` rewards.
197
237
  next_milestone_suffix: nil,
238
+ # The number of winners (`LEADERBOARD` rewards only). With `limitDuration`
239
+ # `PER_MONTH` this many win each month, otherwise this many win in total;
240
+ # omitting it defaults to `3`.
198
241
  number_of_winners: nil,
199
242
  order: nil,
243
+ # Legacy static coupon code shown to the referred friend (double-sided rewards)
244
+ # in the reward-won email and webhook. Display text only; superseded by a
245
+ # connected billing integration's issued coupon when one exists.
200
246
  referral_coupon_code: nil,
201
247
  referral_description: nil,
202
248
  referred_reward_upfront: nil,
249
+ # Tax valuation for the referred friend's side of a double-sided reward.
250
+ # Defaults to not tax-reportable (a purchase rebate).
251
+ referred_value: nil,
203
252
  title: nil,
253
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
254
+ # Used by tax documentation / 1099 reporting.
255
+ value: nil,
204
256
  request_options: {}
205
257
  )
206
258
  end
@@ -215,7 +267,6 @@ module GrowsurfRuby
215
267
  coupon_code: String,
216
268
  description: String,
217
269
  image_url: String,
218
- is_active: T::Boolean,
219
270
  is_unlimited: T::Boolean,
220
271
  is_visible: T::Boolean,
221
272
  limit: Integer,
@@ -229,7 +280,9 @@ module GrowsurfRuby
229
280
  referral_coupon_code: String,
230
281
  referral_description: String,
231
282
  referred_reward_upfront: T::Boolean,
283
+ referred_value: GrowsurfRuby::RewardTaxValuation::OrHash,
232
284
  title: String,
285
+ value: GrowsurfRuby::RewardTaxValuation::OrHash,
233
286
  request_options: GrowsurfRuby::RequestOptions
234
287
  }
235
288
  )
@@ -19,23 +19,23 @@ module GrowsurfRuby
19
19
  attr_accessor :id
20
20
 
21
21
  sig { returns(String) }
22
- attr_accessor :reward_id
22
+ attr_accessor :campaign_reward_id
23
23
 
24
24
  sig do
25
25
  params(
26
26
  id: String,
27
- reward_id: String,
27
+ campaign_reward_id: String,
28
28
  request_options: GrowsurfRuby::RequestOptions::OrHash
29
29
  ).returns(T.attached_class)
30
30
  end
31
- def self.new(id:, reward_id:, request_options: {})
31
+ def self.new(id:, campaign_reward_id:, request_options: {})
32
32
  end
33
33
 
34
34
  sig do
35
35
  override.returns(
36
36
  {
37
37
  id: String,
38
- reward_id: String,
38
+ campaign_reward_id: String,
39
39
  request_options: GrowsurfRuby::RequestOptions
40
40
  }
41
41
  )