whop_sdk 0.0.15 → 0.0.16

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +4 -0
  5. data/lib/whop_sdk/models/course.rb +57 -1
  6. data/lib/whop_sdk/models/course_lesson_interaction.rb +23 -1
  7. data/lib/whop_sdk/models/course_lesson_interaction_list_item.rb +23 -1
  8. data/lib/whop_sdk/models/payment_list_fees_params.rb +46 -0
  9. data/lib/whop_sdk/models/payment_list_fees_response.rb +84 -0
  10. data/lib/whop_sdk/models/payment_method_list_response.rb +214 -76
  11. data/lib/whop_sdk/models/payment_method_retrieve_response.rb +214 -76
  12. data/lib/whop_sdk/models/payout_method_list_params.rb +54 -0
  13. data/lib/whop_sdk/models/payout_method_list_response.rb +95 -0
  14. data/lib/whop_sdk/models/withdrawal_create_params.rb +46 -0
  15. data/lib/whop_sdk/models/withdrawal_create_response.rb +275 -0
  16. data/lib/whop_sdk/models.rb +6 -0
  17. data/lib/whop_sdk/resources/payment_methods.rb +2 -2
  18. data/lib/whop_sdk/resources/payments.rb +35 -0
  19. data/lib/whop_sdk/resources/payout_methods.rb +49 -0
  20. data/lib/whop_sdk/resources/withdrawals.rb +34 -0
  21. data/lib/whop_sdk/version.rb +1 -1
  22. data/lib/whop_sdk.rb +7 -0
  23. data/rbi/whop_sdk/client.rbi +3 -0
  24. data/rbi/whop_sdk/models/course.rbi +115 -3
  25. data/rbi/whop_sdk/models/course_lesson_interaction.rbi +55 -2
  26. data/rbi/whop_sdk/models/course_lesson_interaction_list_item.rbi +60 -2
  27. data/rbi/whop_sdk/models/payment_list_fees_params.rbi +67 -0
  28. data/rbi/whop_sdk/models/payment_list_fees_response.rbi +239 -0
  29. data/rbi/whop_sdk/models/payment_method_list_response.rbi +305 -83
  30. data/rbi/whop_sdk/models/payment_method_retrieve_response.rbi +305 -88
  31. data/rbi/whop_sdk/models/payout_method_list_params.rbi +75 -0
  32. data/rbi/whop_sdk/models/payout_method_list_response.rbi +200 -0
  33. data/rbi/whop_sdk/models/withdrawal_create_params.rbi +67 -0
  34. data/rbi/whop_sdk/models/withdrawal_create_response.rbi +564 -0
  35. data/rbi/whop_sdk/models.rbi +6 -0
  36. data/rbi/whop_sdk/resources/payment_methods.rbi +2 -2
  37. data/rbi/whop_sdk/resources/payments.rbi +34 -0
  38. data/rbi/whop_sdk/resources/payout_methods.rbi +46 -0
  39. data/rbi/whop_sdk/resources/withdrawals.rbi +29 -0
  40. data/sig/whop_sdk/client.rbs +2 -0
  41. data/sig/whop_sdk/models/course.rbs +45 -3
  42. data/sig/whop_sdk/models/course_lesson_interaction.rbs +28 -3
  43. data/sig/whop_sdk/models/course_lesson_interaction_list_item.rbs +28 -3
  44. data/sig/whop_sdk/models/payment_list_fees_params.rbs +36 -0
  45. data/sig/whop_sdk/models/payment_list_fees_response.rbs +104 -0
  46. data/sig/whop_sdk/models/payment_method_list_response.rbs +149 -41
  47. data/sig/whop_sdk/models/payment_method_retrieve_response.rbs +149 -41
  48. data/sig/whop_sdk/models/payout_method_list_params.rbs +46 -0
  49. data/sig/whop_sdk/models/payout_method_list_response.rbs +83 -0
  50. data/sig/whop_sdk/models/withdrawal_create_params.rbs +41 -0
  51. data/sig/whop_sdk/models/withdrawal_create_response.rbs +243 -0
  52. data/sig/whop_sdk/models.rbs +6 -0
  53. data/sig/whop_sdk/resources/payment_methods.rbs +2 -2
  54. data/sig/whop_sdk/resources/payments.rbs +9 -0
  55. data/sig/whop_sdk/resources/payout_methods.rbs +16 -0
  56. data/sig/whop_sdk/resources/withdrawals.rbs +8 -0
  57. metadata +23 -2
@@ -2,135 +2,357 @@
2
2
 
3
3
  module WhopSDK
4
4
  module Models
5
- class PaymentMethodListResponse < WhopSDK::Internal::Type::BaseModel
6
- OrHash =
5
+ # A payment method with no additional properties
6
+ module PaymentMethodListResponse
7
+ extend WhopSDK::Internal::Type::Union
8
+
9
+ Variants =
7
10
  T.type_alias do
8
11
  T.any(
9
- WhopSDK::Models::PaymentMethodListResponse,
10
- WhopSDK::Internal::AnyHash
12
+ WhopSDK::Models::PaymentMethodListResponse::BasePaymentMethod,
13
+ WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod,
14
+ WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod
11
15
  )
12
16
  end
13
17
 
14
- # The ID of the payment method
15
- sig { returns(String) }
16
- attr_accessor :id
17
-
18
- # The card data associated with the payment method, if its a debit or credit card.
19
- sig do
20
- returns(T.nilable(WhopSDK::Models::PaymentMethodListResponse::Card))
21
- end
22
- attr_reader :card
18
+ class BasePaymentMethod < WhopSDK::Internal::Type::BaseModel
19
+ OrHash =
20
+ T.type_alias do
21
+ T.any(
22
+ WhopSDK::Models::PaymentMethodListResponse::BasePaymentMethod,
23
+ WhopSDK::Internal::AnyHash
24
+ )
25
+ end
23
26
 
24
- sig do
25
- params(
26
- card:
27
- T.nilable(WhopSDK::Models::PaymentMethodListResponse::Card::OrHash)
28
- ).void
29
- end
30
- attr_writer :card
27
+ # The ID of the payment method
28
+ sig { returns(String) }
29
+ attr_accessor :id
31
30
 
32
- # The date and time the payment method was created
33
- sig { returns(Time) }
34
- attr_accessor :created_at
31
+ # When the payment method was created
32
+ sig { returns(Time) }
33
+ attr_accessor :created_at
35
34
 
36
- # The payment method type of the payment method
37
- sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
38
- attr_accessor :payment_method_type
35
+ # The type of the payment method
36
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
37
+ attr_accessor :payment_method_type
39
38
 
40
- # A stored payment method used to process payments. This could be a credit/debit
41
- # card, bank account, PayPal wallet, etc.
42
- sig do
43
- params(
44
- id: String,
45
- card:
46
- T.nilable(WhopSDK::Models::PaymentMethodListResponse::Card::OrHash),
47
- created_at: Time,
48
- payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
49
- ).returns(T.attached_class)
50
- end
51
- def self.new(
52
- # The ID of the payment method
53
- id:,
54
- # The card data associated with the payment method, if its a debit or credit card.
55
- card:,
56
- # The date and time the payment method was created
57
- created_at:,
58
- # The payment method type of the payment method
59
- payment_method_type:
60
- )
61
- end
39
+ # The typename of this object
40
+ sig { returns(Symbol) }
41
+ attr_accessor :typename
62
42
 
63
- sig do
64
- override.returns(
65
- {
43
+ # A payment method with no additional properties
44
+ sig do
45
+ params(
66
46
  id: String,
67
- card: T.nilable(WhopSDK::Models::PaymentMethodListResponse::Card),
68
47
  created_at: Time,
69
- payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol
70
- }
48
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol,
49
+ typename: Symbol
50
+ ).returns(T.attached_class)
51
+ end
52
+ def self.new(
53
+ # The ID of the payment method
54
+ id:,
55
+ # When the payment method was created
56
+ created_at:,
57
+ # The type of the payment method
58
+ payment_method_type:,
59
+ # The typename of this object
60
+ typename: :BasePaymentMethod
71
61
  )
72
- end
73
- def to_hash
62
+ end
63
+
64
+ sig do
65
+ override.returns(
66
+ {
67
+ id: String,
68
+ created_at: Time,
69
+ payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol,
70
+ typename: Symbol
71
+ }
72
+ )
73
+ end
74
+ def to_hash
75
+ end
74
76
  end
75
77
 
76
- class Card < WhopSDK::Internal::Type::BaseModel
78
+ class CardPaymentMethod < WhopSDK::Internal::Type::BaseModel
77
79
  OrHash =
78
80
  T.type_alias do
79
81
  T.any(
80
- WhopSDK::Models::PaymentMethodListResponse::Card,
82
+ WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod,
81
83
  WhopSDK::Internal::AnyHash
82
84
  )
83
85
  end
84
86
 
85
- # Possible card brands that a payment token can have
86
- sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
87
- attr_accessor :brand
87
+ # The ID of the payment method
88
+ sig { returns(String) }
89
+ attr_accessor :id
90
+
91
+ # The card details associated with this payment method
92
+ sig do
93
+ returns(
94
+ WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod::Card
95
+ )
96
+ end
97
+ attr_reader :card
98
+
99
+ sig do
100
+ params(
101
+ card:
102
+ WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod::Card::OrHash
103
+ ).void
104
+ end
105
+ attr_writer :card
88
106
 
89
- # Card expiration month, like 03 for March.
90
- sig { returns(T.nilable(Integer)) }
91
- attr_accessor :exp_month
107
+ # When the payment method was created
108
+ sig { returns(Time) }
109
+ attr_accessor :created_at
92
110
 
93
- # Card expiration year, like 27 for 2027.
94
- sig { returns(T.nilable(Integer)) }
95
- attr_accessor :exp_year
111
+ # The type of the payment method
112
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
113
+ attr_accessor :payment_method_type
96
114
 
97
- # Last four digits of the card.
98
- sig { returns(T.nilable(String)) }
99
- attr_accessor :last4
115
+ # The typename of this object
116
+ sig { returns(Symbol) }
117
+ attr_accessor :typename
100
118
 
101
- # The card data associated with the payment method, if its a debit or credit card.
119
+ # The card for the payment method
102
120
  sig do
103
121
  params(
104
- brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
105
- exp_month: T.nilable(Integer),
106
- exp_year: T.nilable(Integer),
107
- last4: T.nilable(String)
122
+ id: String,
123
+ card:
124
+ WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod::Card::OrHash,
125
+ created_at: Time,
126
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol,
127
+ typename: Symbol
108
128
  ).returns(T.attached_class)
109
129
  end
110
130
  def self.new(
131
+ # The ID of the payment method
132
+ id:,
133
+ # The card details associated with this payment method
134
+ card:,
135
+ # When the payment method was created
136
+ created_at:,
137
+ # The type of the payment method
138
+ payment_method_type:,
139
+ # The typename of this object
140
+ typename: :CardPaymentMethod
141
+ )
142
+ end
143
+
144
+ sig do
145
+ override.returns(
146
+ {
147
+ id: String,
148
+ card:
149
+ WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod::Card,
150
+ created_at: Time,
151
+ payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol,
152
+ typename: Symbol
153
+ }
154
+ )
155
+ end
156
+ def to_hash
157
+ end
158
+
159
+ class Card < WhopSDK::Internal::Type::BaseModel
160
+ OrHash =
161
+ T.type_alias do
162
+ T.any(
163
+ WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod::Card,
164
+ WhopSDK::Internal::AnyHash
165
+ )
166
+ end
167
+
111
168
  # Possible card brands that a payment token can have
112
- brand:,
169
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
170
+ attr_accessor :brand
171
+
113
172
  # Card expiration month, like 03 for March.
114
- exp_month:,
173
+ sig { returns(T.nilable(Integer)) }
174
+ attr_accessor :exp_month
175
+
115
176
  # Card expiration year, like 27 for 2027.
116
- exp_year:,
177
+ sig { returns(T.nilable(Integer)) }
178
+ attr_accessor :exp_year
179
+
117
180
  # Last four digits of the card.
118
- last4:
181
+ sig { returns(T.nilable(String)) }
182
+ attr_accessor :last4
183
+
184
+ # The card details associated with this payment method
185
+ sig do
186
+ params(
187
+ brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
188
+ exp_month: T.nilable(Integer),
189
+ exp_year: T.nilable(Integer),
190
+ last4: T.nilable(String)
191
+ ).returns(T.attached_class)
192
+ end
193
+ def self.new(
194
+ # Possible card brands that a payment token can have
195
+ brand:,
196
+ # Card expiration month, like 03 for March.
197
+ exp_month:,
198
+ # Card expiration year, like 27 for 2027.
199
+ exp_year:,
200
+ # Last four digits of the card.
201
+ last4:
202
+ )
203
+ end
204
+
205
+ sig do
206
+ override.returns(
207
+ {
208
+ brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
209
+ exp_month: T.nilable(Integer),
210
+ exp_year: T.nilable(Integer),
211
+ last4: T.nilable(String)
212
+ }
213
+ )
214
+ end
215
+ def to_hash
216
+ end
217
+ end
218
+ end
219
+
220
+ class UsBankAccountPaymentMethod < WhopSDK::Internal::Type::BaseModel
221
+ OrHash =
222
+ T.type_alias do
223
+ T.any(
224
+ WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod,
225
+ WhopSDK::Internal::AnyHash
226
+ )
227
+ end
228
+
229
+ # The ID of the payment method
230
+ sig { returns(String) }
231
+ attr_accessor :id
232
+
233
+ # When the payment method was created
234
+ sig { returns(Time) }
235
+ attr_accessor :created_at
236
+
237
+ # The type of the payment method
238
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
239
+ attr_accessor :payment_method_type
240
+
241
+ # The typename of this object
242
+ sig { returns(Symbol) }
243
+ attr_accessor :typename
244
+
245
+ # The bank details associated with this payment method
246
+ sig do
247
+ returns(
248
+ WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod::UsBankAccount
249
+ )
250
+ end
251
+ attr_reader :us_bank_account
252
+
253
+ sig do
254
+ params(
255
+ us_bank_account:
256
+ WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod::UsBankAccount::OrHash
257
+ ).void
258
+ end
259
+ attr_writer :us_bank_account
260
+
261
+ # The bank account for the payment method
262
+ sig do
263
+ params(
264
+ id: String,
265
+ created_at: Time,
266
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol,
267
+ us_bank_account:
268
+ WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod::UsBankAccount::OrHash,
269
+ typename: Symbol
270
+ ).returns(T.attached_class)
271
+ end
272
+ def self.new(
273
+ # The ID of the payment method
274
+ id:,
275
+ # When the payment method was created
276
+ created_at:,
277
+ # The type of the payment method
278
+ payment_method_type:,
279
+ # The bank details associated with this payment method
280
+ us_bank_account:,
281
+ # The typename of this object
282
+ typename: :UsBankAccountPaymentMethod
119
283
  )
120
284
  end
121
285
 
122
286
  sig do
123
287
  override.returns(
124
288
  {
125
- brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
126
- exp_month: T.nilable(Integer),
127
- exp_year: T.nilable(Integer),
128
- last4: T.nilable(String)
289
+ id: String,
290
+ created_at: Time,
291
+ payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol,
292
+ typename: Symbol,
293
+ us_bank_account:
294
+ WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod::UsBankAccount
129
295
  }
130
296
  )
131
297
  end
132
298
  def to_hash
133
299
  end
300
+
301
+ class UsBankAccount < WhopSDK::Internal::Type::BaseModel
302
+ OrHash =
303
+ T.type_alias do
304
+ T.any(
305
+ WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod::UsBankAccount,
306
+ WhopSDK::Internal::AnyHash
307
+ )
308
+ end
309
+
310
+ # The type of account
311
+ sig { returns(String) }
312
+ attr_accessor :account_type
313
+
314
+ # The name of the bank
315
+ sig { returns(String) }
316
+ attr_accessor :bank_name
317
+
318
+ # The last 4 digits of the account number
319
+ sig { returns(String) }
320
+ attr_accessor :last4
321
+
322
+ # The bank details associated with this payment method
323
+ sig do
324
+ params(
325
+ account_type: String,
326
+ bank_name: String,
327
+ last4: String
328
+ ).returns(T.attached_class)
329
+ end
330
+ def self.new(
331
+ # The type of account
332
+ account_type:,
333
+ # The name of the bank
334
+ bank_name:,
335
+ # The last 4 digits of the account number
336
+ last4:
337
+ )
338
+ end
339
+
340
+ sig do
341
+ override.returns(
342
+ { account_type: String, bank_name: String, last4: String }
343
+ )
344
+ end
345
+ def to_hash
346
+ end
347
+ end
348
+ end
349
+
350
+ sig do
351
+ override.returns(
352
+ T::Array[WhopSDK::Models::PaymentMethodListResponse::Variants]
353
+ )
354
+ end
355
+ def self.variants
134
356
  end
135
357
  end
136
358
  end