growsurf-ruby 0.8.0 → 1.0.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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/models/campaign/reward.rb +28 -1
  5. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +24 -1
  6. data/lib/growsurf_ruby/models/campaign/reward_delete_params.rb +4 -4
  7. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +27 -4
  8. data/lib/growsurf_ruby/models/campaign.rb +28 -1
  9. data/lib/growsurf_ruby/models/campaign_create_params.rb +1 -15
  10. data/lib/growsurf_ruby/models/campaign_update_params.rb +1 -50
  11. data/lib/growsurf_ruby/models/reward_tax_valuation.rb +35 -0
  12. data/lib/growsurf_ruby/models.rb +2 -0
  13. data/lib/growsurf_ruby/resources/campaign/design.rb +66 -0
  14. data/lib/growsurf_ruby/resources/campaign/emails.rb +63 -0
  15. data/lib/growsurf_ruby/resources/campaign/installation.rb +65 -0
  16. data/lib/growsurf_ruby/resources/campaign/options.rb +63 -0
  17. data/lib/growsurf_ruby/resources/campaign/rewards.rb +21 -13
  18. data/lib/growsurf_ruby/resources/campaign.rb +32 -25
  19. data/lib/growsurf_ruby/version.rb +1 -1
  20. data/lib/growsurf_ruby.rb +5 -0
  21. data/rbi/growsurf_ruby/models/campaign/reward.rbi +42 -3
  22. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +28 -0
  23. data/rbi/growsurf_ruby/models/campaign/reward_delete_params.rbi +4 -4
  24. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +32 -4
  25. data/rbi/growsurf_ruby/models/campaign.rbi +42 -3
  26. data/rbi/growsurf_ruby/models/campaign_create_params.rbi +0 -18
  27. data/rbi/growsurf_ruby/models/campaign_update_params.rbi +0 -63
  28. data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +56 -0
  29. data/rbi/growsurf_ruby/models.rbi +2 -0
  30. data/rbi/growsurf_ruby/resources/campaign/design.rbi +50 -0
  31. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +49 -0
  32. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +50 -0
  33. data/rbi/growsurf_ruby/resources/campaign/options.rbi +49 -0
  34. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +24 -8
  35. data/rbi/growsurf_ruby/resources/campaign.rbi +25 -30
  36. data/sig/growsurf_ruby/models/campaign/reward.rbs +18 -3
  37. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +19 -1
  38. data/sig/growsurf_ruby/models/campaign/reward_delete_params.rbs +4 -4
  39. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +23 -5
  40. data/sig/growsurf_ruby/models/campaign.rbs +18 -3
  41. data/sig/growsurf_ruby/models/campaign_create_params.rbs +0 -14
  42. data/sig/growsurf_ruby/models/campaign_update_params.rbs +0 -49
  43. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +19 -0
  44. data/sig/growsurf_ruby/models.rbs +2 -0
  45. data/sig/growsurf_ruby/resources/campaign/design.rbs +20 -0
  46. data/sig/growsurf_ruby/resources/campaign/emails.rbs +20 -0
  47. data/sig/growsurf_ruby/resources/campaign/installation.rbs +20 -0
  48. data/sig/growsurf_ruby/resources/campaign/options.rbs +20 -0
  49. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +6 -2
  50. data/sig/growsurf_ruby/resources/campaign.rbs +8 -9
  51. metadata +17 -2
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class Options
7
+ # Retrieves a program's options configuration — the same surface as the dashboard
8
+ # Program Editor's **Options** tab (fraud/reCAPTCHA, tax documentation,
9
+ # notification emails, and other program settings).
10
+ #
11
+ # This is a large, nested object. See the API reference for the full field list.
12
+ #
13
+ # @overload retrieve(id, request_options: {})
14
+ #
15
+ # @param id [String] GrowSurf program ID.
16
+ #
17
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
18
+ #
19
+ # @return [Hash{Symbol=>Object}]
20
+ def retrieve(id, params = {})
21
+ @client.request(
22
+ method: :get,
23
+ path: ["campaign/%1$s/options", id],
24
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
25
+ options: params[:request_options]
26
+ )
27
+ end
28
+
29
+ # Updates a program's options configuration. Only the fields you send are changed.
30
+ # Unknown fields and invalid values return a `400`.
31
+ #
32
+ # The request body is a partial {CampaignOptions} object — see the API reference
33
+ # for the full field list.
34
+ #
35
+ # @overload update(id, body, request_options: {})
36
+ #
37
+ # @param id [String] GrowSurf program ID.
38
+ #
39
+ # @param body [Hash{Symbol=>Object}] Partial options configuration to merge.
40
+ #
41
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
42
+ #
43
+ # @return [Hash{Symbol=>Object}]
44
+ def update(id, body, params = {})
45
+ @client.request(
46
+ method: :patch,
47
+ path: ["campaign/%1$s/options", id],
48
+ body: body,
49
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
50
+ options: params[:request_options]
51
+ )
52
+ end
53
+
54
+ # @api private
55
+ #
56
+ # @param client [GrowsurfRuby::Client]
57
+ def initialize(client:)
58
+ @client = client
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -16,7 +16,7 @@ module GrowsurfRuby
16
16
  def list(id, params = {})
17
17
  @client.request(
18
18
  method: :get,
19
- path: ["campaign/%1$s/rewards", id],
19
+ path: ["campaign/%1$s/reward-configs", id],
20
20
  model: GrowsurfRuby::Models::Campaign::CampaignRewardListResponse,
21
21
  options: params[:request_options]
22
22
  )
@@ -25,7 +25,7 @@ module GrowsurfRuby
25
25
  # Creates a reward for a program. The reward `type` must be compatible with the
26
26
  # program type.
27
27
  #
28
- # @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_active: 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, title: nil, request_options: {})
28
+ # @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_active: 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: {})
29
29
  #
30
30
  # @param id [String] Path param: GrowSurf program ID.
31
31
  #
@@ -67,8 +67,12 @@ module GrowsurfRuby
67
67
  #
68
68
  # @param referred_reward_upfront [Boolean] Body param
69
69
  #
70
+ # @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax valuation for the referred friend's side of a double-sided rewa
71
+ #
70
72
  # @param title [String] Body param
71
73
  #
74
+ # @param value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax valuation for the reward (the referrer's side of a double-sided
75
+ #
72
76
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
73
77
  #
74
78
  # @return [GrowsurfRuby::Models::Campaign::Reward]
@@ -78,19 +82,19 @@ module GrowsurfRuby
78
82
  parsed, options = GrowsurfRuby::Campaign::RewardCreateParams.dump_request(params)
79
83
  @client.request(
80
84
  method: :post,
81
- path: ["campaign/%1$s/rewards", id],
85
+ path: ["campaign/%1$s/reward-configs", id],
82
86
  body: parsed,
83
87
  model: GrowsurfRuby::Models::Campaign::Reward,
84
88
  options: options
85
89
  )
86
90
  end
87
91
 
88
- # Updates an existing program reward. Only the fields you send are changed;
92
+ # Updates an existing campaign reward. Only the fields you send are changed;
89
93
  # `type` is immutable and must not be supplied.
90
94
  #
91
- # @overload update(reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_active: 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, title: nil, request_options: {})
95
+ # @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_active: 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: {})
92
96
  #
93
- # @param reward_id [String] Path param: Program reward ID.
97
+ # @param campaign_reward_id [String] Path param: Campaign reward ID.
94
98
  #
95
99
  # @param id [String] Path param: GrowSurf program ID.
96
100
  #
@@ -130,14 +134,18 @@ module GrowsurfRuby
130
134
  #
131
135
  # @param referred_reward_upfront [Boolean] Body param
132
136
  #
137
+ # @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax valuation for the referred friend's side of a double-sided rewa
138
+ #
133
139
  # @param title [String] Body param
134
140
  #
141
+ # @param value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax valuation for the reward (the referrer's side of a double-sided
142
+ #
135
143
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
136
144
  #
137
145
  # @return [GrowsurfRuby::Models::Campaign::Reward]
138
146
  #
139
147
  # @see GrowsurfRuby::Models::Campaign::RewardUpdateParams
140
- def update(reward_id, params)
148
+ def update(campaign_reward_id, params)
141
149
  parsed, options = GrowsurfRuby::Campaign::RewardUpdateParams.dump_request(params)
142
150
  id =
143
151
  parsed.delete(:id) do
@@ -145,18 +153,18 @@ module GrowsurfRuby
145
153
  end
146
154
  @client.request(
147
155
  method: :patch,
148
- path: ["campaign/%1$s/rewards/%2$s", id, reward_id],
156
+ path: ["campaign/%1$s/reward-configs/%2$s", id, campaign_reward_id],
149
157
  body: parsed,
150
158
  model: GrowsurfRuby::Models::Campaign::Reward,
151
159
  options: options
152
160
  )
153
161
  end
154
162
 
155
- # Deletes a program reward.
163
+ # Deletes a campaign reward.
156
164
  #
157
- # @overload delete(reward_id, id:, request_options: {})
165
+ # @overload delete(campaign_reward_id, id:, request_options: {})
158
166
  #
159
- # @param reward_id [String] Program reward ID.
167
+ # @param campaign_reward_id [String] Campaign reward ID.
160
168
  #
161
169
  # @param id [String] GrowSurf program ID.
162
170
  #
@@ -165,7 +173,7 @@ module GrowsurfRuby
165
173
  # @return [GrowsurfRuby::Models::Campaign::DeleteRewardResponse]
166
174
  #
167
175
  # @see GrowsurfRuby::Models::Campaign::RewardDeleteParams
168
- def delete(reward_id, params)
176
+ def delete(campaign_reward_id, params)
169
177
  parsed, options = GrowsurfRuby::Campaign::RewardDeleteParams.dump_request(params)
170
178
  id =
171
179
  parsed.delete(:id) do
@@ -173,7 +181,7 @@ module GrowsurfRuby
173
181
  end
174
182
  @client.request(
175
183
  method: :delete,
176
- path: ["campaign/%1$s/rewards/%2$s", id, reward_id],
184
+ path: ["campaign/%1$s/reward-configs/%2$s", id, campaign_reward_id],
177
185
  model: GrowsurfRuby::Models::Campaign::DeleteRewardResponse,
178
186
  options: options
179
187
  )
@@ -14,10 +14,26 @@ module GrowsurfRuby
14
14
  # @return [GrowsurfRuby::Resources::Campaign::Commission]
15
15
  attr_reader :commission
16
16
 
17
- # Program reward configuration operations.
17
+ # Campaign reward configuration operations.
18
18
  # @return [GrowsurfRuby::Resources::Campaign::Rewards]
19
19
  attr_reader :rewards
20
20
 
21
+ # Program Editor "Design" tab configuration operations.
22
+ # @return [GrowsurfRuby::Resources::Campaign::Design]
23
+ attr_reader :design
24
+
25
+ # Program Editor "Emails" tab configuration operations.
26
+ # @return [GrowsurfRuby::Resources::Campaign::Emails]
27
+ attr_reader :emails
28
+
29
+ # Program Editor "Options" tab configuration operations.
30
+ # @return [GrowsurfRuby::Resources::Campaign::Options]
31
+ attr_reader :options
32
+
33
+ # Program Editor "Installation" tab configuration operations.
34
+ # @return [GrowsurfRuby::Resources::Campaign::Installation]
35
+ attr_reader :installation
36
+
21
37
  # Retrieves a program for the given program ID.
22
38
  #
23
39
  # @overload retrieve(id, request_options: {})
@@ -57,9 +73,11 @@ module GrowsurfRuby
57
73
  end
58
74
 
59
75
  # Creates a program. Only `type` is required; everything else is
60
- # server-defaulted.
76
+ # server-defaulted. Editor-tab configuration (design, emails, options,
77
+ # installation) is not accepted here — configure it via the config sub-resources
78
+ # (e.g. `campaign.options.update`) after the program is created.
61
79
  #
62
- # @overload create(type:, company_logo_image_url: nil, company_name: nil, currency_iso: nil, goal: nil, name: nil, options: nil, rewards: nil, request_options: {})
80
+ # @overload create(type:, company_logo_image_url: nil, company_name: nil, currency_iso: nil, name: nil, rewards: nil, request_options: {})
63
81
  #
64
82
  # @param type [Symbol, GrowsurfRuby::Models::CampaignCreateParams::Type] The program type. Immutable after creation.
65
83
  #
@@ -67,14 +85,10 @@ module GrowsurfRuby
67
85
  #
68
86
  # @param company_name [String]
69
87
  #
70
- # @param currency_iso [String] ISO 4217 currency code. Defaults to USD.
71
- #
72
- # @param goal [String]
88
+ # @param currency_iso [String] ISO 4217 currency code. Defaults to USD. Chosen when the program is created and immutable afterward — it cannot be changed on update.
73
89
  #
74
90
  # @param name [String] The program name. Defaults to "Untitled Program".
75
91
  #
76
- # @param options [Hash{Symbol=>Object}] A curated subset of program options to shallow-merge onto the defaults.
77
- #
78
92
  # @param rewards [Array<GrowsurfRuby::Models::Campaign::RewardCreateParams>] Optional inline rewards to create with the program.
79
93
  #
80
94
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -93,10 +107,13 @@ module GrowsurfRuby
93
107
  )
94
108
  end
95
109
 
96
- # Updates a program. Only the fields you send are changed. `type` and `urlId` are
97
- # immutable.
110
+ # Updates a program's identity and lifecycle. Only the fields you send are changed.
111
+ # `type`, `urlId`, and `currencyISO` are immutable. Editor-tab configuration (design, emails,
112
+ # options, installation) is edited via the dedicated config sub-resources
113
+ # (`campaign.design`, `campaign.emails`, `campaign.options`, `campaign.installation`),
114
+ # not here.
98
115
  #
99
- # @overload update(id, company_logo_image_url: nil, company_name: nil, currency_iso: nil, design: nil, emails: nil, goal: nil, installation: nil, name: nil, notifications: nil, options: nil, status: nil, request_options: {})
116
+ # @overload update(id, company_logo_image_url: nil, company_name: nil, name: nil, status: nil, request_options: {})
100
117
  #
101
118
  # @param id [String] Path param: GrowSurf program ID.
102
119
  #
@@ -104,22 +121,8 @@ module GrowsurfRuby
104
121
  #
105
122
  # @param company_name [String] Body param
106
123
  #
107
- # @param currency_iso [String] Body param
108
- #
109
- # @param design [Hash{Symbol=>Object}] Body param
110
- #
111
- # @param emails [Hash{Symbol=>Object}] Body param
112
- #
113
- # @param goal [String] Body param
114
- #
115
- # @param installation [Hash{Symbol=>Object}] Body param
116
- #
117
124
  # @param name [String] Body param
118
125
  #
119
- # @param notifications [Hash{Symbol=>Object}] Body param
120
- #
121
- # @param options [Hash{Symbol=>Object}] Body param
122
- #
123
126
  # @param status [Symbol, GrowsurfRuby::Models::CampaignUpdateParams::Status] Body param: The program status. Transitions are validated; DELETED is not allowe
124
127
  #
125
128
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -412,6 +415,10 @@ module GrowsurfRuby
412
415
  @reward = GrowsurfRuby::Resources::Campaign::Reward.new(client: client)
413
416
  @commission = GrowsurfRuby::Resources::Campaign::Commission.new(client: client)
414
417
  @rewards = GrowsurfRuby::Resources::Campaign::Rewards.new(client: client)
418
+ @design = GrowsurfRuby::Resources::Campaign::Design.new(client: client)
419
+ @emails = GrowsurfRuby::Resources::Campaign::Emails.new(client: client)
420
+ @options = GrowsurfRuby::Resources::Campaign::Options.new(client: client)
421
+ @installation = GrowsurfRuby::Resources::Campaign::Installation.new(client: client)
415
422
  end
416
423
  end
417
424
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GrowsurfRuby
4
- VERSION = "0.8.0"
4
+ VERSION = "1.0.0"
5
5
  end
data/lib/growsurf_ruby.rb CHANGED
@@ -113,9 +113,14 @@ require_relative "growsurf_ruby/models/participant_commission_list"
113
113
  require_relative "growsurf_ruby/models/participant_list"
114
114
  require_relative "growsurf_ruby/models/participant_payout_list"
115
115
  require_relative "growsurf_ruby/models/referral_list"
116
+ require_relative "growsurf_ruby/models/reward_tax_valuation"
116
117
  require_relative "growsurf_ruby/models"
117
118
  require_relative "growsurf_ruby/resources/campaign"
118
119
  require_relative "growsurf_ruby/resources/campaign/commission"
120
+ require_relative "growsurf_ruby/resources/campaign/design"
121
+ require_relative "growsurf_ruby/resources/campaign/emails"
122
+ require_relative "growsurf_ruby/resources/campaign/installation"
123
+ require_relative "growsurf_ruby/resources/campaign/options"
119
124
  require_relative "growsurf_ruby/resources/campaign/participant"
120
125
  require_relative "growsurf_ruby/resources/campaign/reward"
121
126
  require_relative "growsurf_ruby/resources/campaign/rewards"
@@ -75,6 +75,10 @@ module GrowsurfRuby
75
75
  sig { returns(T.nilable(Integer)) }
76
76
  attr_accessor :order
77
77
 
78
+ # The coupon code delivered to the referred friend (double-sided rewards).
79
+ sig { returns(T.nilable(String)) }
80
+ attr_accessor :referral_coupon_code
81
+
78
82
  sig { returns(T.nilable(String)) }
79
83
  attr_accessor :referral_description
80
84
 
@@ -84,6 +88,28 @@ module GrowsurfRuby
84
88
  sig { params(referred_reward_upfront: T::Boolean).void }
85
89
  attr_writer :referred_reward_upfront
86
90
 
91
+ # Tax valuation for the referred friend's side of a double-sided reward.
92
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
93
+ attr_reader :referred_value
94
+
95
+ sig do
96
+ params(
97
+ referred_value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
98
+ ).void
99
+ end
100
+ attr_writer :referred_value
101
+
102
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
103
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
104
+ attr_reader :value
105
+
106
+ sig do
107
+ params(
108
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
109
+ ).void
110
+ end
111
+ attr_writer :value
112
+
87
113
  sig do
88
114
  params(
89
115
  id: String,
@@ -105,8 +131,12 @@ module GrowsurfRuby
105
131
  next_milestone_suffix: T.nilable(String),
106
132
  number_of_winners: T.nilable(Integer),
107
133
  order: T.nilable(Integer),
134
+ referral_coupon_code: T.nilable(String),
108
135
  referral_description: T.nilable(String),
109
- referred_reward_upfront: T::Boolean
136
+ referred_reward_upfront: T::Boolean,
137
+ referred_value:
138
+ T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash),
139
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
110
140
  ).returns(T.attached_class)
111
141
  end
112
142
  def self.new(
@@ -127,8 +157,14 @@ module GrowsurfRuby
127
157
  next_milestone_suffix: nil,
128
158
  number_of_winners: nil,
129
159
  order: nil,
160
+ # The coupon code delivered to the referred friend (double-sided rewards).
161
+ referral_coupon_code: nil,
130
162
  referral_description: nil,
131
- referred_reward_upfront: nil
163
+ referred_reward_upfront: nil,
164
+ # Tax valuation for the referred friend's side of a double-sided reward.
165
+ referred_value: nil,
166
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
167
+ value: nil
132
168
  )
133
169
  end
134
170
 
@@ -154,8 +190,11 @@ module GrowsurfRuby
154
190
  next_milestone_suffix: T.nilable(String),
155
191
  number_of_winners: T.nilable(Integer),
156
192
  order: T.nilable(Integer),
193
+ referral_coupon_code: T.nilable(String),
157
194
  referral_description: T.nilable(String),
158
- referred_reward_upfront: T::Boolean
195
+ referred_reward_upfront: T::Boolean,
196
+ referred_value: T.nilable(GrowsurfRuby::RewardTaxValuation),
197
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation)
159
198
  }
160
199
  )
161
200
  end
@@ -146,12 +146,30 @@ module GrowsurfRuby
146
146
  sig { params(referred_reward_upfront: T::Boolean).void }
147
147
  attr_writer :referred_reward_upfront
148
148
 
149
+ # Tax valuation for the referred friend's side of a double-sided reward.
150
+ # Defaults to not tax-reportable (a purchase rebate).
151
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
152
+ attr_reader :referred_value
153
+
154
+ sig do
155
+ params(referred_value: GrowsurfRuby::RewardTaxValuation::OrHash).void
156
+ end
157
+ attr_writer :referred_value
158
+
149
159
  sig { returns(T.nilable(String)) }
150
160
  attr_reader :title
151
161
 
152
162
  sig { params(title: String).void }
153
163
  attr_writer :title
154
164
 
165
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
166
+ # Used by tax documentation / 1099 reporting.
167
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
168
+ attr_reader :value
169
+
170
+ sig { params(value: GrowsurfRuby::RewardTaxValuation::OrHash).void }
171
+ attr_writer :value
172
+
155
173
  sig do
156
174
  params(
157
175
  type:
@@ -175,7 +193,9 @@ module GrowsurfRuby
175
193
  referral_coupon_code: String,
176
194
  referral_description: String,
177
195
  referred_reward_upfront: T::Boolean,
196
+ referred_value: GrowsurfRuby::RewardTaxValuation::OrHash,
178
197
  title: String,
198
+ value: GrowsurfRuby::RewardTaxValuation::OrHash,
179
199
  request_options: GrowsurfRuby::RequestOptions::OrHash
180
200
  ).returns(T.attached_class)
181
201
  end
@@ -200,7 +220,13 @@ module GrowsurfRuby
200
220
  referral_coupon_code: nil,
201
221
  referral_description: nil,
202
222
  referred_reward_upfront: nil,
223
+ # Tax valuation for the referred friend's side of a double-sided reward.
224
+ # Defaults to not tax-reportable (a purchase rebate).
225
+ referred_value: nil,
203
226
  title: nil,
227
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
228
+ # Used by tax documentation / 1099 reporting.
229
+ value: nil,
204
230
  request_options: {}
205
231
  )
206
232
  end
@@ -229,7 +255,9 @@ module GrowsurfRuby
229
255
  referral_coupon_code: String,
230
256
  referral_description: String,
231
257
  referred_reward_upfront: T::Boolean,
258
+ referred_value: GrowsurfRuby::RewardTaxValuation::OrHash,
232
259
  title: String,
260
+ value: GrowsurfRuby::RewardTaxValuation::OrHash,
233
261
  request_options: GrowsurfRuby::RequestOptions
234
262
  }
235
263
  )
@@ -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
  )
@@ -19,7 +19,7 @@ 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 { returns(T.nilable(GrowsurfRuby::CommissionStructure)) }
25
25
  attr_reader :commission_structure
@@ -145,16 +145,34 @@ module GrowsurfRuby
145
145
  sig { params(referred_reward_upfront: T::Boolean).void }
146
146
  attr_writer :referred_reward_upfront
147
147
 
148
+ # Tax valuation for the referred friend's side of a double-sided reward.
149
+ # Defaults to not tax-reportable (a purchase rebate).
150
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
151
+ attr_reader :referred_value
152
+
153
+ sig do
154
+ params(referred_value: GrowsurfRuby::RewardTaxValuation::OrHash).void
155
+ end
156
+ attr_writer :referred_value
157
+
148
158
  sig { returns(T.nilable(String)) }
149
159
  attr_reader :title
150
160
 
151
161
  sig { params(title: String).void }
152
162
  attr_writer :title
153
163
 
164
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
165
+ # Used by tax documentation / 1099 reporting.
166
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
167
+ attr_reader :value
168
+
169
+ sig { params(value: GrowsurfRuby::RewardTaxValuation::OrHash).void }
170
+ attr_writer :value
171
+
154
172
  sig do
155
173
  params(
156
174
  id: String,
157
- reward_id: String,
175
+ campaign_reward_id: String,
158
176
  commission_structure: GrowsurfRuby::CommissionStructure::OrHash,
159
177
  conversions_required: Integer,
160
178
  coupon_code: String,
@@ -174,13 +192,15 @@ module GrowsurfRuby
174
192
  referral_coupon_code: String,
175
193
  referral_description: String,
176
194
  referred_reward_upfront: T::Boolean,
195
+ referred_value: GrowsurfRuby::RewardTaxValuation::OrHash,
177
196
  title: String,
197
+ value: GrowsurfRuby::RewardTaxValuation::OrHash,
178
198
  request_options: GrowsurfRuby::RequestOptions::OrHash
179
199
  ).returns(T.attached_class)
180
200
  end
181
201
  def self.new(
182
202
  id:,
183
- reward_id:,
203
+ campaign_reward_id:,
184
204
  commission_structure: nil,
185
205
  conversions_required: nil,
186
206
  coupon_code: nil,
@@ -200,7 +220,13 @@ module GrowsurfRuby
200
220
  referral_coupon_code: nil,
201
221
  referral_description: nil,
202
222
  referred_reward_upfront: nil,
223
+ # Tax valuation for the referred friend's side of a double-sided reward.
224
+ # Defaults to not tax-reportable (a purchase rebate).
225
+ referred_value: nil,
203
226
  title: nil,
227
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
228
+ # Used by tax documentation / 1099 reporting.
229
+ value: nil,
204
230
  request_options: {}
205
231
  )
206
232
  end
@@ -209,7 +235,7 @@ module GrowsurfRuby
209
235
  override.returns(
210
236
  {
211
237
  id: String,
212
- reward_id: String,
238
+ campaign_reward_id: String,
213
239
  commission_structure: GrowsurfRuby::CommissionStructure::OrHash,
214
240
  conversions_required: Integer,
215
241
  coupon_code: String,
@@ -229,7 +255,9 @@ module GrowsurfRuby
229
255
  referral_coupon_code: String,
230
256
  referral_description: String,
231
257
  referred_reward_upfront: T::Boolean,
258
+ referred_value: GrowsurfRuby::RewardTaxValuation::OrHash,
232
259
  title: String,
260
+ value: GrowsurfRuby::RewardTaxValuation::OrHash,
233
261
  request_options: GrowsurfRuby::RequestOptions
234
262
  }
235
263
  )
@@ -164,6 +164,10 @@ module GrowsurfRuby
164
164
  sig { returns(T.nilable(Integer)) }
165
165
  attr_accessor :order
166
166
 
167
+ # The coupon code delivered to the referred friend (double-sided rewards).
168
+ sig { returns(T.nilable(String)) }
169
+ attr_accessor :referral_coupon_code
170
+
167
171
  sig { returns(T.nilable(String)) }
168
172
  attr_accessor :referral_description
169
173
 
@@ -173,6 +177,28 @@ module GrowsurfRuby
173
177
  sig { params(referred_reward_upfront: T::Boolean).void }
174
178
  attr_writer :referred_reward_upfront
175
179
 
180
+ # Tax valuation for the referred friend's side of a double-sided reward.
181
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
182
+ attr_reader :referred_value
183
+
184
+ sig do
185
+ params(
186
+ referred_value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
187
+ ).void
188
+ end
189
+ attr_writer :referred_value
190
+
191
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
192
+ sig { returns(T.nilable(GrowsurfRuby::RewardTaxValuation)) }
193
+ attr_reader :value
194
+
195
+ sig do
196
+ params(
197
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
198
+ ).void
199
+ end
200
+ attr_writer :value
201
+
176
202
  sig do
177
203
  params(
178
204
  id: String,
@@ -194,8 +220,12 @@ module GrowsurfRuby
194
220
  next_milestone_suffix: T.nilable(String),
195
221
  number_of_winners: T.nilable(Integer),
196
222
  order: T.nilable(Integer),
223
+ referral_coupon_code: T.nilable(String),
197
224
  referral_description: T.nilable(String),
198
- referred_reward_upfront: T::Boolean
225
+ referred_reward_upfront: T::Boolean,
226
+ referred_value:
227
+ T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash),
228
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation::OrHash)
199
229
  ).returns(T.attached_class)
200
230
  end
201
231
  def self.new(
@@ -216,8 +246,14 @@ module GrowsurfRuby
216
246
  next_milestone_suffix: nil,
217
247
  number_of_winners: nil,
218
248
  order: nil,
249
+ # The coupon code delivered to the referred friend (double-sided rewards).
250
+ referral_coupon_code: nil,
219
251
  referral_description: nil,
220
- referred_reward_upfront: nil
252
+ referred_reward_upfront: nil,
253
+ # Tax valuation for the referred friend's side of a double-sided reward.
254
+ referred_value: nil,
255
+ # Tax valuation for the reward (the referrer's side of a double-sided reward).
256
+ value: nil
221
257
  )
222
258
  end
223
259
 
@@ -243,8 +279,11 @@ module GrowsurfRuby
243
279
  next_milestone_suffix: T.nilable(String),
244
280
  number_of_winners: T.nilable(Integer),
245
281
  order: T.nilable(Integer),
282
+ referral_coupon_code: T.nilable(String),
246
283
  referral_description: T.nilable(String),
247
- referred_reward_upfront: T::Boolean
284
+ referred_reward_upfront: T::Boolean,
285
+ referred_value: T.nilable(GrowsurfRuby::RewardTaxValuation),
286
+ value: T.nilable(GrowsurfRuby::RewardTaxValuation)
248
287
  }
249
288
  )
250
289
  end