growsurf-ruby 1.3.0 → 1.5.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 (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +10 -7
  4. data/lib/growsurf_ruby/internal/transport/base_client.rb +6 -1
  5. data/lib/growsurf_ruby/internal/type/base_model.rb +26 -0
  6. data/lib/growsurf_ruby/internal/type/base_page.rb +6 -0
  7. data/lib/growsurf_ruby/models/account_create_response.rb +3 -3
  8. data/lib/growsurf_ruby/models/analytics_availability.rb +16 -0
  9. data/lib/growsurf_ruby/models/analytics_unavailable_reason.rb +20 -0
  10. data/lib/growsurf_ruby/models/campaign/delete_program_resource_response.rb +12 -0
  11. data/lib/growsurf_ruby/models/campaign/integration.rb +69 -0
  12. data/lib/growsurf_ruby/models/campaign/integration_list_response.rb +24 -0
  13. data/lib/growsurf_ruby/models/campaign/participant_activation_analytics.rb +75 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +11 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rb +17 -17
  16. data/lib/growsurf_ruby/models/campaign/participant_record_transaction_params.rb +9 -1
  17. data/lib/growsurf_ruby/models/campaign/participant_refund_transaction_params.rb +17 -1
  18. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rb +8 -8
  19. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +15 -11
  20. data/lib/growsurf_ruby/models/campaign/participant_reward.rb +16 -3
  21. data/lib/growsurf_ruby/models/campaign/program_resource.rb +51 -0
  22. data/lib/growsurf_ruby/models/campaign/program_resource_create_params.rb +32 -0
  23. data/lib/growsurf_ruby/models/campaign/program_resource_delete_params.rb +14 -0
  24. data/lib/growsurf_ruby/models/campaign/program_resource_list_response.rb +12 -0
  25. data/lib/growsurf_ruby/models/campaign/program_resource_update_params.rb +35 -0
  26. data/lib/growsurf_ruby/models/campaign/program_resource_upload_result.rb +33 -0
  27. data/lib/growsurf_ruby/models/campaign/program_resource_upload_ticket.rb +26 -0
  28. data/lib/growsurf_ruby/models/campaign/program_resource_upload_ticket_params.rb +17 -0
  29. data/lib/growsurf_ruby/models/campaign/reward.rb +22 -1
  30. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +32 -9
  31. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +32 -9
  32. data/lib/growsurf_ruby/models/campaign.rb +25 -2
  33. data/lib/growsurf_ruby/models/campaign_activation_analytics_response.rb +186 -0
  34. data/lib/growsurf_ruby/models/campaign_create_params.rb +37 -1
  35. data/lib/growsurf_ruby/models/campaign_engagement_analytics.rb +174 -0
  36. data/lib/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rb +35 -0
  37. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +37 -4
  38. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +3 -0
  39. data/lib/growsurf_ruby/models/commission_structure.rb +19 -3
  40. data/lib/growsurf_ruby/models/participant_commission_list.rb +24 -6
  41. data/lib/growsurf_ruby/models/participant_payout_list.rb +5 -5
  42. data/lib/growsurf_ruby/models.rb +7 -0
  43. data/lib/growsurf_ruby/resources/account.rb +17 -11
  44. data/lib/growsurf_ruby/resources/campaign/design.rb +11 -5
  45. data/lib/growsurf_ruby/resources/campaign/emails.rb +2 -1
  46. data/lib/growsurf_ruby/resources/campaign/integrations.rb +41 -0
  47. data/lib/growsurf_ruby/resources/campaign/participant.rb +28 -25
  48. data/lib/growsurf_ruby/resources/campaign/program_resources.rb +112 -0
  49. data/lib/growsurf_ruby/resources/campaign/rewards.rb +12 -6
  50. data/lib/growsurf_ruby/resources/campaign.rb +53 -7
  51. data/lib/growsurf_ruby/resources/team.rb +7 -5
  52. data/lib/growsurf_ruby/version.rb +1 -1
  53. data/lib/growsurf_ruby.rb +19 -0
  54. data/rbi/growsurf_ruby/internal/type/base_model.rbi +10 -0
  55. data/rbi/growsurf_ruby/internal/type/base_page.rbi +3 -0
  56. data/rbi/growsurf_ruby/models/analytics_availability.rbi +19 -0
  57. data/rbi/growsurf_ruby/models/analytics_unavailable_reason.rbi +23 -0
  58. data/rbi/growsurf_ruby/models/campaign/delete_program_resource_response.rbi +33 -0
  59. data/rbi/growsurf_ruby/models/campaign/integration.rbi +93 -0
  60. data/rbi/growsurf_ruby/models/campaign/integration_list_response.rbi +46 -0
  61. data/rbi/growsurf_ruby/models/campaign/participant_activation_analytics.rbi +133 -0
  62. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -0
  63. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +17 -23
  64. data/rbi/growsurf_ruby/models/campaign/participant_record_transaction_params.rbi +18 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbi +18 -0
  66. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +7 -9
  67. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +16 -10
  68. data/rbi/growsurf_ruby/models/campaign/participant_reward.rbi +29 -6
  69. data/rbi/growsurf_ruby/models/campaign/program_resource.rbi +186 -0
  70. data/rbi/growsurf_ruby/models/campaign/program_resource_create_params.rbi +95 -0
  71. data/rbi/growsurf_ruby/models/campaign/program_resource_delete_params.rbi +37 -0
  72. data/rbi/growsurf_ruby/models/campaign/program_resource_list_response.rbi +29 -0
  73. data/rbi/growsurf_ruby/models/campaign/program_resource_update_params.rbi +105 -0
  74. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_result.rbi +94 -0
  75. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_ticket.rbi +57 -0
  76. data/rbi/growsurf_ruby/models/campaign/program_resource_upload_ticket_params.rbi +53 -0
  77. data/rbi/growsurf_ruby/models/campaign/reward.rbi +55 -0
  78. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +97 -24
  79. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +97 -24
  80. data/rbi/growsurf_ruby/models/campaign.rbi +52 -3
  81. data/rbi/growsurf_ruby/models/campaign_activation_analytics_response.rbi +325 -0
  82. data/rbi/growsurf_ruby/models/campaign_create_params.rbi +91 -0
  83. data/rbi/growsurf_ruby/models/campaign_engagement_analytics.rbi +369 -0
  84. data/rbi/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rbi +59 -0
  85. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +56 -3
  86. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +27 -7
  87. data/rbi/growsurf_ruby/models/commission_structure.rbi +36 -3
  88. data/rbi/growsurf_ruby/models/participant_commission_list.rbi +63 -15
  89. data/rbi/growsurf_ruby/models/participant_payout_list.rbi +15 -15
  90. data/rbi/growsurf_ruby/models.rbi +7 -0
  91. data/rbi/growsurf_ruby/resources/account.rbi +9 -6
  92. data/rbi/growsurf_ruby/resources/campaign/design.rbi +32 -4
  93. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +2 -1
  94. data/rbi/growsurf_ruby/resources/campaign/integrations.rbi +35 -0
  95. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +38 -24
  96. data/rbi/growsurf_ruby/resources/campaign/program_resources.rbi +116 -0
  97. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +35 -16
  98. data/rbi/growsurf_ruby/resources/campaign.rbi +53 -5
  99. data/rbi/growsurf_ruby/resources/team.rbi +7 -5
  100. data/sig/growsurf_ruby/internal/type/base_model.rbs +6 -0
  101. data/sig/growsurf_ruby/internal/type/base_page.rbs +2 -0
  102. data/sig/growsurf_ruby/models/analytics_availability.rbs +15 -0
  103. data/sig/growsurf_ruby/models/analytics_unavailable_reason.rbs +26 -0
  104. data/sig/growsurf_ruby/models/campaign/delete_program_resource_response.rbs +14 -0
  105. data/sig/growsurf_ruby/models/campaign/integration.rbs +47 -0
  106. data/sig/growsurf_ruby/models/campaign/integration_list_response.rbs +20 -0
  107. data/sig/growsurf_ruby/models/campaign/participant_activation_analytics.rbs +96 -0
  108. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +22 -1
  109. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +17 -22
  110. data/sig/growsurf_ruby/models/campaign/participant_record_transaction_params.rbs +15 -1
  111. data/sig/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbs +15 -1
  112. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +8 -10
  113. data/sig/growsurf_ruby/models/campaign/participant_reward.rbs +24 -9
  114. data/sig/growsurf_ruby/models/campaign/program_resource.rbs +94 -0
  115. data/sig/growsurf_ruby/models/campaign/program_resource_create_params.rbs +45 -0
  116. data/sig/growsurf_ruby/models/campaign/program_resource_delete_params.rbs +22 -0
  117. data/sig/growsurf_ruby/models/campaign/program_resource_list_response.rbs +14 -0
  118. data/sig/growsurf_ruby/models/campaign/program_resource_update_params.rbs +48 -0
  119. data/sig/growsurf_ruby/models/campaign/program_resource_upload_result.rbs +58 -0
  120. data/sig/growsurf_ruby/models/campaign/program_resource_upload_ticket.rbs +29 -0
  121. data/sig/growsurf_ruby/models/campaign/program_resource_upload_ticket_params.rbs +29 -0
  122. data/sig/growsurf_ruby/models/campaign/reward.rbs +16 -0
  123. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +54 -34
  124. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +54 -34
  125. data/sig/growsurf_ruby/models/campaign.rbs +23 -5
  126. data/sig/growsurf_ruby/models/campaign_activation_analytics_response.rbs +202 -0
  127. data/sig/growsurf_ruby/models/campaign_create_params.rbs +29 -0
  128. data/sig/growsurf_ruby/models/campaign_engagement_analytics.rbs +186 -0
  129. data/sig/growsurf_ruby/models/campaign_retrieve_activation_analytics_params.rbs +45 -0
  130. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_params.rbs +30 -1
  131. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +21 -3
  132. data/sig/growsurf_ruby/models/commission_structure.rbs +16 -4
  133. data/sig/growsurf_ruby/models/participant_commission_list.rbs +36 -20
  134. data/sig/growsurf_ruby/models/participant_payout_list.rbs +20 -20
  135. data/sig/growsurf_ruby/models.rbs +6 -0
  136. data/sig/growsurf_ruby/resources/campaign/design.rbs +19 -0
  137. data/sig/growsurf_ruby/resources/campaign/integrations.rbs +14 -0
  138. data/sig/growsurf_ruby/resources/campaign/participant.rbs +4 -0
  139. data/sig/growsurf_ruby/resources/campaign/program_resources.rbs +58 -0
  140. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +14 -12
  141. data/sig/growsurf_ruby/resources/campaign.rbs +17 -0
  142. metadata +59 -2
@@ -69,6 +69,14 @@ module GrowsurfRuby
69
69
  sig { returns(String) }
70
70
  attr_accessor :currency_iso
71
71
 
72
+ # The event that generated this commission. Legacy commissions return `SALE`.
73
+ sig do
74
+ returns(
75
+ GrowsurfRuby::ParticipantCommissionList::Commission::Event::TaggedSymbol
76
+ )
77
+ end
78
+ attr_accessor :event
79
+
72
80
  sig { returns(String) }
73
81
  attr_accessor :referred_id
74
82
 
@@ -91,7 +99,7 @@ module GrowsurfRuby
91
99
  sig { returns(T.nilable(Integer)) }
92
100
  attr_reader :approved_at
93
101
 
94
- sig { params(approved_at: Integer).void }
102
+ sig { params(approved_at: T.nilable(Integer)).void }
95
103
  attr_writer :approved_at
96
104
 
97
105
  sig { returns(T.nilable(String)) }
@@ -103,7 +111,7 @@ module GrowsurfRuby
103
111
  sig { returns(T.nilable(Integer)) }
104
112
  attr_reader :exchange_rate_at
105
113
 
106
- sig { params(exchange_rate_at: Integer).void }
114
+ sig { params(exchange_rate_at: T.nilable(Integer)).void }
107
115
  attr_writer :exchange_rate_at
108
116
 
109
117
  sig { returns(T.nilable(String)) }
@@ -115,13 +123,13 @@ module GrowsurfRuby
115
123
  sig { returns(T.nilable(Integer)) }
116
124
  attr_reader :paid_at
117
125
 
118
- sig { params(paid_at: Integer).void }
126
+ sig { params(paid_at: T.nilable(Integer)).void }
119
127
  attr_writer :paid_at
120
128
 
121
129
  sig { returns(T.nilable(Integer)) }
122
130
  attr_reader :payout_queued_at
123
131
 
124
- sig { params(payout_queued_at: Integer).void }
132
+ sig { params(payout_queued_at: T.nilable(Integer)).void }
125
133
  attr_writer :payout_queued_at
126
134
 
127
135
  sig { returns(T.nilable(String)) }
@@ -130,7 +138,7 @@ module GrowsurfRuby
130
138
  sig { returns(T.nilable(Integer)) }
131
139
  attr_reader :reversed_at
132
140
 
133
- sig { params(reversed_at: Integer).void }
141
+ sig { params(reversed_at: T.nilable(Integer)).void }
134
142
  attr_writer :reversed_at
135
143
 
136
144
  sig { returns(T.nilable(Integer)) }
@@ -142,22 +150,24 @@ module GrowsurfRuby
142
150
  amount: T.nilable(Integer),
143
151
  created_at: Integer,
144
152
  currency_iso: String,
153
+ event:
154
+ GrowsurfRuby::ParticipantCommissionList::Commission::Event::OrSymbol,
145
155
  referred_id: String,
146
156
  referrer_id: String,
147
157
  sale_amount: T.nilable(Integer),
148
158
  status:
149
159
  GrowsurfRuby::ParticipantCommissionList::Commission::Status::OrSymbol,
150
160
  amount_in_campaign_currency: T.nilable(Integer),
151
- approved_at: Integer,
161
+ approved_at: T.nilable(Integer),
152
162
  campaign_currency_iso: T.nilable(String),
153
163
  exchange_rate: T.nilable(Float),
154
- exchange_rate_at: Integer,
164
+ exchange_rate_at: T.nilable(Integer),
155
165
  fx_error: T.nilable(String),
156
166
  hold_duration: T.nilable(Integer),
157
- paid_at: Integer,
158
- payout_queued_at: Integer,
167
+ paid_at: T.nilable(Integer),
168
+ payout_queued_at: T.nilable(Integer),
159
169
  provider: T.nilable(String),
160
- reversed_at: Integer,
170
+ reversed_at: T.nilable(Integer),
161
171
  sale_amount_in_campaign_currency: T.nilable(Integer)
162
172
  ).returns(T.attached_class)
163
173
  end
@@ -166,6 +176,8 @@ module GrowsurfRuby
166
176
  amount:,
167
177
  created_at:,
168
178
  currency_iso:,
179
+ # The event that generated this commission. Legacy commissions return `SALE`.
180
+ event:,
169
181
  referred_id:,
170
182
  referrer_id:,
171
183
  sale_amount:,
@@ -192,22 +204,24 @@ module GrowsurfRuby
192
204
  amount: T.nilable(Integer),
193
205
  created_at: Integer,
194
206
  currency_iso: String,
207
+ event:
208
+ GrowsurfRuby::ParticipantCommissionList::Commission::Event::TaggedSymbol,
195
209
  referred_id: String,
196
210
  referrer_id: String,
197
211
  sale_amount: T.nilable(Integer),
198
212
  status:
199
213
  GrowsurfRuby::ParticipantCommissionList::Commission::Status::TaggedSymbol,
200
214
  amount_in_campaign_currency: T.nilable(Integer),
201
- approved_at: Integer,
215
+ approved_at: T.nilable(Integer),
202
216
  campaign_currency_iso: T.nilable(String),
203
217
  exchange_rate: T.nilable(Float),
204
- exchange_rate_at: Integer,
218
+ exchange_rate_at: T.nilable(Integer),
205
219
  fx_error: T.nilable(String),
206
220
  hold_duration: T.nilable(Integer),
207
- paid_at: Integer,
208
- payout_queued_at: Integer,
221
+ paid_at: T.nilable(Integer),
222
+ payout_queued_at: T.nilable(Integer),
209
223
  provider: T.nilable(String),
210
- reversed_at: Integer,
224
+ reversed_at: T.nilable(Integer),
211
225
  sale_amount_in_campaign_currency: T.nilable(Integer)
212
226
  }
213
227
  )
@@ -215,6 +229,40 @@ module GrowsurfRuby
215
229
  def to_hash
216
230
  end
217
231
 
232
+ module Event
233
+ extend GrowsurfRuby::Internal::Type::Enum
234
+
235
+ TaggedSymbol =
236
+ T.type_alias do
237
+ T.all(
238
+ Symbol,
239
+ GrowsurfRuby::ParticipantCommissionList::Commission::Event
240
+ )
241
+ end
242
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
243
+
244
+ LEAD =
245
+ T.let(
246
+ :LEAD,
247
+ GrowsurfRuby::ParticipantCommissionList::Commission::Event::TaggedSymbol
248
+ )
249
+ SALE =
250
+ T.let(
251
+ :SALE,
252
+ GrowsurfRuby::ParticipantCommissionList::Commission::Event::TaggedSymbol
253
+ )
254
+
255
+ sig do
256
+ override.returns(
257
+ T::Array[
258
+ GrowsurfRuby::ParticipantCommissionList::Commission::Event::TaggedSymbol
259
+ ]
260
+ )
261
+ end
262
+ def self.values
263
+ end
264
+ end
265
+
218
266
  module Status
219
267
  extend GrowsurfRuby::Internal::Type::Enum
220
268
 
@@ -88,13 +88,13 @@ module GrowsurfRuby
88
88
  sig { returns(T.nilable(Integer)) }
89
89
  attr_reader :exchange_rate_at
90
90
 
91
- sig { params(exchange_rate_at: Integer).void }
91
+ sig { params(exchange_rate_at: T.nilable(Integer)).void }
92
92
  attr_writer :exchange_rate_at
93
93
 
94
94
  sig { returns(T.nilable(Integer)) }
95
95
  attr_reader :failed_at
96
96
 
97
- sig { params(failed_at: Integer).void }
97
+ sig { params(failed_at: T.nilable(Integer)).void }
98
98
  attr_writer :failed_at
99
99
 
100
100
  sig { returns(T.nilable(String)) }
@@ -103,7 +103,7 @@ module GrowsurfRuby
103
103
  sig { returns(T.nilable(Integer)) }
104
104
  attr_reader :issued_at
105
105
 
106
- sig { params(issued_at: Integer).void }
106
+ sig { params(issued_at: T.nilable(Integer)).void }
107
107
  attr_writer :issued_at
108
108
 
109
109
  sig { returns(T.nilable(String)) }
@@ -112,13 +112,13 @@ module GrowsurfRuby
112
112
  sig { returns(T.nilable(Integer)) }
113
113
  attr_reader :queued_at
114
114
 
115
- sig { params(queued_at: Integer).void }
115
+ sig { params(queued_at: T.nilable(Integer)).void }
116
116
  attr_writer :queued_at
117
117
 
118
118
  sig { returns(T.nilable(Integer)) }
119
119
  attr_reader :reversed_at
120
120
 
121
- sig { params(reversed_at: Integer).void }
121
+ sig { params(reversed_at: T.nilable(Integer)).void }
122
122
  attr_writer :reversed_at
123
123
 
124
124
  sig do
@@ -134,13 +134,13 @@ module GrowsurfRuby
134
134
  amount_in_campaign_currency: T.nilable(Integer),
135
135
  campaign_currency_iso: T.nilable(String),
136
136
  exchange_rate: T.nilable(Float),
137
- exchange_rate_at: Integer,
138
- failed_at: Integer,
137
+ exchange_rate_at: T.nilable(Integer),
138
+ failed_at: T.nilable(Integer),
139
139
  fx_error: T.nilable(String),
140
- issued_at: Integer,
140
+ issued_at: T.nilable(Integer),
141
141
  provider: T.nilable(String),
142
- queued_at: Integer,
143
- reversed_at: Integer
142
+ queued_at: T.nilable(Integer),
143
+ reversed_at: T.nilable(Integer)
144
144
  ).returns(T.attached_class)
145
145
  end
146
146
  def self.new(
@@ -178,13 +178,13 @@ module GrowsurfRuby
178
178
  amount_in_campaign_currency: T.nilable(Integer),
179
179
  campaign_currency_iso: T.nilable(String),
180
180
  exchange_rate: T.nilable(Float),
181
- exchange_rate_at: Integer,
182
- failed_at: Integer,
181
+ exchange_rate_at: T.nilable(Integer),
182
+ failed_at: T.nilable(Integer),
183
183
  fx_error: T.nilable(String),
184
- issued_at: Integer,
184
+ issued_at: T.nilable(Integer),
185
185
  provider: T.nilable(String),
186
- queued_at: Integer,
187
- reversed_at: Integer
186
+ queued_at: T.nilable(Integer),
187
+ reversed_at: T.nilable(Integer)
188
188
  }
189
189
  )
190
190
  end
@@ -3,6 +3,10 @@
3
3
  module GrowsurfRuby
4
4
  AccountCreateParams = GrowsurfRuby::Models::AccountCreateParams
5
5
 
6
+ AnalyticsAvailability = GrowsurfRuby::Models::AnalyticsAvailability
7
+
8
+ AnalyticsUnavailableReason = GrowsurfRuby::Models::AnalyticsUnavailableReason
9
+
6
10
  AffiliateApplication = GrowsurfRuby::Models::AffiliateApplication
7
11
 
8
12
  AffiliateInvite = GrowsurfRuby::Models::AffiliateInvite
@@ -51,6 +55,9 @@ module GrowsurfRuby
51
55
  CampaignRetrieveAffiliateApplicationParams =
52
56
  GrowsurfRuby::Models::CampaignRetrieveAffiliateApplicationParams
53
57
 
58
+ CampaignRetrieveActivationAnalyticsParams =
59
+ GrowsurfRuby::Models::CampaignRetrieveActivationAnalyticsParams
60
+
54
61
  CampaignRetrieveAnalyticsParams =
55
62
  GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams
56
63
 
@@ -4,8 +4,13 @@ module GrowsurfRuby
4
4
  module Resources
5
5
  class Account
6
6
  # Creates a new GrowSurf account. This is the only endpoint that does not require
7
- # an API key. The response includes an API key for the new account, shown once in
8
- # the response. The key is locked until the team owner's email address is
7
+ # an API key. Before calling it, an authorized account owner must review and
8
+ # approve GrowSurf's [Terms of Service](https://growsurf.com/terms) and [Privacy
9
+ # Policy](https://growsurf.com/privacy). The account starts a 14-day Business
10
+ # trial without a credit card. The response includes an API key for the new
11
+ # account, shown once in the response. The key is a secret: store it in a secret
12
+ # manager and do not put it in logs, screenshots, URLs, model context, analytics,
13
+ # or generated output. The key is locked until the team owner's email address is
9
14
  # verified: authenticated program and resource endpoints return a `403` with error
10
15
  # code `EMAIL_NOT_VERIFIED_ERROR` until then (resend the email via `POST
11
16
  # /team/owner/verification-email`, then retry). A welcome email is sent to the
@@ -13,10 +18,8 @@ module GrowsurfRuby
13
18
  # Accounts whose email is never verified are deleted automatically after 7 days.
14
19
  # For security, the API key is rotated the first time the account owner signs in
15
20
  # to the GrowSurf dashboard. Some actions (such as emailing participants)
16
- # additionally require GrowSurf to verify the team first. By creating an account
17
- # you agree, on behalf of the account holder, to GrowSurf's [Terms of
18
- # Service](https://growsurf.com/terms) and [Privacy
19
- # Policy](https://growsurf.com/privacy).
21
+ # additionally require GrowSurf to verify the team first. Calling this endpoint
22
+ # accepts those policies on the account holder's behalf.
20
23
  sig do
21
24
  params(
22
25
  email: String,
@@ -4,10 +4,37 @@ module GrowsurfRuby
4
4
  module Resources
5
5
  class Campaign
6
6
  class Design
7
+ # Icon configuration for the participant Resources destination.
8
+ ResourcesIcon = T.type_alias do
9
+ {
10
+ type: T.nilable(T.any(String, Symbol)),
11
+ imageUrl: T.nilable(String)
12
+ }
13
+ end
14
+
15
+ # Participant presentation settings for Resources. Each label is limited to 100
16
+ # characters; imageUrl is limited to 500. Resource items use Program Resources operations.
17
+ Resources = T.type_alias do
18
+ {
19
+ isPublicDisplayed: T.nilable(T::Boolean),
20
+ title: T.nilable(String),
21
+ viewResourcesLinkText: T.nilable(String),
22
+ backLinkText: T.nilable(String),
23
+ copyButtonText: T.nilable(String),
24
+ copiedText: T.nilable(String),
25
+ emptyState: T.nilable(String),
26
+ icon: T.nilable(ResourcesIcon)
27
+ }
28
+ end
29
+
7
30
  # Retrieves a program's design configuration — the same surface as the dashboard
8
31
  # Program Editor's **Design** tab: the GrowSurf window layout, header, share
9
- # channels + invite, signup form, portal/landing pages, theme styling, and the
10
- # referral/affiliate summary + status sections. Available fields depend on the program type.
32
+ # channels + invite, signup form, Resources presentation, portal/landing pages, theme styling, and the
33
+ # referral/affiliate summary + status sections. `referredExperience` includes the Claim
34
+ # Offer Popup for both program types, with its colors under
35
+ # `theme.referredExperienceOfferPopup`.
36
+ # `participantAvatarStyle` is `CHARACTERS`, `INITIALS`, `ANIMALS`, or `GRADIENT`; missing or
37
+ # unknown values mean `INITIALS`.
11
38
  # `payoutDestinationConfirmation` is omitted when no confirmation fields are stored. Stored
12
39
  # `null` fields are returned as `null`; omitted and `null` fields use localized defaults.
13
40
  sig do
@@ -24,7 +51,7 @@ module GrowsurfRuby
24
51
  end
25
52
 
26
53
  # Updates a program's design configuration, including the payout-destination confirmation
27
- # page copy configured from payout integration cards. Only the fields you send are
54
+ # page copy and the Claim Offer Popup under `referredExperience`. Only the fields you send are
28
55
  # changed; anything you leave out is untouched (arrays such as `signup.fields` replace
29
56
  # wholesale). Unknown fields, fields not available for the program type, and invalid
30
57
  # values return a `400`. Landing-page custom code and JavaScript are not editable via the
@@ -39,7 +66,8 @@ module GrowsurfRuby
39
66
  def update(
40
67
  # GrowSurf program ID.
41
68
  id,
42
- # Partial design configuration to merge.
69
+ # Partial design configuration to merge. `resources` accepts visibility, title,
70
+ # list/back/copy labels, and an icon with type `DEFAULT`, `IMAGE`, or `NONE`.
43
71
  body,
44
72
  request_options: {}
45
73
  )
@@ -8,7 +8,8 @@ module GrowsurfRuby
8
8
  # Program Editor's **Emails** tab. Returns each editable email template
9
9
  # (`subject`, `preheader`, `body`, `isEnabled`) plus the `settings` block (sender,
10
10
  # contact, and design). The set of email templates returned depends on the program
11
- # type (referral vs affiliate).
11
+ # type (referral vs affiliate). `offerClaimed` is available to both program types and sends
12
+ # while the Claim Offer Popup is enabled.
12
13
  sig do
13
14
  params(
14
15
  id: String,
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class Integrations
7
+ # Lists every integration this program can connect, each with its current state.
8
+ # Integrations that do not apply to the program type are omitted (for example,
9
+ # Wise on a referral program). Read-only: connecting an integration is an OAuth or
10
+ # credential handshake completed in the GrowSurf dashboard, so it cannot be done
11
+ # over the API. `connected` means credentials are stored, `enabled` means the
12
+ # integration is switched on and working, and `autoDisabled` means GrowSurf
13
+ # switched it off after repeated delivery failures — its credentials are still
14
+ # stored, but it delivers nothing until it is reconnected in the dashboard.
15
+ sig do
16
+ params(
17
+ id: String,
18
+ request_options: GrowsurfRuby::RequestOptions::OrHash
19
+ ).returns(GrowsurfRuby::Models::Campaign::IntegrationListResponse)
20
+ end
21
+ def list(
22
+ # GrowSurf program ID.
23
+ id,
24
+ request_options: {}
25
+ )
26
+ end
27
+
28
+ # @api private
29
+ sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
30
+ def self.new(client:)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -13,7 +13,7 @@ module GrowsurfRuby
13
13
  ).returns(GrowsurfRuby::Campaign::CampaignParticipant)
14
14
  end
15
15
  def retrieve(
16
- # GrowSurf participant ID or URL-encoded participant email address.
16
+ # GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
17
17
  participant_id_or_email,
18
18
  # GrowSurf program ID.
19
19
  id:,
@@ -46,7 +46,7 @@ module GrowsurfRuby
46
46
  ).returns(GrowsurfRuby::Campaign::CampaignParticipant)
47
47
  end
48
48
  def update(
49
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
49
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
50
50
  participant_id_or_email,
51
51
  # Path param: GrowSurf program ID.
52
52
  id:,
@@ -86,7 +86,7 @@ module GrowsurfRuby
86
86
  ).returns(GrowsurfRuby::Models::Campaign::ParticipantDeleteResponse)
87
87
  end
88
88
  def delete(
89
- # GrowSurf participant ID or URL-encoded participant email address.
89
+ # GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
90
90
  participant_id_or_email,
91
91
  # GrowSurf program ID.
92
92
  id:,
@@ -189,7 +189,7 @@ module GrowsurfRuby
189
189
  ).returns(GrowsurfRuby::ParticipantCommissionList)
190
190
  end
191
191
  def list_commissions(
192
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
192
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
193
193
  participant_id_or_email,
194
194
  # Path param: GrowSurf program ID.
195
195
  id:,
@@ -217,7 +217,7 @@ module GrowsurfRuby
217
217
  ).returns(GrowsurfRuby::ParticipantPayoutList)
218
218
  end
219
219
  def list_payouts(
220
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
220
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
221
221
  participant_id_or_email,
222
222
  # Path param: GrowSurf program ID.
223
223
  id:,
@@ -250,7 +250,7 @@ module GrowsurfRuby
250
250
  ).returns(GrowsurfRuby::ReferralList)
251
251
  end
252
252
  def list_referrals(
253
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
253
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
254
254
  participant_id_or_email,
255
255
  # Path param: GrowSurf program ID.
256
256
  id:,
@@ -289,7 +289,7 @@ module GrowsurfRuby
289
289
  )
290
290
  end
291
291
  def list_rewards(
292
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
292
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
293
293
  participant_id_or_email,
294
294
  # Path param: GrowSurf program ID.
295
295
  id:,
@@ -334,13 +334,15 @@ module GrowsurfRuby
334
334
  total_tax_amounts: T::Array[T::Hash[Symbol, T.anything]],
335
335
  total_taxes: T::Array[T::Hash[Symbol, T.anything]],
336
336
  transaction_id: String,
337
+ payment_provider: String,
338
+ test_mode: T::Boolean,
337
339
  request_options: GrowsurfRuby::RequestOptions::OrHash
338
340
  ).returns(
339
341
  GrowsurfRuby::Models::Campaign::ParticipantRecordTransactionResponse::Variants
340
342
  )
341
343
  end
342
344
  def record_transaction(
343
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
345
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
344
346
  participant_id_or_email,
345
347
  # Path param: GrowSurf program ID.
346
348
  id:,
@@ -390,6 +392,8 @@ module GrowsurfRuby
390
392
  total_taxes: nil,
391
393
  # Body param
392
394
  transaction_id: nil,
395
+ payment_provider: nil,
396
+ test_mode: nil,
393
397
  request_options: {}
394
398
  )
395
399
  end
@@ -399,7 +403,8 @@ module GrowsurfRuby
399
403
  # and reverses or adjusts the referrer's commission. The inverse of Record
400
404
  # Affiliate Transaction. Identify the original transaction with the same
401
405
  # identifier(s) you sent when recording it. Commissions already paid out to the
402
- # affiliate are not clawed back; the amendment is recorded for tax reporting only.
406
+ # affiliate are not clawed back. The amendment still updates the sale revenue used
407
+ # in program reporting; full refunds and chargebacks also update tax reporting.
403
408
  sig do
404
409
  params(
405
410
  participant_id_or_email: String,
@@ -420,13 +425,15 @@ module GrowsurfRuby
420
425
  refund_id: String,
421
426
  refund_status: String,
422
427
  transaction_id: String,
428
+ payment_provider: String,
429
+ test_mode: T::Boolean,
423
430
  request_options: GrowsurfRuby::RequestOptions::OrHash
424
431
  ).returns(
425
432
  GrowsurfRuby::Models::Campaign::ParticipantRefundTransactionResponse
426
433
  )
427
434
  end
428
435
  def refund_transaction(
429
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
436
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
430
437
  participant_id_or_email,
431
438
  # Path param: GrowSurf program ID.
432
439
  id:,
@@ -460,6 +467,8 @@ module GrowsurfRuby
460
467
  refund_status: nil,
461
468
  # Body param
462
469
  transaction_id: nil,
470
+ payment_provider: nil,
471
+ test_mode: nil,
463
472
  request_options: {}
464
473
  )
465
474
  end
@@ -480,7 +489,7 @@ module GrowsurfRuby
480
489
  )
481
490
  end
482
491
  def send_invites(
483
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
492
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
484
493
  participant_id_or_email,
485
494
  # Path param: GrowSurf program ID.
486
495
  id:,
@@ -510,7 +519,7 @@ module GrowsurfRuby
510
519
  )
511
520
  end
512
521
  def trigger_referral(
513
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
522
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
514
523
  participant_id_or_email,
515
524
  # Path param: GrowSurf program ID.
516
525
  id:,
@@ -539,7 +548,7 @@ module GrowsurfRuby
539
548
  )
540
549
  end
541
550
  def cancel_delayed_referral(
542
- # GrowSurf participant ID or URL-encoded participant email address.
551
+ # GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
543
552
  participant_id_or_email,
544
553
  # GrowSurf program ID.
545
554
  id:,
@@ -567,7 +576,7 @@ module GrowsurfRuby
567
576
  ).returns(GrowsurfRuby::Models::Campaign::ParticipantEmailResponse)
568
577
  end
569
578
  def email(
570
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
579
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
571
580
  participant_id_or_email,
572
581
  # Path param: GrowSurf program ID.
573
582
  id:,
@@ -609,7 +618,7 @@ module GrowsurfRuby
609
618
  )
610
619
  end
611
620
  def list_activity_logs(
612
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
621
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
613
622
  participant_id_or_email,
614
623
  # Path param: GrowSurf program ID.
615
624
  id:,
@@ -626,7 +635,9 @@ module GrowsurfRuby
626
635
  # metrics for affiliate programs). Pass `include=email` for `sent` (accepted for
627
636
  # delivery), `delivered`, `opened`, `clicked`, `bounced`, and `spamComplaints` metrics
628
637
  # attributed to this participant, including invitations they sent. Use
629
- # `include=email,series` to include the same counts in each UTC series bucket.
638
+ # `include=email,series` to include the same counts in each UTC series bucket. `days`,
639
+ # `startDate`, and `endDate` filter only the optional `series` and `email` data. They do
640
+ # not filter the top-level `analytics`, `ranks`, or `shareCount` values.
630
641
  sig do
631
642
  params(
632
643
  participant_id_or_email: String,
@@ -643,14 +654,16 @@ module GrowsurfRuby
643
654
  )
644
655
  end
645
656
  def retrieve_analytics(
646
- # GrowSurf participant ID or URL-encoded participant email address.
657
+ # GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
647
658
  participant_id_or_email,
648
659
  # GrowSurf program ID.
649
660
  id:,
650
- # Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
661
+ # Last number of days for optional `series` and `email` analytics. Defaults to 365.
662
+ # Maximum 1825. Does not filter the top-level all-time totals.
651
663
  days: nil,
652
- # End date of the analytics timeframe as a Unix timestamp in milliseconds.
653
- # Required if `days` is not set.
664
+ # End of a custom `series` and `email` analytics window as a Unix timestamp in
665
+ # milliseconds. Set it together with `startDate`. Does not filter the top-level
666
+ # all-time totals.
654
667
  end_date: nil,
655
668
  # Comma-separated optional data. `series` returns this participant's own activity per
656
669
  # period; `email` returns `sent`, `delivered`, `opened`, `clicked`, `bounced`,
@@ -662,8 +675,9 @@ module GrowsurfRuby
662
675
  # Bucket size for the `series` (only used when `include` contains `series`). Defaults to
663
676
  # `day`.
664
677
  interval: nil,
665
- # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
666
- # Required if `days` is not set.
678
+ # Start of a custom `series` and `email` analytics window as a Unix timestamp in
679
+ # milliseconds. Set it together with `endDate`. Does not filter the top-level
680
+ # all-time totals.
667
681
  start_date: nil,
668
682
  request_options: {}
669
683
  )
@@ -685,7 +699,7 @@ module GrowsurfRuby
685
699
  )
686
700
  end
687
701
  def get_payout_destination(
688
- # GrowSurf participant ID or URL-encoded participant email address.
702
+ # GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
689
703
  participant_id_or_email,
690
704
  # GrowSurf program ID.
691
705
  id:,
@@ -709,7 +723,7 @@ module GrowsurfRuby
709
723
  )
710
724
  end
711
725
  def request_payout_destination_confirmation(
712
- # Path param: GrowSurf participant ID or URL-encoded participant email address.
726
+ # Path param: GrowSurf participant ID or unencoded participant email address (the SDK encodes it automatically).
713
727
  participant_id_or_email,
714
728
  # Path param: GrowSurf program ID.
715
729
  id:,