growsurf-ruby 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/LICENSE +201 -0
  4. data/README.md +1 -1
  5. data/lib/growsurf_ruby/internal/transport/base_client.rb +21 -4
  6. data/lib/growsurf_ruby/models/affiliate_application.rb +249 -0
  7. data/lib/growsurf_ruby/models/affiliate_application_list_response.rb +42 -0
  8. data/lib/growsurf_ruby/models/affiliate_invite.rb +109 -0
  9. data/lib/growsurf_ruby/models/affiliate_invite_list_response.rb +41 -0
  10. data/lib/growsurf_ruby/models/campaign/create.rb +12 -1
  11. data/lib/growsurf_ruby/models/campaign/participant.rb +79 -4
  12. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +28 -17
  13. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rb +28 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rb +126 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_list_payouts_params.rb +1 -0
  16. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rb +50 -0
  17. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rb +56 -0
  18. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +14 -17
  19. data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +25 -9
  20. data/lib/growsurf_ruby/models/campaign/referral_source.rb +3 -0
  21. data/lib/growsurf_ruby/models/campaign/reward.rb +20 -3
  22. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +3 -3
  23. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +3 -3
  24. data/lib/growsurf_ruby/models/campaign.rb +2 -2
  25. data/lib/growsurf_ruby/models/campaign_create_affiliate_invite_params.rb +45 -0
  26. data/lib/growsurf_ruby/models/campaign_list_affiliate_applications_params.rb +57 -0
  27. data/lib/growsurf_ruby/models/campaign_list_affiliate_invites_params.rb +58 -0
  28. data/lib/growsurf_ruby/models/campaign_list_payouts_params.rb +1 -0
  29. data/lib/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rb +26 -0
  30. data/lib/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rb +26 -0
  31. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +9 -6
  32. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +59 -11
  33. data/lib/growsurf_ruby/models/campaign_review_affiliate_application_params.rb +94 -0
  34. data/lib/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rb +26 -0
  35. data/lib/growsurf_ruby/models/email_analytics.rb +41 -0
  36. data/lib/growsurf_ruby/models/participant_payout_list.rb +8 -1
  37. data/lib/growsurf_ruby/models/reward_tax_valuation.rb +24 -9
  38. data/lib/growsurf_ruby/models.rb +19 -0
  39. data/lib/growsurf_ruby/resources/campaign/design.rb +14 -12
  40. data/lib/growsurf_ruby/resources/campaign/options.rb +7 -7
  41. data/lib/growsurf_ruby/resources/campaign/participant.rb +96 -11
  42. data/lib/growsurf_ruby/resources/campaign/rewards.rb +2 -2
  43. data/lib/growsurf_ruby/resources/campaign.rb +231 -4
  44. data/lib/growsurf_ruby/version.rb +1 -1
  45. data/lib/growsurf_ruby.rb +16 -0
  46. data/rbi/growsurf_ruby/models/affiliate_application.rbi +431 -0
  47. data/rbi/growsurf_ruby/models/affiliate_application_list_response.rbi +70 -0
  48. data/rbi/growsurf_ruby/models/affiliate_invite.rbi +167 -0
  49. data/rbi/growsurf_ruby/models/affiliate_invite_list_response.rbi +70 -0
  50. data/rbi/growsurf_ruby/models/campaign/create.rbi +17 -0
  51. data/rbi/growsurf_ruby/models/campaign/participant.rbi +169 -3
  52. data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +3 -5
  53. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -20
  54. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +3 -1
  55. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbi +48 -0
  56. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +243 -0
  57. data/rbi/growsurf_ruby/models/campaign/participant_list_payouts_params.rbi +5 -0
  58. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbi +100 -0
  59. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +118 -0
  60. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +22 -52
  61. data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +67 -11
  62. data/rbi/growsurf_ruby/models/campaign/referral_source.rbi +9 -0
  63. data/rbi/growsurf_ruby/models/campaign/reward.rbi +23 -2
  64. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +4 -4
  65. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +4 -4
  66. data/rbi/growsurf_ruby/models/campaign.rbi +2 -2
  67. data/rbi/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbi +74 -0
  68. data/rbi/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbi +130 -0
  69. data/rbi/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbi +135 -0
  70. data/rbi/growsurf_ruby/models/campaign_list_payouts_params.rbi +5 -0
  71. data/rbi/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbi +46 -0
  72. data/rbi/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbi +46 -0
  73. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +15 -10
  74. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +68 -18
  75. data/rbi/growsurf_ruby/models/campaign_review_affiliate_application_params.rbi +167 -0
  76. data/rbi/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbi +46 -0
  77. data/rbi/growsurf_ruby/models/email_analytics.rbi +200 -0
  78. data/rbi/growsurf_ruby/models/participant_payout_list.rbi +17 -3
  79. data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +66 -9
  80. data/rbi/growsurf_ruby/models.rbi +25 -0
  81. data/rbi/growsurf_ruby/resources/campaign/design.rbi +9 -8
  82. data/rbi/growsurf_ruby/resources/campaign/options.rbi +7 -7
  83. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +89 -13
  84. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +4 -4
  85. data/rbi/growsurf_ruby/resources/campaign.rbi +188 -10
  86. data/sig/growsurf_ruby/models/affiliate_application.rbs +192 -0
  87. data/sig/growsurf_ruby/models/affiliate_application_list_response.rbs +39 -0
  88. data/sig/growsurf_ruby/models/affiliate_invite.rbs +92 -0
  89. data/sig/growsurf_ruby/models/affiliate_invite_list_response.rbs +39 -0
  90. data/sig/growsurf_ruby/models/campaign/create.rbs +7 -0
  91. data/sig/growsurf_ruby/models/campaign/participant.rbs +62 -2
  92. data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +2 -11
  93. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +12 -12
  94. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbs +30 -0
  95. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +107 -0
  96. data/sig/growsurf_ruby/models/campaign/participant_list_payouts_params.rbs +2 -1
  97. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbs +49 -0
  98. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +57 -0
  99. data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +5 -13
  100. data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +21 -7
  101. data/sig/growsurf_ruby/models/campaign/referral_source.rbs +4 -1
  102. data/sig/growsurf_ruby/models/campaign/reward.rbs +12 -0
  103. data/sig/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbs +40 -0
  104. data/sig/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbs +61 -0
  105. data/sig/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbs +62 -0
  106. data/sig/growsurf_ruby/models/campaign_list_payouts_params.rbs +2 -1
  107. data/sig/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbs +28 -0
  108. data/sig/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbs +28 -0
  109. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +36 -16
  110. data/sig/growsurf_ruby/models/campaign_review_affiliate_application_params.rbs +79 -0
  111. data/sig/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbs +28 -0
  112. data/sig/growsurf_ruby/models/email_analytics.rbs +92 -0
  113. data/sig/growsurf_ruby/models/participant_payout_list.rbs +12 -4
  114. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +26 -4
  115. data/sig/growsurf_ruby/models.rbs +18 -0
  116. data/sig/growsurf_ruby/resources/campaign/participant.rbs +16 -2
  117. data/sig/growsurf_ruby/resources/campaign.rbs +53 -0
  118. metadata +54 -3
@@ -0,0 +1,431 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class AffiliateApplication < GrowsurfRuby::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ GrowsurfRuby::AffiliateApplication,
10
+ GrowsurfRuby::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The applicant's answers to the saved application form.
15
+ sig do
16
+ returns(T::Array[GrowsurfRuby::AffiliateApplication::Answer])
17
+ end
18
+ attr_reader :answers
19
+
20
+ sig do
21
+ params(
22
+ answers: T::Array[GrowsurfRuby::AffiliateApplication::Answer::OrHash]
23
+ ).void
24
+ end
25
+ attr_writer :answers
26
+
27
+ # When the application was submitted, in Unix milliseconds.
28
+ sig { returns(Integer) }
29
+ attr_reader :created_at
30
+
31
+ sig { params(created_at: Integer).void }
32
+ attr_writer :created_at
33
+
34
+ # When the decision was made, in Unix milliseconds. `null` while pending.
35
+ sig { returns(T.nilable(Integer)) }
36
+ attr_accessor :decided_at
37
+
38
+ # Required applicant email address, or `null` after applicant data is removed
39
+ # under the Program's retention policy.
40
+ sig { returns(T.nilable(String)) }
41
+ attr_accessor :email
42
+
43
+ # Required applicant first name, or `null` after applicant data is removed under
44
+ # the Program's retention policy.
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :first_name
47
+
48
+ sig { params(first_name: T.nilable(String)).void }
49
+ attr_writer :first_name
50
+
51
+ # Application ID.
52
+ sig { returns(String) }
53
+ attr_reader :id
54
+
55
+ sig { params(id: String).void }
56
+ attr_writer :id
57
+
58
+ # Required applicant last name, or `null` after applicant data is removed under
59
+ # the Program's retention policy.
60
+ sig { returns(T.nilable(String)) }
61
+ attr_reader :last_name
62
+
63
+ sig { params(last_name: T.nilable(String)).void }
64
+ attr_writer :last_name
65
+
66
+ # ID of the participant created or upgraded by approval. `null` until the
67
+ # application is approved.
68
+ sig { returns(T.nilable(String)) }
69
+ attr_accessor :participant_id
70
+
71
+ # When a denied applicant may apply again, in Unix milliseconds. `null` when not
72
+ # applicable.
73
+ sig { returns(T.nilable(Integer)) }
74
+ attr_accessor :reapply_allowed_at
75
+
76
+ # The structured reason recorded when the application was denied. `null` until
77
+ # then.
78
+ sig { returns(T.nilable(String)) }
79
+ attr_accessor :rejection_reason
80
+
81
+ # When the application was reviewed, in Unix milliseconds. `null` while pending.
82
+ sig { returns(T.nilable(Integer)) }
83
+ attr_accessor :reviewed_at
84
+
85
+ # GrowSurf risk assessment. Applications that are not `LOW` risk are held for
86
+ # manual review; `null` means no assessment was recorded.
87
+ sig do
88
+ returns(
89
+ T.nilable(
90
+ GrowsurfRuby::AffiliateApplication::RiskLevel::TaggedSymbol
91
+ )
92
+ )
93
+ end
94
+ attr_reader :risk_level
95
+
96
+ sig do
97
+ params(
98
+ risk_level:
99
+ T.nilable(GrowsurfRuby::AffiliateApplication::RiskLevel::OrSymbol)
100
+ ).void
101
+ end
102
+ attr_writer :risk_level
103
+
104
+ # Where the application is in review. Only `PENDING` applications can be decided.
105
+ sig do
106
+ returns(
107
+ GrowsurfRuby::AffiliateApplication::Status::TaggedSymbol
108
+ )
109
+ end
110
+ attr_reader :status
111
+
112
+ sig do
113
+ params(
114
+ status: GrowsurfRuby::AffiliateApplication::Status::OrSymbol
115
+ ).void
116
+ end
117
+ attr_writer :status
118
+
119
+ # When the applicant accepted the Program Terms, in Unix milliseconds, or `null`
120
+ # when acceptance was not required.
121
+ sig { returns(T.nilable(Integer)) }
122
+ attr_reader :terms_accepted_at
123
+
124
+ sig { params(terms_accepted_at: T.nilable(Integer)).void }
125
+ attr_writer :terms_accepted_at
126
+
127
+ sig do
128
+ params(
129
+ answers: T::Array[GrowsurfRuby::AffiliateApplication::Answer::OrHash],
130
+ created_at: Integer,
131
+ decided_at: T.nilable(Integer),
132
+ email: T.nilable(String),
133
+ first_name: T.nilable(String),
134
+ id: String,
135
+ last_name: T.nilable(String),
136
+ participant_id: T.nilable(String),
137
+ reapply_allowed_at: T.nilable(Integer),
138
+ rejection_reason: T.nilable(String),
139
+ reviewed_at: T.nilable(Integer),
140
+ risk_level:
141
+ T.nilable(GrowsurfRuby::AffiliateApplication::RiskLevel::OrSymbol),
142
+ status: GrowsurfRuby::AffiliateApplication::Status::OrSymbol,
143
+ terms_accepted_at: T.nilable(Integer)
144
+ ).returns(T.attached_class)
145
+ end
146
+ def self.new(
147
+ # The applicant's answers to the saved application form.
148
+ answers:,
149
+ # When the application was submitted, in Unix milliseconds.
150
+ created_at:,
151
+ # When the decision was made, in Unix milliseconds. `null` while pending.
152
+ decided_at:,
153
+ # Required applicant email address, or `null` after applicant data is removed
154
+ # under the Program's retention policy.
155
+ email:,
156
+ # Required applicant first name, or `null` after applicant data is removed under
157
+ # the Program's retention policy.
158
+ first_name:,
159
+ # Application ID.
160
+ id:,
161
+ # Required applicant last name, or `null` after applicant data is removed under
162
+ # the Program's retention policy.
163
+ last_name:,
164
+ # ID of the participant created or upgraded by approval. `null` until the
165
+ # application is approved.
166
+ participant_id:,
167
+ # When a denied applicant may apply again, in Unix milliseconds. `null` when not
168
+ # applicable.
169
+ reapply_allowed_at:,
170
+ # The structured reason recorded when the application was denied. `null` until
171
+ # then.
172
+ rejection_reason:,
173
+ # When the application was reviewed, in Unix milliseconds. `null` while pending.
174
+ reviewed_at:,
175
+ # GrowSurf risk assessment. Applications that are not `LOW` risk are held for
176
+ # manual review; `null` means no assessment was recorded.
177
+ risk_level:,
178
+ # Where the application is in review. Only `PENDING` applications can be decided.
179
+ status:,
180
+ # When the applicant accepted the Program Terms, in Unix milliseconds, or `null`
181
+ # when acceptance was not required.
182
+ terms_accepted_at:
183
+ )
184
+ end
185
+
186
+ sig do
187
+ override.returns(
188
+ {
189
+ answers: T::Array[GrowsurfRuby::AffiliateApplication::Answer],
190
+ created_at: Integer,
191
+ decided_at: T.nilable(Integer),
192
+ email: T.nilable(String),
193
+ first_name: T.nilable(String),
194
+ id: String,
195
+ last_name: T.nilable(String),
196
+ participant_id: T.nilable(String),
197
+ reapply_allowed_at: T.nilable(Integer),
198
+ rejection_reason: T.nilable(String),
199
+ reviewed_at: T.nilable(Integer),
200
+ risk_level:
201
+ T.nilable(
202
+ GrowsurfRuby::AffiliateApplication::RiskLevel::TaggedSymbol
203
+ ),
204
+ status:
205
+ GrowsurfRuby::AffiliateApplication::Status::TaggedSymbol,
206
+ terms_accepted_at: T.nilable(Integer)
207
+ }
208
+ )
209
+ end
210
+ def to_hash
211
+ end
212
+
213
+ class Answer < GrowsurfRuby::Internal::Type::BaseModel
214
+ OrHash =
215
+ T.type_alias do
216
+ T.any(
217
+ GrowsurfRuby::AffiliateApplication::Answer,
218
+ GrowsurfRuby::Internal::AnyHash
219
+ )
220
+ end
221
+
222
+ # Stable key of the saved application-form field this answer belongs to.
223
+ sig { returns(String) }
224
+ attr_reader :field_id
225
+
226
+ sig { params(field_id: String).void }
227
+ attr_writer :field_id
228
+
229
+ # Customer-configured field label captured when the applicant submitted.
230
+ sig { returns(String) }
231
+ attr_reader :label
232
+
233
+ sig { params(label: String).void }
234
+ attr_writer :label
235
+
236
+ # Saved field type that determined how the scalar answer was validated.
237
+ sig do
238
+ returns(
239
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
240
+ )
241
+ end
242
+ attr_reader :type
243
+
244
+ sig do
245
+ params(
246
+ type: GrowsurfRuby::AffiliateApplication::Answer::Type::OrSymbol
247
+ ).void
248
+ end
249
+ attr_writer :type
250
+
251
+ # Applicant answer represented as one validated string, number, or boolean.
252
+ sig { returns(T.any(String, Integer, Float, T::Boolean)) }
253
+ attr_reader :value
254
+
255
+ sig { params(value: T.any(String, Integer, Float, T::Boolean)).void }
256
+ attr_writer :value
257
+
258
+ sig do
259
+ params(
260
+ field_id: String,
261
+ label: String,
262
+ type: GrowsurfRuby::AffiliateApplication::Answer::Type::OrSymbol,
263
+ value: T.any(String, Integer, Float, T::Boolean)
264
+ ).returns(T.attached_class)
265
+ end
266
+ def self.new(
267
+ # Stable key of the saved application-form field this answer belongs to.
268
+ field_id:,
269
+ # Customer-configured field label captured when the applicant submitted.
270
+ label:,
271
+ # Saved field type that determined how the scalar answer was validated.
272
+ type:,
273
+ # Applicant answer represented as one validated string, number, or boolean.
274
+ value:
275
+ )
276
+ end
277
+
278
+ sig do
279
+ override.returns(
280
+ {
281
+ field_id: String,
282
+ label: String,
283
+ type:
284
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol,
285
+ value: T.any(String, Integer, Float, T::Boolean)
286
+ }
287
+ )
288
+ end
289
+ def to_hash
290
+ end
291
+
292
+ module Type
293
+ extend GrowsurfRuby::Internal::Type::Enum
294
+
295
+ TaggedSymbol =
296
+ T.type_alias do
297
+ T.all(
298
+ Symbol,
299
+ GrowsurfRuby::AffiliateApplication::Answer::Type
300
+ )
301
+ end
302
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
303
+
304
+ TEXT =
305
+ T.let(
306
+ :text,
307
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
308
+ )
309
+ TEXTAREA =
310
+ T.let(
311
+ :textarea,
312
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
313
+ )
314
+ URL =
315
+ T.let(
316
+ :url,
317
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
318
+ )
319
+ COUNTRY =
320
+ T.let(
321
+ :country,
322
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
323
+ )
324
+ NUMBER =
325
+ T.let(
326
+ :number,
327
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
328
+ )
329
+ DROPDOWN =
330
+ T.let(
331
+ :dropdown,
332
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
333
+ )
334
+ RADIO =
335
+ T.let(
336
+ :radio,
337
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
338
+ )
339
+ CHECKBOX =
340
+ T.let(
341
+ :checkbox,
342
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
343
+ )
344
+
345
+ sig do
346
+ returns(
347
+ T::Array[
348
+ GrowsurfRuby::AffiliateApplication::Answer::Type::TaggedSymbol
349
+ ]
350
+ )
351
+ end
352
+ def self.values
353
+ end
354
+ end
355
+ end
356
+
357
+ # GrowSurf risk assessment. Applications that are not `LOW` risk are held for
358
+ # manual review; `null` means no assessment was recorded.
359
+ module RiskLevel
360
+ extend GrowsurfRuby::Internal::Type::Enum
361
+
362
+ TaggedSymbol =
363
+ T.type_alias do
364
+ T.all(Symbol, GrowsurfRuby::AffiliateApplication::RiskLevel)
365
+ end
366
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
367
+
368
+ LOW =
369
+ T.let(
370
+ :LOW,
371
+ GrowsurfRuby::AffiliateApplication::RiskLevel::TaggedSymbol
372
+ )
373
+ MEDIUM =
374
+ T.let(
375
+ :MEDIUM,
376
+ GrowsurfRuby::AffiliateApplication::RiskLevel::TaggedSymbol
377
+ )
378
+ HIGH =
379
+ T.let(
380
+ :HIGH,
381
+ GrowsurfRuby::AffiliateApplication::RiskLevel::TaggedSymbol
382
+ )
383
+
384
+ sig do
385
+ override.returns(
386
+ T::Array[
387
+ GrowsurfRuby::AffiliateApplication::RiskLevel::TaggedSymbol
388
+ ]
389
+ )
390
+ end
391
+ def self.values
392
+ end
393
+ end
394
+
395
+ # Where the application is in review. Only `PENDING` applications can be decided.
396
+ module Status
397
+ extend GrowsurfRuby::Internal::Type::Enum
398
+
399
+ TaggedSymbol =
400
+ T.type_alias do
401
+ T.all(Symbol, GrowsurfRuby::AffiliateApplication::Status)
402
+ end
403
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
404
+
405
+ PENDING =
406
+ T.let(
407
+ :PENDING,
408
+ GrowsurfRuby::AffiliateApplication::Status::TaggedSymbol
409
+ )
410
+ APPROVED =
411
+ T.let(
412
+ :APPROVED,
413
+ GrowsurfRuby::AffiliateApplication::Status::TaggedSymbol
414
+ )
415
+ DENIED =
416
+ T.let(
417
+ :DENIED,
418
+ GrowsurfRuby::AffiliateApplication::Status::TaggedSymbol
419
+ )
420
+
421
+ sig do
422
+ override.returns(
423
+ T::Array[GrowsurfRuby::AffiliateApplication::Status::TaggedSymbol]
424
+ )
425
+ end
426
+ def self.values
427
+ end
428
+ end
429
+ end
430
+ end
431
+ end
@@ -0,0 +1,70 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class AffiliateApplicationListResponse < GrowsurfRuby::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ GrowsurfRuby::Models::AffiliateApplicationListResponse,
10
+ GrowsurfRuby::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # One page of the program's applications, newest first.
15
+ sig { returns(T::Array[GrowsurfRuby::AffiliateApplication]) }
16
+ attr_accessor :applications
17
+
18
+ # Total number of applications matching the filter.
19
+ sig { returns(Integer) }
20
+ attr_accessor :total
21
+
22
+ # The page size used.
23
+ sig { returns(T.nilable(Integer)) }
24
+ attr_reader :limit
25
+
26
+ sig { params(limit: Integer).void }
27
+ attr_writer :limit
28
+
29
+ # The offset this page started at.
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_reader :offset
32
+
33
+ sig { params(offset: Integer).void }
34
+ attr_writer :offset
35
+
36
+ sig do
37
+ params(
38
+ applications: T::Array[GrowsurfRuby::AffiliateApplication::OrHash],
39
+ total: Integer,
40
+ limit: Integer,
41
+ offset: Integer
42
+ ).returns(T.attached_class)
43
+ end
44
+ def self.new(
45
+ # One page of the program's applications, newest first.
46
+ applications:,
47
+ # Total number of applications matching the filter.
48
+ total:,
49
+ # The page size used.
50
+ limit: nil,
51
+ # The offset this page started at.
52
+ offset: nil
53
+ )
54
+ end
55
+
56
+ sig do
57
+ override.returns(
58
+ {
59
+ applications: T::Array[GrowsurfRuby::AffiliateApplication],
60
+ total: Integer,
61
+ limit: Integer,
62
+ offset: Integer
63
+ }
64
+ )
65
+ end
66
+ def to_hash
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,167 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class AffiliateInvite < GrowsurfRuby::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(GrowsurfRuby::AffiliateInvite, GrowsurfRuby::Internal::AnyHash)
9
+ end
10
+
11
+ # When the invite was accepted, in Unix milliseconds. `null` until accepted.
12
+ sig { returns(T.nilable(Integer)) }
13
+ attr_accessor :accepted_at
14
+
15
+ # When the invite was created, in Unix milliseconds.
16
+ sig { returns(T.nilable(Integer)) }
17
+ attr_reader :created_at
18
+
19
+ sig { params(created_at: Integer).void }
20
+ attr_writer :created_at
21
+
22
+ # Invitee email address.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :email
25
+
26
+ sig { params(email: String).void }
27
+ attr_writer :email
28
+
29
+ # When the emailed accept link stops working, in Unix milliseconds.
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_reader :expires_at
32
+
33
+ sig { params(expires_at: Integer).void }
34
+ attr_writer :expires_at
35
+
36
+ # Invitee first name, when provided.
37
+ sig { returns(T.nilable(String)) }
38
+ attr_reader :first_name
39
+
40
+ sig { params(first_name: T.nilable(String)).void }
41
+ attr_writer :first_name
42
+
43
+ # Invite ID.
44
+ sig { returns(T.nilable(String)) }
45
+ attr_reader :id
46
+
47
+ sig { params(id: String).void }
48
+ attr_writer :id
49
+
50
+ # Invitee last name, when provided.
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :last_name
53
+
54
+ sig { params(last_name: T.nilable(String)).void }
55
+ attr_writer :last_name
56
+
57
+ # When the invite email was last sent, in Unix milliseconds.
58
+ sig { returns(T.nilable(Integer)) }
59
+ attr_reader :last_sent_at
60
+
61
+ sig { params(last_sent_at: Integer).void }
62
+ attr_writer :last_sent_at
63
+
64
+ # When the invite was revoked, in Unix milliseconds. `null` unless revoked.
65
+ sig { returns(T.nilable(Integer)) }
66
+ attr_accessor :revoked_at
67
+
68
+ # The invite's lifecycle state. Accepting a pending invite enrolls the invitee as
69
+ # an approved affiliate.
70
+ sig do
71
+ returns(T.nilable(GrowsurfRuby::AffiliateInvite::Status::TaggedSymbol))
72
+ end
73
+ attr_reader :status
74
+
75
+ sig do
76
+ params(status: GrowsurfRuby::AffiliateInvite::Status::OrSymbol).void
77
+ end
78
+ attr_writer :status
79
+
80
+ sig do
81
+ params(
82
+ accepted_at: T.nilable(Integer),
83
+ created_at: Integer,
84
+ email: String,
85
+ expires_at: Integer,
86
+ first_name: T.nilable(String),
87
+ id: String,
88
+ last_name: T.nilable(String),
89
+ last_sent_at: Integer,
90
+ revoked_at: T.nilable(Integer),
91
+ status: GrowsurfRuby::AffiliateInvite::Status::OrSymbol
92
+ ).returns(T.attached_class)
93
+ end
94
+ def self.new(
95
+ # When the invite was accepted, in Unix milliseconds. `null` until accepted.
96
+ accepted_at: nil,
97
+ # When the invite was created, in Unix milliseconds.
98
+ created_at: nil,
99
+ # Invitee email address.
100
+ email: nil,
101
+ # When the emailed accept link stops working, in Unix milliseconds.
102
+ expires_at: nil,
103
+ # Invitee first name, when provided.
104
+ first_name: nil,
105
+ # Invite ID.
106
+ id: nil,
107
+ # Invitee last name, when provided.
108
+ last_name: nil,
109
+ # When the invite email was last sent, in Unix milliseconds.
110
+ last_sent_at: nil,
111
+ # When the invite was revoked, in Unix milliseconds. `null` unless revoked.
112
+ revoked_at: nil,
113
+ # The invite's lifecycle state. Accepting a pending invite enrolls the invitee as
114
+ # an approved affiliate.
115
+ status: nil
116
+ )
117
+ end
118
+
119
+ sig do
120
+ override.returns(
121
+ {
122
+ accepted_at: T.nilable(Integer),
123
+ created_at: Integer,
124
+ email: String,
125
+ expires_at: Integer,
126
+ first_name: T.nilable(String),
127
+ id: String,
128
+ last_name: T.nilable(String),
129
+ last_sent_at: Integer,
130
+ revoked_at: T.nilable(Integer),
131
+ status:
132
+ T.nilable(GrowsurfRuby::AffiliateInvite::Status::TaggedSymbol)
133
+ }
134
+ )
135
+ end
136
+ def to_hash
137
+ end
138
+
139
+ # The invite's lifecycle state. Accepting a pending invite enrolls the invitee as
140
+ # an approved affiliate.
141
+ module Status
142
+ extend GrowsurfRuby::Internal::Type::Enum
143
+
144
+ TaggedSymbol =
145
+ T.type_alias { T.all(Symbol, GrowsurfRuby::AffiliateInvite::Status) }
146
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
147
+
148
+ PENDING =
149
+ T.let(:PENDING, GrowsurfRuby::AffiliateInvite::Status::TaggedSymbol)
150
+ ACCEPTED =
151
+ T.let(:ACCEPTED, GrowsurfRuby::AffiliateInvite::Status::TaggedSymbol)
152
+ EXPIRED =
153
+ T.let(:EXPIRED, GrowsurfRuby::AffiliateInvite::Status::TaggedSymbol)
154
+ REVOKED =
155
+ T.let(:REVOKED, GrowsurfRuby::AffiliateInvite::Status::TaggedSymbol)
156
+
157
+ sig do
158
+ override.returns(
159
+ T::Array[GrowsurfRuby::AffiliateInvite::Status::TaggedSymbol]
160
+ )
161
+ end
162
+ def self.values
163
+ end
164
+ end
165
+ end
166
+ end
167
+ end