whop_sdk 0.0.7 → 0.0.8

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 (157) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +7 -7
  4. data/lib/whop_sdk/client.rb +8 -0
  5. data/lib/whop_sdk/internal/type/base_model.rb +1 -1
  6. data/lib/whop_sdk/models/app.rb +9 -1
  7. data/lib/whop_sdk/models/app_list_params.rb +9 -1
  8. data/lib/whop_sdk/models/app_list_response.rb +9 -1
  9. data/lib/whop_sdk/models/app_type.rb +18 -0
  10. data/lib/whop_sdk/models/app_update_params.rb +9 -1
  11. data/lib/whop_sdk/models/checkout_configuration.rb +69 -7
  12. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +73 -1
  13. data/lib/whop_sdk/models/checkout_configuration_list_response.rb +69 -7
  14. data/lib/whop_sdk/models/checkout_modes.rb +16 -0
  15. data/lib/whop_sdk/models/course.rb +9 -1
  16. data/lib/whop_sdk/models/course_lesson_list_response.rb +9 -1
  17. data/lib/whop_sdk/models/course_lesson_mark_as_completed_params.rb +14 -0
  18. data/lib/whop_sdk/models/course_lesson_mark_as_completed_response.rb +8 -0
  19. data/lib/whop_sdk/models/course_lesson_start_params.rb +14 -0
  20. data/lib/whop_sdk/models/course_lesson_start_response.rb +8 -0
  21. data/lib/whop_sdk/models/course_lesson_submit_assessment_params.rb +52 -0
  22. data/lib/whop_sdk/models/course_lesson_submit_assessment_response.rb +151 -0
  23. data/lib/whop_sdk/models/course_list_response.rb +9 -1
  24. data/lib/whop_sdk/models/forum_post_create_params.rb +3 -14
  25. data/lib/whop_sdk/models/forum_post_update_params.rb +3 -14
  26. data/lib/whop_sdk/models/forum_post_visibility_type.rb +16 -0
  27. data/lib/whop_sdk/models/lesson.rb +104 -2
  28. data/lib/whop_sdk/models/payment_provider.rb +22 -0
  29. data/lib/whop_sdk/models/refund_created_webhook_event.rb +354 -0
  30. data/lib/whop_sdk/models/refund_list_params.rb +62 -0
  31. data/lib/whop_sdk/models/refund_list_response.rb +113 -0
  32. data/lib/whop_sdk/models/refund_reference_status.rb +17 -0
  33. data/lib/whop_sdk/models/refund_reference_type.rb +17 -0
  34. data/lib/whop_sdk/models/refund_retrieve_params.rb +14 -0
  35. data/lib/whop_sdk/models/refund_retrieve_response.rb +307 -0
  36. data/lib/whop_sdk/models/refund_status.rb +19 -0
  37. data/lib/whop_sdk/models/refund_updated_webhook_event.rb +354 -0
  38. data/lib/whop_sdk/models/unwrap_webhook_event.rb +5 -1
  39. data/lib/whop_sdk/models/withdrawal_fee_types.rb +16 -0
  40. data/lib/whop_sdk/models/withdrawal_list_params.rb +78 -0
  41. data/lib/whop_sdk/models/withdrawal_list_response.rb +87 -0
  42. data/lib/whop_sdk/models/withdrawal_retrieve_params.rb +14 -0
  43. data/lib/whop_sdk/models/withdrawal_retrieve_response.rb +320 -0
  44. data/lib/whop_sdk/models/withdrawal_speeds.rb +16 -0
  45. data/lib/whop_sdk/models/withdrawal_status.rb +21 -0
  46. data/lib/whop_sdk/models/withdrawal_types.rb +16 -0
  47. data/lib/whop_sdk/models.rb +40 -0
  48. data/lib/whop_sdk/resources/apps.rb +6 -2
  49. data/lib/whop_sdk/resources/checkout_configurations.rb +11 -1
  50. data/lib/whop_sdk/resources/course_lessons.rb +64 -0
  51. data/lib/whop_sdk/resources/forum_posts.rb +2 -2
  52. data/lib/whop_sdk/resources/refunds.rb +78 -0
  53. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  54. data/lib/whop_sdk/resources/withdrawals.rb +79 -0
  55. data/lib/whop_sdk/version.rb +1 -1
  56. data/lib/whop_sdk.rb +29 -0
  57. data/rbi/whop_sdk/client.rbi +6 -0
  58. data/rbi/whop_sdk/models/app.rbi +8 -0
  59. data/rbi/whop_sdk/models/app_list_params.rbi +8 -0
  60. data/rbi/whop_sdk/models/app_list_response.rbi +8 -0
  61. data/rbi/whop_sdk/models/app_type.rbi +22 -0
  62. data/rbi/whop_sdk/models/app_update_params.rbi +8 -0
  63. data/rbi/whop_sdk/models/checkout_configuration.rbi +117 -7
  64. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +116 -0
  65. data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +127 -7
  66. data/rbi/whop_sdk/models/checkout_modes.rbi +20 -0
  67. data/rbi/whop_sdk/models/course.rbi +8 -0
  68. data/rbi/whop_sdk/models/course_lesson_list_response.rbi +8 -0
  69. data/rbi/whop_sdk/models/course_lesson_mark_as_completed_params.rbi +30 -0
  70. data/rbi/whop_sdk/models/course_lesson_mark_as_completed_response.rbi +8 -0
  71. data/rbi/whop_sdk/models/course_lesson_start_params.rbi +27 -0
  72. data/rbi/whop_sdk/models/course_lesson_start_response.rbi +8 -0
  73. data/rbi/whop_sdk/models/course_lesson_submit_assessment_params.rbi +104 -0
  74. data/rbi/whop_sdk/models/course_lesson_submit_assessment_response.rbi +222 -0
  75. data/rbi/whop_sdk/models/course_list_response.rbi +8 -0
  76. data/rbi/whop_sdk/models/forum_post_create_params.rbi +3 -37
  77. data/rbi/whop_sdk/models/forum_post_update_params.rbi +3 -37
  78. data/rbi/whop_sdk/models/forum_post_visibility_type.rbi +27 -0
  79. data/rbi/whop_sdk/models/lesson.rbi +115 -3
  80. data/rbi/whop_sdk/models/payment_provider.rbi +27 -0
  81. data/rbi/whop_sdk/models/refund_created_webhook_event.rbi +561 -0
  82. data/rbi/whop_sdk/models/refund_list_params.rbi +83 -0
  83. data/rbi/whop_sdk/models/refund_list_response.rbi +155 -0
  84. data/rbi/whop_sdk/models/refund_reference_status.rbi +26 -0
  85. data/rbi/whop_sdk/models/refund_reference_type.rbi +36 -0
  86. data/rbi/whop_sdk/models/refund_retrieve_params.rbi +27 -0
  87. data/rbi/whop_sdk/models/refund_retrieve_response.rbi +484 -0
  88. data/rbi/whop_sdk/models/refund_status.rbi +24 -0
  89. data/rbi/whop_sdk/models/refund_updated_webhook_event.rbi +561 -0
  90. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -1
  91. data/rbi/whop_sdk/models/withdrawal_fee_types.rbi +22 -0
  92. data/rbi/whop_sdk/models/withdrawal_list_params.rbi +99 -0
  93. data/rbi/whop_sdk/models/withdrawal_list_response.rbi +107 -0
  94. data/rbi/whop_sdk/models/withdrawal_retrieve_params.rbi +27 -0
  95. data/rbi/whop_sdk/models/withdrawal_retrieve_response.rbi +713 -0
  96. data/rbi/whop_sdk/models/withdrawal_speeds.rbi +22 -0
  97. data/rbi/whop_sdk/models/withdrawal_status.rbi +28 -0
  98. data/rbi/whop_sdk/models/withdrawal_types.rbi +20 -0
  99. data/rbi/whop_sdk/models.rbi +42 -0
  100. data/rbi/whop_sdk/resources/apps.rbi +6 -0
  101. data/rbi/whop_sdk/resources/checkout_configurations.rbi +15 -0
  102. data/rbi/whop_sdk/resources/course_lessons.rbi +48 -0
  103. data/rbi/whop_sdk/resources/forum_posts.rbi +2 -4
  104. data/rbi/whop_sdk/resources/refunds.rbi +68 -0
  105. data/rbi/whop_sdk/resources/webhooks.rbi +3 -1
  106. data/rbi/whop_sdk/resources/withdrawals.rbi +71 -0
  107. data/sig/whop_sdk/client.rbs +4 -0
  108. data/sig/whop_sdk/models/app.rbs +5 -0
  109. data/sig/whop_sdk/models/app_list_params.rbs +5 -0
  110. data/sig/whop_sdk/models/app_list_response.rbs +5 -0
  111. data/sig/whop_sdk/models/app_type.rbs +16 -0
  112. data/sig/whop_sdk/models/app_update_params.rbs +5 -0
  113. data/sig/whop_sdk/models/checkout_configuration.rbs +45 -8
  114. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +43 -1
  115. data/sig/whop_sdk/models/checkout_configuration_list_response.rbs +45 -8
  116. data/sig/whop_sdk/models/checkout_modes.rbs +14 -0
  117. data/sig/whop_sdk/models/course.rbs +5 -0
  118. data/sig/whop_sdk/models/course_lesson_list_response.rbs +5 -0
  119. data/sig/whop_sdk/models/course_lesson_mark_as_completed_params.rbs +15 -0
  120. data/sig/whop_sdk/models/course_lesson_mark_as_completed_response.rbs +5 -0
  121. data/sig/whop_sdk/models/course_lesson_start_params.rbs +15 -0
  122. data/sig/whop_sdk/models/course_lesson_start_response.rbs +5 -0
  123. data/sig/whop_sdk/models/course_lesson_submit_assessment_params.rbs +51 -0
  124. data/sig/whop_sdk/models/course_lesson_submit_assessment_response.rbs +96 -0
  125. data/sig/whop_sdk/models/course_list_response.rbs +5 -0
  126. data/sig/whop_sdk/models/forum_post_create_params.rbs +4 -15
  127. data/sig/whop_sdk/models/forum_post_update_params.rbs +4 -15
  128. data/sig/whop_sdk/models/forum_post_visibility_type.rbs +14 -0
  129. data/sig/whop_sdk/models/lesson.rbs +79 -3
  130. data/sig/whop_sdk/models/payment_provider.rbs +28 -0
  131. data/sig/whop_sdk/models/refund_created_webhook_event.rbs +252 -0
  132. data/sig/whop_sdk/models/refund_list_params.rbs +51 -0
  133. data/sig/whop_sdk/models/refund_list_response.rbs +80 -0
  134. data/sig/whop_sdk/models/refund_reference_status.rbs +15 -0
  135. data/sig/whop_sdk/models/refund_reference_type.rbs +18 -0
  136. data/sig/whop_sdk/models/refund_retrieve_params.rbs +15 -0
  137. data/sig/whop_sdk/models/refund_retrieve_response.rbs +215 -0
  138. data/sig/whop_sdk/models/refund_status.rbs +18 -0
  139. data/sig/whop_sdk/models/refund_updated_webhook_event.rbs +252 -0
  140. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +2 -0
  141. data/sig/whop_sdk/models/withdrawal_fee_types.rbs +14 -0
  142. data/sig/whop_sdk/models/withdrawal_list_params.rbs +61 -0
  143. data/sig/whop_sdk/models/withdrawal_list_response.rbs +60 -0
  144. data/sig/whop_sdk/models/withdrawal_retrieve_params.rbs +15 -0
  145. data/sig/whop_sdk/models/withdrawal_retrieve_response.rbs +297 -0
  146. data/sig/whop_sdk/models/withdrawal_speeds.rbs +14 -0
  147. data/sig/whop_sdk/models/withdrawal_status.rbs +26 -0
  148. data/sig/whop_sdk/models/withdrawal_types.rbs +14 -0
  149. data/sig/whop_sdk/models.rbs +40 -0
  150. data/sig/whop_sdk/resources/apps.rbs +2 -0
  151. data/sig/whop_sdk/resources/checkout_configurations.rbs +3 -0
  152. data/sig/whop_sdk/resources/course_lessons.rbs +16 -0
  153. data/sig/whop_sdk/resources/forum_posts.rbs +2 -2
  154. data/sig/whop_sdk/resources/refunds.rbs +22 -0
  155. data/sig/whop_sdk/resources/webhooks.rbs +3 -1
  156. data/sig/whop_sdk/resources/withdrawals.rbs +24 -0
  157. metadata +89 -2
@@ -0,0 +1,561 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class RefundUpdatedWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(WhopSDK::RefundUpdatedWebhookEvent, WhopSDK::Internal::AnyHash)
9
+ end
10
+
11
+ # A unique ID for every single webhook request
12
+ sig { returns(String) }
13
+ attr_accessor :id
14
+
15
+ # The API version for this webhook
16
+ sig { returns(Symbol) }
17
+ attr_accessor :api_version
18
+
19
+ # An object representing a refund made on a payment.
20
+ sig { returns(WhopSDK::RefundUpdatedWebhookEvent::Data) }
21
+ attr_reader :data
22
+
23
+ sig do
24
+ params(data: WhopSDK::RefundUpdatedWebhookEvent::Data::OrHash).void
25
+ end
26
+ attr_writer :data
27
+
28
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
29
+ sig { returns(Time) }
30
+ attr_accessor :timestamp
31
+
32
+ # The webhook event type
33
+ sig { returns(Symbol) }
34
+ attr_accessor :type
35
+
36
+ sig do
37
+ params(
38
+ id: String,
39
+ data: WhopSDK::RefundUpdatedWebhookEvent::Data::OrHash,
40
+ timestamp: Time,
41
+ api_version: Symbol,
42
+ type: Symbol
43
+ ).returns(T.attached_class)
44
+ end
45
+ def self.new(
46
+ # A unique ID for every single webhook request
47
+ id:,
48
+ # An object representing a refund made on a payment.
49
+ data:,
50
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
51
+ timestamp:,
52
+ # The API version for this webhook
53
+ api_version: :v1,
54
+ # The webhook event type
55
+ type: :"refund.updated"
56
+ )
57
+ end
58
+
59
+ sig do
60
+ override.returns(
61
+ {
62
+ id: String,
63
+ api_version: Symbol,
64
+ data: WhopSDK::RefundUpdatedWebhookEvent::Data,
65
+ timestamp: Time,
66
+ type: Symbol
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+
73
+ class Data < WhopSDK::Internal::Type::BaseModel
74
+ OrHash =
75
+ T.type_alias do
76
+ T.any(
77
+ WhopSDK::RefundUpdatedWebhookEvent::Data,
78
+ WhopSDK::Internal::AnyHash
79
+ )
80
+ end
81
+
82
+ # The ID of the refund.
83
+ sig { returns(String) }
84
+ attr_accessor :id
85
+
86
+ # The amount of the refund.
87
+ sig { returns(Float) }
88
+ attr_accessor :amount
89
+
90
+ # The time the refund was created.
91
+ sig { returns(Time) }
92
+ attr_accessor :created_at
93
+
94
+ # The currency of the refund.
95
+ sig { returns(WhopSDK::Currency::TaggedSymbol) }
96
+ attr_accessor :currency
97
+
98
+ # The payment associated with the refund.
99
+ sig do
100
+ returns(T.nilable(WhopSDK::RefundUpdatedWebhookEvent::Data::Payment))
101
+ end
102
+ attr_reader :payment
103
+
104
+ sig do
105
+ params(
106
+ payment:
107
+ T.nilable(
108
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::OrHash
109
+ )
110
+ ).void
111
+ end
112
+ attr_writer :payment
113
+
114
+ # The provider of the refund.
115
+ sig { returns(WhopSDK::PaymentProvider::TaggedSymbol) }
116
+ attr_accessor :provider
117
+
118
+ # The time the refund was created by the provider.
119
+ sig { returns(T.nilable(Time)) }
120
+ attr_accessor :provider_created_at
121
+
122
+ # The status of the refund reference.
123
+ sig { returns(T.nilable(WhopSDK::RefundReferenceStatus::TaggedSymbol)) }
124
+ attr_accessor :reference_status
125
+
126
+ # The type of refund reference that was made available by the payment provider.
127
+ sig { returns(T.nilable(WhopSDK::RefundReferenceType::TaggedSymbol)) }
128
+ attr_accessor :reference_type
129
+
130
+ # The value of the reference.
131
+ sig { returns(T.nilable(String)) }
132
+ attr_accessor :reference_value
133
+
134
+ # The status of the refund.
135
+ sig { returns(WhopSDK::RefundStatus::TaggedSymbol) }
136
+ attr_accessor :status
137
+
138
+ # An object representing a refund made on a payment.
139
+ sig do
140
+ params(
141
+ id: String,
142
+ amount: Float,
143
+ created_at: Time,
144
+ currency: WhopSDK::Currency::OrSymbol,
145
+ payment:
146
+ T.nilable(
147
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::OrHash
148
+ ),
149
+ provider: WhopSDK::PaymentProvider::OrSymbol,
150
+ provider_created_at: T.nilable(Time),
151
+ reference_status:
152
+ T.nilable(WhopSDK::RefundReferenceStatus::OrSymbol),
153
+ reference_type: T.nilable(WhopSDK::RefundReferenceType::OrSymbol),
154
+ reference_value: T.nilable(String),
155
+ status: WhopSDK::RefundStatus::OrSymbol
156
+ ).returns(T.attached_class)
157
+ end
158
+ def self.new(
159
+ # The ID of the refund.
160
+ id:,
161
+ # The amount of the refund.
162
+ amount:,
163
+ # The time the refund was created.
164
+ created_at:,
165
+ # The currency of the refund.
166
+ currency:,
167
+ # The payment associated with the refund.
168
+ payment:,
169
+ # The provider of the refund.
170
+ provider:,
171
+ # The time the refund was created by the provider.
172
+ provider_created_at:,
173
+ # The status of the refund reference.
174
+ reference_status:,
175
+ # The type of refund reference that was made available by the payment provider.
176
+ reference_type:,
177
+ # The value of the reference.
178
+ reference_value:,
179
+ # The status of the refund.
180
+ status:
181
+ )
182
+ end
183
+
184
+ sig do
185
+ override.returns(
186
+ {
187
+ id: String,
188
+ amount: Float,
189
+ created_at: Time,
190
+ currency: WhopSDK::Currency::TaggedSymbol,
191
+ payment:
192
+ T.nilable(WhopSDK::RefundUpdatedWebhookEvent::Data::Payment),
193
+ provider: WhopSDK::PaymentProvider::TaggedSymbol,
194
+ provider_created_at: T.nilable(Time),
195
+ reference_status:
196
+ T.nilable(WhopSDK::RefundReferenceStatus::TaggedSymbol),
197
+ reference_type:
198
+ T.nilable(WhopSDK::RefundReferenceType::TaggedSymbol),
199
+ reference_value: T.nilable(String),
200
+ status: WhopSDK::RefundStatus::TaggedSymbol
201
+ }
202
+ )
203
+ end
204
+ def to_hash
205
+ end
206
+
207
+ class Payment < WhopSDK::Internal::Type::BaseModel
208
+ OrHash =
209
+ T.type_alias do
210
+ T.any(
211
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment,
212
+ WhopSDK::Internal::AnyHash
213
+ )
214
+ end
215
+
216
+ # The payment ID
217
+ sig { returns(String) }
218
+ attr_accessor :id
219
+
220
+ # The reason why a specific payment was billed
221
+ sig { returns(T.nilable(WhopSDK::BillingReasons::TaggedSymbol)) }
222
+ attr_accessor :billing_reason
223
+
224
+ # Possible card brands that a payment token can have
225
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
226
+ attr_accessor :card_brand
227
+
228
+ # The last 4 digits of the card used to make the payment.
229
+ sig { returns(T.nilable(String)) }
230
+ attr_accessor :card_last4
231
+
232
+ # The datetime the payment was created
233
+ sig { returns(Time) }
234
+ attr_accessor :created_at
235
+
236
+ # The available currencies on the platform
237
+ sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) }
238
+ attr_accessor :currency
239
+
240
+ # When an alert came in that this transaction will be disputed
241
+ sig { returns(T.nilable(Time)) }
242
+ attr_accessor :dispute_alerted_at
243
+
244
+ # The member attached to this payment.
245
+ sig do
246
+ returns(
247
+ T.nilable(
248
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Member
249
+ )
250
+ )
251
+ end
252
+ attr_reader :member
253
+
254
+ sig do
255
+ params(
256
+ member:
257
+ T.nilable(
258
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Member::OrHash
259
+ )
260
+ ).void
261
+ end
262
+ attr_writer :member
263
+
264
+ # The membership attached to this payment.
265
+ sig do
266
+ returns(
267
+ T.nilable(
268
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Membership
269
+ )
270
+ )
271
+ end
272
+ attr_reader :membership
273
+
274
+ sig do
275
+ params(
276
+ membership:
277
+ T.nilable(
278
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Membership::OrHash
279
+ )
280
+ ).void
281
+ end
282
+ attr_writer :membership
283
+
284
+ # The datetime the payment was paid
285
+ sig { returns(T.nilable(Time)) }
286
+ attr_accessor :paid_at
287
+
288
+ # The different types of payment methods that can be used.
289
+ sig { returns(T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol)) }
290
+ attr_accessor :payment_method_type
291
+
292
+ # The subtotal to show to the creator (excluding buyer fees).
293
+ sig { returns(T.nilable(Float)) }
294
+ attr_accessor :subtotal
295
+
296
+ # The total to show to the creator (excluding buyer fees).
297
+ sig { returns(T.nilable(Float)) }
298
+ attr_accessor :total
299
+
300
+ # The total in USD to show to the creator (excluding buyer fees).
301
+ sig { returns(T.nilable(Float)) }
302
+ attr_accessor :usd_total
303
+
304
+ # The user that made this payment.
305
+ sig do
306
+ returns(
307
+ T.nilable(WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::User)
308
+ )
309
+ end
310
+ attr_reader :user
311
+
312
+ sig do
313
+ params(
314
+ user:
315
+ T.nilable(
316
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::User::OrHash
317
+ )
318
+ ).void
319
+ end
320
+ attr_writer :user
321
+
322
+ # The payment associated with the refund.
323
+ sig do
324
+ params(
325
+ id: String,
326
+ billing_reason: T.nilable(WhopSDK::BillingReasons::OrSymbol),
327
+ card_brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
328
+ card_last4: T.nilable(String),
329
+ created_at: Time,
330
+ currency: T.nilable(WhopSDK::Currency::OrSymbol),
331
+ dispute_alerted_at: T.nilable(Time),
332
+ member:
333
+ T.nilable(
334
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Member::OrHash
335
+ ),
336
+ membership:
337
+ T.nilable(
338
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Membership::OrHash
339
+ ),
340
+ paid_at: T.nilable(Time),
341
+ payment_method_type:
342
+ T.nilable(WhopSDK::PaymentMethodTypes::OrSymbol),
343
+ subtotal: T.nilable(Float),
344
+ total: T.nilable(Float),
345
+ usd_total: T.nilable(Float),
346
+ user:
347
+ T.nilable(
348
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::User::OrHash
349
+ )
350
+ ).returns(T.attached_class)
351
+ end
352
+ def self.new(
353
+ # The payment ID
354
+ id:,
355
+ # The reason why a specific payment was billed
356
+ billing_reason:,
357
+ # Possible card brands that a payment token can have
358
+ card_brand:,
359
+ # The last 4 digits of the card used to make the payment.
360
+ card_last4:,
361
+ # The datetime the payment was created
362
+ created_at:,
363
+ # The available currencies on the platform
364
+ currency:,
365
+ # When an alert came in that this transaction will be disputed
366
+ dispute_alerted_at:,
367
+ # The member attached to this payment.
368
+ member:,
369
+ # The membership attached to this payment.
370
+ membership:,
371
+ # The datetime the payment was paid
372
+ paid_at:,
373
+ # The different types of payment methods that can be used.
374
+ payment_method_type:,
375
+ # The subtotal to show to the creator (excluding buyer fees).
376
+ subtotal:,
377
+ # The total to show to the creator (excluding buyer fees).
378
+ total:,
379
+ # The total in USD to show to the creator (excluding buyer fees).
380
+ usd_total:,
381
+ # The user that made this payment.
382
+ user:
383
+ )
384
+ end
385
+
386
+ sig do
387
+ override.returns(
388
+ {
389
+ id: String,
390
+ billing_reason:
391
+ T.nilable(WhopSDK::BillingReasons::TaggedSymbol),
392
+ card_brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
393
+ card_last4: T.nilable(String),
394
+ created_at: Time,
395
+ currency: T.nilable(WhopSDK::Currency::TaggedSymbol),
396
+ dispute_alerted_at: T.nilable(Time),
397
+ member:
398
+ T.nilable(
399
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Member
400
+ ),
401
+ membership:
402
+ T.nilable(
403
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Membership
404
+ ),
405
+ paid_at: T.nilable(Time),
406
+ payment_method_type:
407
+ T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol),
408
+ subtotal: T.nilable(Float),
409
+ total: T.nilable(Float),
410
+ usd_total: T.nilable(Float),
411
+ user:
412
+ T.nilable(
413
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::User
414
+ )
415
+ }
416
+ )
417
+ end
418
+ def to_hash
419
+ end
420
+
421
+ class Member < WhopSDK::Internal::Type::BaseModel
422
+ OrHash =
423
+ T.type_alias do
424
+ T.any(
425
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Member,
426
+ WhopSDK::Internal::AnyHash
427
+ )
428
+ end
429
+
430
+ # The ID of the member
431
+ sig { returns(String) }
432
+ attr_accessor :id
433
+
434
+ # The phone number for the member, if available.
435
+ sig { returns(T.nilable(String)) }
436
+ attr_accessor :phone
437
+
438
+ # The member attached to this payment.
439
+ sig do
440
+ params(id: String, phone: T.nilable(String)).returns(
441
+ T.attached_class
442
+ )
443
+ end
444
+ def self.new(
445
+ # The ID of the member
446
+ id:,
447
+ # The phone number for the member, if available.
448
+ phone:
449
+ )
450
+ end
451
+
452
+ sig { override.returns({ id: String, phone: T.nilable(String) }) }
453
+ def to_hash
454
+ end
455
+ end
456
+
457
+ class Membership < WhopSDK::Internal::Type::BaseModel
458
+ OrHash =
459
+ T.type_alias do
460
+ T.any(
461
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::Membership,
462
+ WhopSDK::Internal::AnyHash
463
+ )
464
+ end
465
+
466
+ # The internal ID of the membership.
467
+ sig { returns(String) }
468
+ attr_accessor :id
469
+
470
+ # The state of the membership.
471
+ sig { returns(WhopSDK::MembershipStatus::TaggedSymbol) }
472
+ attr_accessor :status
473
+
474
+ # The membership attached to this payment.
475
+ sig do
476
+ params(
477
+ id: String,
478
+ status: WhopSDK::MembershipStatus::OrSymbol
479
+ ).returns(T.attached_class)
480
+ end
481
+ def self.new(
482
+ # The internal ID of the membership.
483
+ id:,
484
+ # The state of the membership.
485
+ status:
486
+ )
487
+ end
488
+
489
+ sig do
490
+ override.returns(
491
+ { id: String, status: WhopSDK::MembershipStatus::TaggedSymbol }
492
+ )
493
+ end
494
+ def to_hash
495
+ end
496
+ end
497
+
498
+ class User < WhopSDK::Internal::Type::BaseModel
499
+ OrHash =
500
+ T.type_alias do
501
+ T.any(
502
+ WhopSDK::RefundUpdatedWebhookEvent::Data::Payment::User,
503
+ WhopSDK::Internal::AnyHash
504
+ )
505
+ end
506
+
507
+ # The internal ID of the user.
508
+ sig { returns(String) }
509
+ attr_accessor :id
510
+
511
+ # The email of the user
512
+ sig { returns(T.nilable(String)) }
513
+ attr_accessor :email
514
+
515
+ # The name of the user from their Whop account.
516
+ sig { returns(T.nilable(String)) }
517
+ attr_accessor :name
518
+
519
+ # The username of the user from their Whop account.
520
+ sig { returns(String) }
521
+ attr_accessor :username
522
+
523
+ # The user that made this payment.
524
+ sig do
525
+ params(
526
+ id: String,
527
+ email: T.nilable(String),
528
+ name: T.nilable(String),
529
+ username: String
530
+ ).returns(T.attached_class)
531
+ end
532
+ def self.new(
533
+ # The internal ID of the user.
534
+ id:,
535
+ # The email of the user
536
+ email:,
537
+ # The name of the user from their Whop account.
538
+ name:,
539
+ # The username of the user from their Whop account.
540
+ username:
541
+ )
542
+ end
543
+
544
+ sig do
545
+ override.returns(
546
+ {
547
+ id: String,
548
+ email: T.nilable(String),
549
+ name: T.nilable(String),
550
+ username: String
551
+ }
552
+ )
553
+ end
554
+ def to_hash
555
+ end
556
+ end
557
+ end
558
+ end
559
+ end
560
+ end
561
+ end
@@ -23,7 +23,9 @@ module WhopSDK
23
23
  WhopSDK::PaymentFailedWebhookEvent,
24
24
  WhopSDK::PaymentPendingWebhookEvent,
25
25
  WhopSDK::DisputeCreatedWebhookEvent,
26
- WhopSDK::DisputeUpdatedWebhookEvent
26
+ WhopSDK::DisputeUpdatedWebhookEvent,
27
+ WhopSDK::RefundCreatedWebhookEvent,
28
+ WhopSDK::RefundUpdatedWebhookEvent
27
29
  )
28
30
  end
29
31
 
@@ -0,0 +1,22 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # The different fee types for a withdrawal.
6
+ module WithdrawalFeeTypes
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::WithdrawalFeeTypes) }
10
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11
+
12
+ EXCLUSIVE = T.let(:exclusive, WhopSDK::WithdrawalFeeTypes::TaggedSymbol)
13
+ INCLUSIVE = T.let(:inclusive, WhopSDK::WithdrawalFeeTypes::TaggedSymbol)
14
+
15
+ sig do
16
+ override.returns(T::Array[WhopSDK::WithdrawalFeeTypes::TaggedSymbol])
17
+ end
18
+ def self.values
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,99 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class WithdrawalListParams < WhopSDK::Internal::Type::BaseModel
6
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
7
+ include WhopSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(WhopSDK::WithdrawalListParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The ID of the company to list withdrawals for
15
+ sig { returns(String) }
16
+ attr_accessor :company_id
17
+
18
+ # Returns the elements in the list that come after the specified cursor.
19
+ sig { returns(T.nilable(String)) }
20
+ attr_accessor :after
21
+
22
+ # Returns the elements in the list that come before the specified cursor.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :before
25
+
26
+ # The minimum creation date to filter by
27
+ sig { returns(T.nilable(Time)) }
28
+ attr_accessor :created_after
29
+
30
+ # The maximum creation date to filter by
31
+ sig { returns(T.nilable(Time)) }
32
+ attr_accessor :created_before
33
+
34
+ # The direction of the sort.
35
+ sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) }
36
+ attr_accessor :direction
37
+
38
+ # Returns the first _n_ elements from the list.
39
+ sig { returns(T.nilable(Integer)) }
40
+ attr_accessor :first
41
+
42
+ # Returns the last _n_ elements from the list.
43
+ sig { returns(T.nilable(Integer)) }
44
+ attr_accessor :last
45
+
46
+ sig do
47
+ params(
48
+ company_id: String,
49
+ after: T.nilable(String),
50
+ before: T.nilable(String),
51
+ created_after: T.nilable(Time),
52
+ created_before: T.nilable(Time),
53
+ direction: T.nilable(WhopSDK::Direction::OrSymbol),
54
+ first: T.nilable(Integer),
55
+ last: T.nilable(Integer),
56
+ request_options: WhopSDK::RequestOptions::OrHash
57
+ ).returns(T.attached_class)
58
+ end
59
+ def self.new(
60
+ # The ID of the company to list withdrawals for
61
+ company_id:,
62
+ # Returns the elements in the list that come after the specified cursor.
63
+ after: nil,
64
+ # Returns the elements in the list that come before the specified cursor.
65
+ before: nil,
66
+ # The minimum creation date to filter by
67
+ created_after: nil,
68
+ # The maximum creation date to filter by
69
+ created_before: nil,
70
+ # The direction of the sort.
71
+ direction: nil,
72
+ # Returns the first _n_ elements from the list.
73
+ first: nil,
74
+ # Returns the last _n_ elements from the list.
75
+ last: nil,
76
+ request_options: {}
77
+ )
78
+ end
79
+
80
+ sig do
81
+ override.returns(
82
+ {
83
+ company_id: String,
84
+ after: T.nilable(String),
85
+ before: T.nilable(String),
86
+ created_after: T.nilable(Time),
87
+ created_before: T.nilable(Time),
88
+ direction: T.nilable(WhopSDK::Direction::OrSymbol),
89
+ first: T.nilable(Integer),
90
+ last: T.nilable(Integer),
91
+ request_options: WhopSDK::RequestOptions
92
+ }
93
+ )
94
+ end
95
+ def to_hash
96
+ end
97
+ end
98
+ end
99
+ end