growsurf-ruby 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +11 -8
  5. data/lib/growsurf_ruby/models/campaign/participant_reward.rb +1 -0
  6. data/lib/growsurf_ruby/models/campaign/reward.rb +22 -1
  7. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +23 -1
  8. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +23 -1
  9. data/lib/growsurf_ruby/models/campaign.rb +22 -1
  10. data/lib/growsurf_ruby/models/commission_structure.rb +16 -3
  11. data/lib/growsurf_ruby/models/participant_commission_list.rb +19 -1
  12. data/lib/growsurf_ruby/resources/campaign/participant.rb +6 -4
  13. data/lib/growsurf_ruby/resources/campaign/rewards.rb +6 -2
  14. data/lib/growsurf_ruby/version.rb +1 -1
  15. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +16 -10
  16. data/rbi/growsurf_ruby/models/campaign/participant_reward.rbi +5 -0
  17. data/rbi/growsurf_ruby/models/campaign/reward.rbi +55 -0
  18. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +64 -0
  19. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +64 -0
  20. data/rbi/growsurf_ruby/models/campaign.rbi +46 -0
  21. data/rbi/growsurf_ruby/models/commission_structure.rbi +34 -3
  22. data/rbi/growsurf_ruby/models/participant_commission_list.rbi +48 -0
  23. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +11 -6
  24. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +14 -0
  25. data/sig/growsurf_ruby/models/campaign/participant_reward.rbs +2 -1
  26. data/sig/growsurf_ruby/models/campaign/reward.rbs +16 -0
  27. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +20 -0
  28. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +20 -0
  29. data/sig/growsurf_ruby/models/campaign.rbs +16 -0
  30. data/sig/growsurf_ruby/models/commission_structure.rbs +16 -4
  31. data/sig/growsurf_ruby/models/participant_commission_list.rbs +16 -0
  32. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +2 -0
  33. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 493b71b685dcab98c1c2633ab0c32d9339609bba972dafb665607039a0079142
4
- data.tar.gz: 75af6a27ec19b8f9e1cc8cdf8b412c4c70f9405276f444f69b305c901ca51893
3
+ metadata.gz: 275aad4e60a6dbc15b0f7bdb1b09abb6ad493d1e08d1eb87aeb1f788240b1253
4
+ data.tar.gz: d729a0d1032edb387819583a90e76795d42386d90df6357036e958dc03b0004a
5
5
  SHA512:
6
- metadata.gz: 50054ac45d5711ca710ae6f4c16d24d4c10954fc7c0f17e99f279531e318c86663ffd866cbf263380ccc8697a902ffd3c7d78389f11a31ec74ac4c046e09fbf2
7
- data.tar.gz: 6de111fb82f96ea5dbdd3c43c5c98f039f3a250c71ebd193a9ae3244f3896df02eb3bd82a6f0143ed947bee2456a8cc1f7f08da8ef48b69da0860904730e0966
6
+ metadata.gz: 651d86c7678d8ed1cf2fbff0c70e458225bd0b1f912c49e1285c419f4d6c63ee03d022273753178d4fe21e3a37cfb953b688f0fe7015c6c818094eb239c2bc7c
7
+ data.tar.gz: d4a5a15415b2b9c8f3932d4a09c8d591ac221d7c279169654994f2c8da86027776b1fce197053a5c3ecc64942377da763a5e3c55b2f22eb3a3e93ade939ea6c4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0](https://github.com/growsurf/growsurf-ruby/compare/v1.3.0...v1.4.0) (2026-08-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add reward and commission event support ([a9d672f](https://github.com/growsurf/growsurf-ruby/commit/a9d672ff9fd34198b8919adbf207436a023841b4))
9
+
3
10
  ## [1.3.0](https://github.com/growsurf/growsurf-ruby/compare/v1.2.1...v1.3.0) (2026-08-23)
4
11
 
5
12
 
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "growsurf-ruby", "~> 1.3.0"
20
+ gem "growsurf-ruby", "~> 1.4.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -19,14 +19,16 @@ module GrowsurfRuby
19
19
  required :participant_id_or_email, String
20
20
 
21
21
  # @!attribute days
22
- # Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
22
+ # Last number of days for optional `series` and `email` analytics. Defaults to
23
+ # 365. Maximum 1825. Does not filter the top-level all-time totals.
23
24
  #
24
25
  # @return [Integer, nil]
25
26
  optional :days, Integer
26
27
 
27
28
  # @!attribute end_date
28
- # End date of the analytics timeframe as a Unix timestamp in milliseconds.
29
- # Required if `days` is not set.
29
+ # End of a custom `series` and `email` analytics window as a Unix timestamp in
30
+ # milliseconds. Set it together with `startDate`. Does not filter the top-level
31
+ # all-time totals.
30
32
  #
31
33
  # @return [Integer, nil]
32
34
  optional :end_date, Integer
@@ -50,8 +52,9 @@ module GrowsurfRuby
50
52
  optional :interval, enum: -> { GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval }
51
53
 
52
54
  # @!attribute start_date
53
- # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
54
- # Required if `days` is not set.
55
+ # Start of a custom `series` and `email` analytics window as a Unix timestamp in
56
+ # milliseconds. Set it together with `endDate`. Does not filter the top-level
57
+ # all-time totals.
55
58
  #
56
59
  # @return [Integer, nil]
57
60
  optional :start_date, Integer
@@ -65,15 +68,15 @@ module GrowsurfRuby
65
68
  #
66
69
  # @param participant_id_or_email [String]
67
70
  #
68
- # @param days [Integer] Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
71
+ # @param days [Integer] Last number of days for optional `series` and `email` analytics. Defaults to 365. Maxi
69
72
  #
70
- # @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
73
+ # @param end_date [Integer] End of a custom `series` and `email` analytics window as a Unix timestamp in milli
71
74
  #
72
75
  # @param include [String] Comma-separated optional data. `series` returns this participant's own activity
73
76
  #
74
77
  # @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used when `include` contains `series`).
75
78
  #
76
- # @param start_date [Integer] Start date of the analytics timeframe as a Unix timestamp in milliseconds. Requi
79
+ # @param start_date [Integer] Start of a custom `series` and `email` analytics window as a Unix timestamp in mi
77
80
  #
78
81
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
79
82
 
@@ -93,6 +93,7 @@ module GrowsurfRuby
93
93
 
94
94
  PENDING = :PENDING
95
95
  FULFILLED = :FULFILLED
96
+ CANCELLED = :CANCELLED
96
97
 
97
98
  # @!method self.values
98
99
  # @return [Array<Symbol>]
@@ -52,6 +52,14 @@ module GrowsurfRuby
52
52
  # @return [String, nil]
53
53
  optional :description, String, nil?: true
54
54
 
55
+ # @!attribute event
56
+ # The referral event that earns this Campaign Reward. Present only for
57
+ # `SINGLE_SIDED`, `DOUBLE_SIDED`, and `MILESTONE` rewards. Legacy Campaign
58
+ # Rewards return `CONVERSION`.
59
+ #
60
+ # @return [Symbol, GrowsurfRuby::Models::Campaign::Reward::Event, nil]
61
+ optional :event, enum: -> { GrowsurfRuby::Campaign::Reward::Event }, nil?: true
62
+
55
63
  # @!attribute image_url
56
64
  #
57
65
  # @return [String, nil]
@@ -145,7 +153,7 @@ module GrowsurfRuby
145
153
  # @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
146
154
  optional :value, -> { GrowsurfRuby::RewardTaxValuation }, nil?: true
147
155
 
148
- # @!method initialize(id:, is_unlimited:, metadata:, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_visible: nil, limit: nil, limit_duration: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil)
156
+ # @!method initialize(id:, is_unlimited:, metadata:, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_visible: nil, limit: nil, limit_duration: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil)
149
157
  # @param id [String]
150
158
  #
151
159
  # @param is_unlimited [Boolean]
@@ -162,6 +170,8 @@ module GrowsurfRuby
162
170
  #
163
171
  # @param description [String, nil]
164
172
  #
173
+ # @param event [Symbol, GrowsurfRuby::Models::Campaign::Reward::Event, nil] The referral event that earns this Campaign Reward.
174
+ #
165
175
  # @param image_url [String, nil]
166
176
  #
167
177
  # @param is_visible [Boolean] Whether the reward is enabled. When `false` the reward is disabled: hidden from
@@ -204,6 +214,17 @@ module GrowsurfRuby
204
214
  # @return [Array<Symbol>]
205
215
  end
206
216
 
217
+ # @see GrowsurfRuby::Models::Campaign::Reward#event
218
+ module Event
219
+ extend GrowsurfRuby::Internal::Type::Enum
220
+
221
+ LEAD = :LEAD
222
+ CONVERSION = :CONVERSION
223
+
224
+ # @!method self.values
225
+ # @return [Array<Symbol>]
226
+ end
227
+
207
228
  # @see GrowsurfRuby::Models::Campaign::Reward#limit_duration
208
229
  module LimitDuration
209
230
  extend GrowsurfRuby::Internal::Type::Enum
@@ -38,6 +38,15 @@ module GrowsurfRuby
38
38
  # @return [String, nil]
39
39
  optional :description, String
40
40
 
41
+ # @!attribute event
42
+ # The referral event that earns this Campaign Reward. Use `LEAD` or
43
+ # `CONVERSION`. `LEAD` requires the program installation's `referralTrigger` to
44
+ # be `CUSTOM`. This field applies only to `SINGLE_SIDED`, `DOUBLE_SIDED`, and
45
+ # `MILESTONE` rewards. When omitted, it defaults to `CONVERSION`.
46
+ #
47
+ # @return [Symbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::Event, nil]
48
+ optional :event, enum: -> { GrowsurfRuby::Campaign::RewardCreateParams::Event }
49
+
41
50
  # @!attribute image_url
42
51
  #
43
52
  # @return [String, nil]
@@ -143,7 +152,7 @@ module GrowsurfRuby
143
152
  # @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
144
153
  optional :value, -> { GrowsurfRuby::RewardTaxValuation }
145
154
 
146
- # @!method initialize(type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
155
+ # @!method initialize(type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
147
156
  # Some parameter documentations has been truncated, see
148
157
  # {GrowsurfRuby::Models::Campaign::RewardCreateParams} for more details.
149
158
  #
@@ -157,6 +166,8 @@ module GrowsurfRuby
157
166
  #
158
167
  # @param description [String]
159
168
  #
169
+ # @param event [Symbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::Event] The referral event that earns this Campaign Reward.
170
+ #
160
171
  # @param image_url [String]
161
172
  #
162
173
  # @param is_unlimited [Boolean] Whether the reward can be earned an unlimited number of times. Defaults to `true
@@ -205,6 +216,17 @@ module GrowsurfRuby
205
216
  # @return [Array<Symbol>]
206
217
  end
207
218
 
219
+ # @see GrowsurfRuby::Models::Campaign::RewardCreateParams#event
220
+ module Event
221
+ extend GrowsurfRuby::Internal::Type::Enum
222
+
223
+ LEAD = :LEAD
224
+ CONVERSION = :CONVERSION
225
+
226
+ # @!method self.values
227
+ # @return [Array<Symbol>]
228
+ end
229
+
208
230
  # @see GrowsurfRuby::Models::Campaign::RewardCreateParams#limit_duration
209
231
  module LimitDuration
210
232
  extend GrowsurfRuby::Internal::Type::Enum
@@ -43,6 +43,15 @@ module GrowsurfRuby
43
43
  # @return [String, nil]
44
44
  optional :description, String
45
45
 
46
+ # @!attribute event
47
+ # The referral event that earns this Campaign Reward. Use `LEAD` or
48
+ # `CONVERSION`. `LEAD` requires the program installation's `referralTrigger` to
49
+ # be `CUSTOM`. This field applies only to `SINGLE_SIDED`, `DOUBLE_SIDED`, and
50
+ # `MILESTONE` rewards. When omitted, the stored event is preserved.
51
+ #
52
+ # @return [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::Event, nil]
53
+ optional :event, enum: -> { GrowsurfRuby::Campaign::RewardUpdateParams::Event }
54
+
46
55
  # @!attribute image_url
47
56
  #
48
57
  # @return [String, nil]
@@ -148,7 +157,7 @@ module GrowsurfRuby
148
157
  # @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
149
158
  optional :value, -> { GrowsurfRuby::RewardTaxValuation }
150
159
 
151
- # @!method initialize(id:, campaign_reward_id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
160
+ # @!method initialize(id:, campaign_reward_id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
152
161
  # Some parameter documentations has been truncated, see
153
162
  # {GrowsurfRuby::Models::Campaign::RewardUpdateParams} for more details.
154
163
  #
@@ -164,6 +173,8 @@ module GrowsurfRuby
164
173
  #
165
174
  # @param description [String]
166
175
  #
176
+ # @param event [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::Event] The referral event that earns this Campaign Reward.
177
+ #
167
178
  # @param image_url [String]
168
179
  #
169
180
  # @param is_unlimited [Boolean] Whether the reward can be earned an unlimited number of times. Defaults to `true
@@ -198,6 +209,17 @@ module GrowsurfRuby
198
209
  #
199
210
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
200
211
 
212
+ # @see GrowsurfRuby::Models::Campaign::RewardUpdateParams#event
213
+ module Event
214
+ extend GrowsurfRuby::Internal::Type::Enum
215
+
216
+ LEAD = :LEAD
217
+ CONVERSION = :CONVERSION
218
+
219
+ # @!method self.values
220
+ # @return [Array<Symbol>]
221
+ end
222
+
201
223
  # @see GrowsurfRuby::Models::Campaign::RewardUpdateParams#limit_duration
202
224
  module LimitDuration
203
225
  extend GrowsurfRuby::Internal::Type::Enum
@@ -120,6 +120,14 @@ module GrowsurfRuby
120
120
  # @return [String, nil]
121
121
  optional :description, String, nil?: true
122
122
 
123
+ # @!attribute event
124
+ # The referral event that earns this Campaign Reward. Present only for
125
+ # `SINGLE_SIDED`, `DOUBLE_SIDED`, and `MILESTONE` rewards. Legacy Campaign
126
+ # Rewards return `CONVERSION`.
127
+ #
128
+ # @return [Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::Event, nil]
129
+ optional :event, enum: -> { GrowsurfRuby::CampaignAPI::Reward::Event }, nil?: true
130
+
123
131
  # @!attribute image_url
124
132
  #
125
133
  # @return [String, nil]
@@ -200,7 +208,7 @@ module GrowsurfRuby
200
208
  # @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
201
209
  optional :value, -> { GrowsurfRuby::RewardTaxValuation }, nil?: true
202
210
 
203
- # @!method initialize(id:, is_unlimited:, metadata:, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, limit: nil, limit_duration: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, value: nil)
211
+ # @!method initialize(id:, is_unlimited:, metadata:, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, limit: nil, limit_duration: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, value: nil)
204
212
  # @param id [String]
205
213
  #
206
214
  # @param is_unlimited [Boolean]
@@ -217,6 +225,8 @@ module GrowsurfRuby
217
225
  #
218
226
  # @param description [String, nil]
219
227
  #
228
+ # @param event [Symbol, GrowsurfRuby::Models::CampaignAPI::Reward::Event, nil] The referral event that earns this Campaign Reward.
229
+ #
220
230
  # @param image_url [String, nil]
221
231
  #
222
232
  # @param limit [Integer, nil] `-1` represents an unlimited reward in REST responses.
@@ -255,6 +265,17 @@ module GrowsurfRuby
255
265
  # @return [Array<Symbol>]
256
266
  end
257
267
 
268
+ # @see GrowsurfRuby::Models::CampaignAPI::Reward#event
269
+ module Event
270
+ extend GrowsurfRuby::Internal::Type::Enum
271
+
272
+ LEAD = :LEAD
273
+ CONVERSION = :CONVERSION
274
+
275
+ # @!method self.values
276
+ # @return [Array<Symbol>]
277
+ end
278
+
258
279
  # @see GrowsurfRuby::Models::CampaignAPI::Reward#limit_duration
259
280
  module LimitDuration
260
281
  extend GrowsurfRuby::Internal::Type::Enum
@@ -32,9 +32,10 @@ module GrowsurfRuby
32
32
  optional :duration_in_months, Integer, api_name: :durationInMonths, nil?: true
33
33
 
34
34
  # @!attribute event
35
+ # The event that generates a commission. Missing legacy values read as `SALE`.
35
36
  #
36
- # @return [String, nil]
37
- optional :event, String, nil?: true
37
+ # @return [Symbol, GrowsurfRuby::Models::CommissionStructure::Event, nil]
38
+ optional :event, enum: -> { GrowsurfRuby::CommissionStructure::Event }, nil?: true
38
39
 
39
40
  # @!attribute has_intro
40
41
  #
@@ -112,7 +113,7 @@ module GrowsurfRuby
112
113
  # @param approval_required [Boolean, nil]
113
114
  # @param duration [String, nil]
114
115
  # @param duration_in_months [Integer, nil]
115
- # @param event [String, nil]
116
+ # @param event [Symbol, GrowsurfRuby::Models::CommissionStructure::Event, nil]
116
117
  # @param has_intro [Boolean, nil]
117
118
  # @param has_max_amount [Boolean, nil]
118
119
  # @param hold_duration [Integer, nil]
@@ -128,6 +129,18 @@ module GrowsurfRuby
128
129
  # @param percent [Float, nil]
129
130
  # @param type [Symbol, GrowsurfRuby::Models::CommissionStructure::Type, nil]
130
131
 
132
+ # @see GrowsurfRuby::Models::CommissionStructure#event
133
+ module Event
134
+ extend GrowsurfRuby::Internal::Type::Enum
135
+
136
+ CLICK = :CLICK
137
+ LEAD = :LEAD
138
+ SALE = :SALE
139
+
140
+ # @!method self.values
141
+ # @return [Array<Symbol>]
142
+ end
143
+
131
144
  # @see GrowsurfRuby::Models::CommissionStructure#type
132
145
  module Type
133
146
  extend GrowsurfRuby::Internal::Type::Enum
@@ -46,6 +46,12 @@ module GrowsurfRuby
46
46
  # @return [String]
47
47
  required :currency_iso, String, api_name: :currencyISO
48
48
 
49
+ # @!attribute event
50
+ # The event that generated this commission. Legacy commissions return `SALE`.
51
+ #
52
+ # @return [Symbol, GrowsurfRuby::Models::ParticipantCommissionList::Commission::Event]
53
+ required :event, enum: -> { GrowsurfRuby::ParticipantCommissionList::Commission::Event }
54
+
49
55
  # @!attribute referred_id
50
56
  #
51
57
  # @return [String]
@@ -129,11 +135,12 @@ module GrowsurfRuby
129
135
  api_name: :saleAmountInCampaignCurrency,
130
136
  nil?: true
131
137
 
132
- # @!method initialize(id:, amount:, created_at:, currency_iso:, referred_id:, referrer_id:, sale_amount:, status:, amount_in_campaign_currency: nil, approved_at: nil, campaign_currency_iso: nil, exchange_rate: nil, exchange_rate_at: nil, fx_error: nil, hold_duration: nil, paid_at: nil, payout_queued_at: nil, provider: nil, reversed_at: nil, sale_amount_in_campaign_currency: nil)
138
+ # @!method initialize(id:, amount:, created_at:, currency_iso:, event:, referred_id:, referrer_id:, sale_amount:, status:, amount_in_campaign_currency: nil, approved_at: nil, campaign_currency_iso: nil, exchange_rate: nil, exchange_rate_at: nil, fx_error: nil, hold_duration: nil, paid_at: nil, payout_queued_at: nil, provider: nil, reversed_at: nil, sale_amount_in_campaign_currency: nil)
133
139
  # @param id [String]
134
140
  # @param amount [Integer, nil]
135
141
  # @param created_at [Integer]
136
142
  # @param currency_iso [String]
143
+ # @param event [Symbol, GrowsurfRuby::Models::ParticipantCommissionList::Commission::Event] The event that generated this commission. Legacy commissions return `SALE`.
137
144
  # @param referred_id [String]
138
145
  # @param referrer_id [String]
139
146
  # @param sale_amount [Integer, nil]
@@ -151,6 +158,17 @@ module GrowsurfRuby
151
158
  # @param reversed_at [Integer]
152
159
  # @param sale_amount_in_campaign_currency [Integer, nil]
153
160
 
161
+ # @see GrowsurfRuby::Models::ParticipantCommissionList::Commission#event
162
+ module Event
163
+ extend GrowsurfRuby::Internal::Type::Enum
164
+
165
+ LEAD = :LEAD
166
+ SALE = :SALE
167
+
168
+ # @!method self.values
169
+ # @return [Array<Symbol>]
170
+ end
171
+
154
172
  # @see GrowsurfRuby::Models::ParticipantCommissionList::Commission#status
155
173
  module Status
156
174
  extend GrowsurfRuby::Internal::Type::Enum
@@ -687,7 +687,9 @@ module GrowsurfRuby
687
687
  # for `sent` (accepted for delivery), `delivered`, `opened`, `clicked`,
688
688
  # `bounced`, and `spamComplaints` metrics attributed to this participant,
689
689
  # including invitations they sent. Use `include=email,series` to include the
690
- # same counts in each UTC series bucket.
690
+ # same counts in each UTC series bucket. `days`, `startDate`, and `endDate`
691
+ # filter only the optional `series` and `email` data. They do not filter the
692
+ # top-level `analytics`, `ranks`, or `shareCount` values.
691
693
  #
692
694
  # @overload retrieve_analytics(participant_id_or_email, id:, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
693
695
  #
@@ -695,15 +697,15 @@ module GrowsurfRuby
695
697
  #
696
698
  # @param id [String] GrowSurf program ID.
697
699
  #
698
- # @param days [Integer] Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
700
+ # @param days [Integer] Last number of days for optional `series` and `email` analytics. Defaults to 365. Maxi
699
701
  #
700
- # @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
702
+ # @param end_date [Integer] End of a custom `series` and `email` analytics window as a Unix timestamp in milli
701
703
  #
702
704
  # @param include [String] Comma-separated optional data. `series` returns this participant's own activity
703
705
  #
704
706
  # @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used when `include` contains `series`).
705
707
  #
706
- # @param start_date [Integer] Start date of the analytics timeframe as a Unix timestamp in milliseconds. Requi
708
+ # @param start_date [Integer] Start of a custom `series` and `email` analytics window as a Unix timestamp in mi
707
709
  #
708
710
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
709
711
  #
@@ -30,7 +30,7 @@ module GrowsurfRuby
30
30
  # Enabling an active reward of a type automatically enables that reward type on
31
31
  # the program.
32
32
  #
33
- # @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
33
+ # @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
34
34
  #
35
35
  # @param id [String] Path param: GrowSurf program ID.
36
36
  #
@@ -44,6 +44,8 @@ module GrowsurfRuby
44
44
  #
45
45
  # @param description [String] Body param
46
46
  #
47
+ # @param event [Symbol, GrowsurfRuby::Models::Campaign::RewardCreateParams::Event] Body param: The referral event that earns this Campaign Reward. Use `LEAD` or `CONVERSION`. `LEAD` requires the program installation's `referralTrigger` to be `CUSTOM`. This field applies only to `SINGLE_SIDED`, `DOUBLE_SIDED`, and `MILESTONE` rewards. When omitted, it defaults to `CONVERSION`.
48
+ #
47
49
  # @param image_url [String] Body param
48
50
  #
49
51
  # @param is_unlimited [Boolean] Body param: Whether the reward can be earned an unlimited number of times. Defaul
@@ -98,7 +100,7 @@ module GrowsurfRuby
98
100
  # copy; removing a key that campaign copy still references returns a `409` listing
99
101
  # the referencing fields.
100
102
  #
101
- # @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
103
+ # @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
102
104
  #
103
105
  # @param campaign_reward_id [String] Path param: Campaign reward ID.
104
106
  #
@@ -112,6 +114,8 @@ module GrowsurfRuby
112
114
  #
113
115
  # @param description [String] Body param
114
116
  #
117
+ # @param event [Symbol, GrowsurfRuby::Models::Campaign::RewardUpdateParams::Event] Body param: The referral event that earns this Campaign Reward. Use `LEAD` or `CONVERSION`. `LEAD` requires the program installation's `referralTrigger` to be `CUSTOM`. This field applies only to `SINGLE_SIDED`, `DOUBLE_SIDED`, and `MILESTONE` rewards. When omitted, the stored event is preserved.
118
+ #
115
119
  # @param image_url [String] Body param
116
120
  #
117
121
  # @param is_unlimited [Boolean] Body param: Whether the reward can be earned an unlimited number of times. Defaul
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GrowsurfRuby
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.0"
5
5
  end
@@ -21,15 +21,17 @@ module GrowsurfRuby
21
21
  sig { returns(String) }
22
22
  attr_accessor :participant_id_or_email
23
23
 
24
- # Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
24
+ # Last number of days for optional `series` and `email` analytics. Defaults to 365.
25
+ # Maximum 1825. Does not filter the top-level all-time totals.
25
26
  sig { returns(T.nilable(Integer)) }
26
27
  attr_reader :days
27
28
 
28
29
  sig { params(days: Integer).void }
29
30
  attr_writer :days
30
31
 
31
- # End date of the analytics timeframe as a Unix timestamp in milliseconds.
32
- # Required if `days` is not set.
32
+ # End of a custom `series` and `email` analytics window as a Unix timestamp in
33
+ # milliseconds. Set it together with `startDate`. Does not filter the top-level
34
+ # all-time totals.
33
35
  sig { returns(T.nilable(Integer)) }
34
36
  attr_reader :end_date
35
37
 
@@ -67,8 +69,9 @@ module GrowsurfRuby
67
69
  end
68
70
  attr_writer :interval
69
71
 
70
- # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
71
- # Required if `days` is not set.
72
+ # Start of a custom `series` and `email` analytics window as a Unix timestamp in
73
+ # milliseconds. Set it together with `endDate`. Does not filter the top-level
74
+ # all-time totals.
72
75
  sig { returns(T.nilable(Integer)) }
73
76
  attr_reader :start_date
74
77
 
@@ -91,10 +94,12 @@ module GrowsurfRuby
91
94
  def self.new(
92
95
  id:,
93
96
  participant_id_or_email:,
94
- # Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
97
+ # Last number of days for optional `series` and `email` analytics. Defaults to 365.
98
+ # Maximum 1825. Does not filter the top-level all-time totals.
95
99
  days: nil,
96
- # End date of the analytics timeframe as a Unix timestamp in milliseconds.
97
- # Required if `days` is not set.
100
+ # End of a custom `series` and `email` analytics window as a Unix timestamp in
101
+ # milliseconds. Set it together with `startDate`. Does not filter the top-level
102
+ # all-time totals.
98
103
  end_date: nil,
99
104
  # Comma-separated optional data. `series` returns this participant's own activity per
100
105
  # period; `email` returns `sent`, `delivered`, `opened`, `clicked`, `bounced`,
@@ -106,8 +111,9 @@ module GrowsurfRuby
106
111
  # Bucket size for the `series` (only used when `include` contains `series`). Defaults to
107
112
  # `day`.
108
113
  interval: nil,
109
- # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
110
- # Required if `days` is not set.
114
+ # Start of a custom `series` and `email` analytics window as a Unix timestamp in
115
+ # milliseconds. Set it together with `endDate`. Does not filter the top-level
116
+ # all-time totals.
111
117
  start_date: nil,
112
118
  request_options: {}
113
119
  )
@@ -168,6 +168,11 @@ module GrowsurfRuby
168
168
  :FULFILLED,
169
169
  GrowsurfRuby::Campaign::ParticipantReward::Status::TaggedSymbol
170
170
  )
171
+ CANCELLED =
172
+ T.let(
173
+ :CANCELLED,
174
+ GrowsurfRuby::Campaign::ParticipantReward::Status::TaggedSymbol
175
+ )
171
176
 
172
177
  sig do
173
178
  override.returns(
@@ -50,6 +50,18 @@ module GrowsurfRuby
50
50
  sig { returns(T.nilable(String)) }
51
51
  attr_accessor :description
52
52
 
53
+ # The referral event that earns this Campaign Reward. Present only for
54
+ # `SINGLE_SIDED`, `DOUBLE_SIDED`, and `MILESTONE` rewards. Legacy Campaign
55
+ # Rewards return `CONVERSION`.
56
+ sig do
57
+ returns(
58
+ T.nilable(
59
+ GrowsurfRuby::Models::Campaign::Reward::Event::TaggedSymbol
60
+ )
61
+ )
62
+ end
63
+ attr_accessor :event
64
+
53
65
  sig { returns(T.nilable(String)) }
54
66
  attr_accessor :image_url
55
67
 
@@ -144,6 +156,10 @@ module GrowsurfRuby
144
156
  conversions_required: T.nilable(Integer),
145
157
  coupon_code: T.nilable(String),
146
158
  description: T.nilable(String),
159
+ event:
160
+ T.nilable(
161
+ GrowsurfRuby::Models::Campaign::Reward::Event::OrSymbol
162
+ ),
147
163
  image_url: T.nilable(String),
148
164
  is_visible: T::Boolean,
149
165
  limit: T.nilable(Integer),
@@ -176,6 +192,10 @@ module GrowsurfRuby
176
192
  # issued coupon when one exists.
177
193
  coupon_code: nil,
178
194
  description: nil,
195
+ # The referral event that earns this Campaign Reward. Present only for
196
+ # `SINGLE_SIDED`, `DOUBLE_SIDED`, and `MILESTONE` rewards. Legacy Campaign
197
+ # Rewards return `CONVERSION`.
198
+ event: nil,
179
199
  image_url: nil,
180
200
  # Whether the reward is enabled. When `false` the reward is disabled: hidden from
181
201
  # participants and no longer awarded, including those who already earned it.
@@ -220,6 +240,10 @@ module GrowsurfRuby
220
240
  conversions_required: T.nilable(Integer),
221
241
  coupon_code: T.nilable(String),
222
242
  description: T.nilable(String),
243
+ event:
244
+ T.nilable(
245
+ GrowsurfRuby::Models::Campaign::Reward::Event::TaggedSymbol
246
+ ),
223
247
  image_url: T.nilable(String),
224
248
  is_visible: T::Boolean,
225
249
  limit: T.nilable(Integer),
@@ -289,6 +313,37 @@ module GrowsurfRuby
289
313
  end
290
314
  end
291
315
 
316
+ module Event
317
+ extend GrowsurfRuby::Internal::Type::Enum
318
+
319
+ TaggedSymbol =
320
+ T.type_alias do
321
+ T.all(Symbol, GrowsurfRuby::Models::Campaign::Reward::Event)
322
+ end
323
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
324
+
325
+ LEAD =
326
+ T.let(
327
+ :LEAD,
328
+ GrowsurfRuby::Models::Campaign::Reward::Event::TaggedSymbol
329
+ )
330
+ CONVERSION =
331
+ T.let(
332
+ :CONVERSION,
333
+ GrowsurfRuby::Models::Campaign::Reward::Event::TaggedSymbol
334
+ )
335
+
336
+ sig do
337
+ override.returns(
338
+ T::Array[
339
+ GrowsurfRuby::Models::Campaign::Reward::Event::TaggedSymbol
340
+ ]
341
+ )
342
+ end
343
+ def self.values
344
+ end
345
+ end
346
+
292
347
  module LimitDuration
293
348
  extend GrowsurfRuby::Internal::Type::Enum
294
349