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
@@ -0,0 +1,275 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Withdrawals#create
6
+ class WithdrawalCreateResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # Internal ID of the withdrawal request.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute amount
14
+ # How much money was attempted to be withdrawn, in a float type.
15
+ #
16
+ # @return [Float]
17
+ required :amount, Float
18
+
19
+ # @!attribute created_at
20
+ # When the withdrawal request was created.
21
+ #
22
+ # @return [Time]
23
+ required :created_at, Time
24
+
25
+ # @!attribute currency
26
+ # The currency of the withdrawal request.
27
+ #
28
+ # @return [Symbol, WhopSDK::Models::Currency]
29
+ required :currency, enum: -> { WhopSDK::Currency }
30
+
31
+ # @!attribute error_code
32
+ # The different error codes a payout can be in.
33
+ #
34
+ # @return [Symbol, WhopSDK::Models::WithdrawalCreateResponse::ErrorCode, nil]
35
+ required :error_code, enum: -> { WhopSDK::Models::WithdrawalCreateResponse::ErrorCode }, nil?: true
36
+
37
+ # @!attribute error_message
38
+ # The error message for the withdrawal, if any.
39
+ #
40
+ # @return [String, nil]
41
+ required :error_message, String, nil?: true
42
+
43
+ # @!attribute estimated_availability
44
+ # The estimated availability date for the withdrawal, if any.
45
+ #
46
+ # @return [Time, nil]
47
+ required :estimated_availability, Time, nil?: true
48
+
49
+ # @!attribute fee_amount
50
+ # The fee amount that was charged for the withdrawal. This is in the same currency
51
+ # as the withdrawal amount.
52
+ #
53
+ # @return [Float]
54
+ required :fee_amount, Float
55
+
56
+ # @!attribute fee_type
57
+ # The different fee types for a withdrawal.
58
+ #
59
+ # @return [Symbol, WhopSDK::Models::WithdrawalFeeTypes, nil]
60
+ required :fee_type, enum: -> { WhopSDK::WithdrawalFeeTypes }, nil?: true
61
+
62
+ # @!attribute ledger_account
63
+ # The ledger account associated with the withdrawal.
64
+ #
65
+ # @return [WhopSDK::Models::WithdrawalCreateResponse::LedgerAccount]
66
+ required :ledger_account, -> { WhopSDK::Models::WithdrawalCreateResponse::LedgerAccount }
67
+
68
+ # @!attribute markup_fee
69
+ # The markup fee that was charged for the withdrawal. This is in the same currency
70
+ # as the withdrawal amount. This only applies to platform accounts using Whop
71
+ # Rails.
72
+ #
73
+ # @return [Float]
74
+ required :markup_fee, Float
75
+
76
+ # @!attribute payout_token
77
+ # The payout token used for the withdrawal, if applicable.
78
+ #
79
+ # @return [WhopSDK::Models::WithdrawalCreateResponse::PayoutToken, nil]
80
+ required :payout_token, -> { WhopSDK::Models::WithdrawalCreateResponse::PayoutToken }, nil?: true
81
+
82
+ # @!attribute speed
83
+ # The speed of the withdrawal.
84
+ #
85
+ # @return [Symbol, WhopSDK::Models::WithdrawalSpeeds]
86
+ required :speed, enum: -> { WhopSDK::WithdrawalSpeeds }
87
+
88
+ # @!attribute status
89
+ # Status of the withdrawal.
90
+ #
91
+ # @return [Symbol, WhopSDK::Models::WithdrawalStatus]
92
+ required :status, enum: -> { WhopSDK::WithdrawalStatus }
93
+
94
+ # @!attribute trace_code
95
+ # The trace code for the payout, if applicable. Provided on ACH transactions when
96
+ # available.
97
+ #
98
+ # @return [String, nil]
99
+ required :trace_code, String, nil?: true
100
+
101
+ # @!attribute withdrawal_type
102
+ # The type of withdrawal.
103
+ #
104
+ # @return [Symbol, WhopSDK::Models::WithdrawalTypes]
105
+ required :withdrawal_type, enum: -> { WhopSDK::WithdrawalTypes }
106
+
107
+ # @!method initialize(id:, amount:, created_at:, currency:, error_code:, error_message:, estimated_availability:, fee_amount:, fee_type:, ledger_account:, markup_fee:, payout_token:, speed:, status:, trace_code:, withdrawal_type:)
108
+ # Some parameter documentations has been truncated, see
109
+ # {WhopSDK::Models::WithdrawalCreateResponse} for more details.
110
+ #
111
+ # A withdrawal request.
112
+ #
113
+ # @param id [String] Internal ID of the withdrawal request.
114
+ #
115
+ # @param amount [Float] How much money was attempted to be withdrawn, in a float type.
116
+ #
117
+ # @param created_at [Time] When the withdrawal request was created.
118
+ #
119
+ # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the withdrawal request.
120
+ #
121
+ # @param error_code [Symbol, WhopSDK::Models::WithdrawalCreateResponse::ErrorCode, nil] The different error codes a payout can be in.
122
+ #
123
+ # @param error_message [String, nil] The error message for the withdrawal, if any.
124
+ #
125
+ # @param estimated_availability [Time, nil] The estimated availability date for the withdrawal, if any.
126
+ #
127
+ # @param fee_amount [Float] The fee amount that was charged for the withdrawal. This is in the same currency
128
+ #
129
+ # @param fee_type [Symbol, WhopSDK::Models::WithdrawalFeeTypes, nil] The different fee types for a withdrawal.
130
+ #
131
+ # @param ledger_account [WhopSDK::Models::WithdrawalCreateResponse::LedgerAccount] The ledger account associated with the withdrawal.
132
+ #
133
+ # @param markup_fee [Float] The markup fee that was charged for the withdrawal. This is in the same currency
134
+ #
135
+ # @param payout_token [WhopSDK::Models::WithdrawalCreateResponse::PayoutToken, nil] The payout token used for the withdrawal, if applicable.
136
+ #
137
+ # @param speed [Symbol, WhopSDK::Models::WithdrawalSpeeds] The speed of the withdrawal.
138
+ #
139
+ # @param status [Symbol, WhopSDK::Models::WithdrawalStatus] Status of the withdrawal.
140
+ #
141
+ # @param trace_code [String, nil] The trace code for the payout, if applicable. Provided on ACH transactions when
142
+ #
143
+ # @param withdrawal_type [Symbol, WhopSDK::Models::WithdrawalTypes] The type of withdrawal.
144
+
145
+ # The different error codes a payout can be in.
146
+ #
147
+ # @see WhopSDK::Models::WithdrawalCreateResponse#error_code
148
+ module ErrorCode
149
+ extend WhopSDK::Internal::Type::Enum
150
+
151
+ ACCOUNT_CLOSED = :account_closed
152
+ ACCOUNT_DOES_NOT_EXIST = :account_does_not_exist
153
+ ACCOUNT_INFORMATION_INVALID = :account_information_invalid
154
+ ACCOUNT_NUMBER_INVALID_REGION = :account_number_invalid_region
155
+ ACCOUNT_FROZEN = :account_frozen
156
+ ACCOUNT_LOOKUP_FAILED = :account_lookup_failed
157
+ ACCOUNT_NOT_FOUND = :account_not_found
158
+ AMOUNT_OUT_OF_BOUNDS = :amount_out_of_bounds
159
+ ATTRIBUTES_NOT_VALIDATED = :attributes_not_validated
160
+ B2B_PAYMENTS_PROHIBITED = :b2b_payments_prohibited
161
+ BANK_STATEMENT_REQUIRED = :bank_statement_required
162
+ COMPLIANCE_REVIEW = :compliance_review
163
+ CURRENCY_NOT_SUPPORTED = :currency_not_supported
164
+ DEPOSIT_CANCELED = :deposit_canceled
165
+ DEPOSIT_FAILED = :deposit_failed
166
+ DEPOSIT_REJECTED = :deposit_rejected
167
+ DESTINATION_UNAVAILABLE = :destination_unavailable
168
+ EXCEEDED_ACCOUNT_LIMIT = :exceeded_account_limit
169
+ EXPIRED_QUOTE = :expired_quote
170
+ GENERIC_PAYOUT_ERROR = :generic_payout_error
171
+ TECHNICAL_PROBLEM = :technical_problem
172
+ IDENTIFICATION_NUMBER_INVALID = :identification_number_invalid
173
+ INVALID_ACCOUNT_NUMBER = :invalid_account_number
174
+ INVALID_BANK_CODE = :invalid_bank_code
175
+ INVALID_BENEFICIARY = :invalid_beneficiary
176
+ INVALID_BRANCH_NUMBER = :invalid_branch_number
177
+ INVALID_BRANCH_CODE = :invalid_branch_code
178
+ INVALID_PHONE_NUMBER = :invalid_phone_number
179
+ INVALID_ROUTING_NUMBER = :invalid_routing_number
180
+ INVALID_SWIFT_CODE = :invalid_swift_code
181
+ INVALID_COMPANY_DETAILS = :invalid_company_details
182
+ MANUAL_CANCELATION = :manual_cancelation
183
+ MISC_ERROR = :misc_error
184
+ MISSING_CITY_AND_COUNTRY = :missing_city_and_country
185
+ MISSING_PHONE_NUMBER = :missing_phone_number
186
+ MISSING_REMITTANCE_INFO = :missing_remittance_info
187
+ PAYEE_NAME_INVALID = :payee_name_invalid
188
+ RECEIVING_ACCOUNT_LOCKED = :receiving_account_locked
189
+ REJECTED_BY_COMPLIANCE = :rejected_by_compliance
190
+ RTP_NOT_SUPPORTED = :rtp_not_supported
191
+ NON_TRANSACTION_ACCOUNT = :non_transaction_account
192
+ SOURCE_TOKEN_INSUFFICIENT_FUNDS = :source_token_insufficient_funds
193
+ SSN_INVALID = :ssn_invalid
194
+ WALLET_SCREENSHOT_REQUIRED = :wallet_screenshot_required
195
+ UNSUPPORTED_REGION = :unsupported_region
196
+
197
+ # @!method self.values
198
+ # @return [Array<Symbol>]
199
+ end
200
+
201
+ # @see WhopSDK::Models::WithdrawalCreateResponse#ledger_account
202
+ class LedgerAccount < WhopSDK::Internal::Type::BaseModel
203
+ # @!attribute id
204
+ # The ID of the LedgerAccount.
205
+ #
206
+ # @return [String]
207
+ required :id, String
208
+
209
+ # @!attribute company_id
210
+ # The ID of the company associated with this ledger account.
211
+ #
212
+ # @return [String, nil]
213
+ required :company_id, String, nil?: true
214
+
215
+ # @!method initialize(id:, company_id:)
216
+ # The ledger account associated with the withdrawal.
217
+ #
218
+ # @param id [String] The ID of the LedgerAccount.
219
+ #
220
+ # @param company_id [String, nil] The ID of the company associated with this ledger account.
221
+ end
222
+
223
+ # @see WhopSDK::Models::WithdrawalCreateResponse#payout_token
224
+ class PayoutToken < WhopSDK::Internal::Type::BaseModel
225
+ # @!attribute id
226
+ # The ID of the payout token
227
+ #
228
+ # @return [String]
229
+ required :id, String
230
+
231
+ # @!attribute created_at
232
+ # The date and time the payout token was created
233
+ #
234
+ # @return [Time]
235
+ required :created_at, Time
236
+
237
+ # @!attribute destination_currency_code
238
+ # The currency code of the payout destination. This is the currency that payouts
239
+ # will be made in for this token.
240
+ #
241
+ # @return [String]
242
+ required :destination_currency_code, String
243
+
244
+ # @!attribute nickname
245
+ # An optional nickname for the payout token to help the user identify it. This is
246
+ # not used by the provider and is only for the user's reference.
247
+ #
248
+ # @return [String, nil]
249
+ required :nickname, String, nil?: true
250
+
251
+ # @!attribute payer_name
252
+ # The name of the payer associated with the payout token.
253
+ #
254
+ # @return [String, nil]
255
+ required :payer_name, String, nil?: true
256
+
257
+ # @!method initialize(id:, created_at:, destination_currency_code:, nickname:, payer_name:)
258
+ # Some parameter documentations has been truncated, see
259
+ # {WhopSDK::Models::WithdrawalCreateResponse::PayoutToken} for more details.
260
+ #
261
+ # The payout token used for the withdrawal, if applicable.
262
+ #
263
+ # @param id [String] The ID of the payout token
264
+ #
265
+ # @param created_at [Time] The date and time the payout token was created
266
+ #
267
+ # @param destination_currency_code [String] The currency code of the payout destination. This is the currency that payouts w
268
+ #
269
+ # @param nickname [String, nil] An optional nickname for the payout token to help the user identify it. This is
270
+ #
271
+ # @param payer_name [String, nil] The name of the payer associated with the payout token.
272
+ end
273
+ end
274
+ end
275
+ end
@@ -358,6 +358,8 @@ module WhopSDK
358
358
 
359
359
  PaymentFailedWebhookEvent = WhopSDK::Models::PaymentFailedWebhookEvent
360
360
 
361
+ PaymentListFeesParams = WhopSDK::Models::PaymentListFeesParams
362
+
361
363
  PaymentListParams = WhopSDK::Models::PaymentListParams
362
364
 
363
365
  PaymentMethodListParams = WhopSDK::Models::PaymentMethodListParams
@@ -380,6 +382,8 @@ module WhopSDK
380
382
 
381
383
  PaymentVoidParams = WhopSDK::Models::PaymentVoidParams
382
384
 
385
+ PayoutMethodListParams = WhopSDK::Models::PayoutMethodListParams
386
+
383
387
  Plan = WhopSDK::Models::Plan
384
388
 
385
389
  PlanCreateParams = WhopSDK::Models::PlanCreateParams
@@ -524,6 +528,8 @@ module WhopSDK
524
528
 
525
529
  WithdrawalCreatedWebhookEvent = WhopSDK::Models::WithdrawalCreatedWebhookEvent
526
530
 
531
+ WithdrawalCreateParams = WhopSDK::Models::WithdrawalCreateParams
532
+
527
533
  WithdrawalFeeTypes = WhopSDK::Models::WithdrawalFeeTypes
528
534
 
529
535
  WithdrawalListParams = WhopSDK::Models::WithdrawalListParams
@@ -21,7 +21,7 @@ module WhopSDK
21
21
  #
22
22
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
23
23
  #
24
- # @return [WhopSDK::Models::PaymentMethodRetrieveResponse]
24
+ # @return [WhopSDK::Models::PaymentMethodRetrieveResponse::BasePaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::CardPaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::UsBankAccountPaymentMethod]
25
25
  #
26
26
  # @see WhopSDK::Models::PaymentMethodRetrieveParams
27
27
  def retrieve(id, params)
@@ -65,7 +65,7 @@ module WhopSDK
65
65
  #
66
66
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
67
67
  #
68
- # @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentMethodListResponse>]
68
+ # @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentMethodListResponse::BasePaymentMethod, WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod, WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod>]
69
69
  #
70
70
  # @see WhopSDK::Models::PaymentMethodListParams
71
71
  def list(params)
@@ -146,6 +146,41 @@ module WhopSDK
146
146
  )
147
147
  end
148
148
 
149
+ # Lists fees for a payment
150
+ #
151
+ # Required permissions:
152
+ #
153
+ # - `payment:basic:read`
154
+ #
155
+ # @overload list_fees(id, after: nil, before: nil, first: nil, last: nil, request_options: {})
156
+ #
157
+ # @param id [String] The ID of the payment to list fees for
158
+ #
159
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
160
+ #
161
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
162
+ #
163
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
164
+ #
165
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
166
+ #
167
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
168
+ #
169
+ # @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentListFeesResponse>]
170
+ #
171
+ # @see WhopSDK::Models::PaymentListFeesParams
172
+ def list_fees(id, params = {})
173
+ parsed, options = WhopSDK::PaymentListFeesParams.dump_request(params)
174
+ @client.request(
175
+ method: :get,
176
+ path: ["payments/%1$s/fees", id],
177
+ query: parsed,
178
+ page: WhopSDK::Internal::CursorPage,
179
+ model: WhopSDK::Models::PaymentListFeesResponse,
180
+ options: options
181
+ )
182
+ end
183
+
149
184
  # Refunds a payment
150
185
  #
151
186
  # Required permissions:
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Resources
5
+ class PayoutMethods
6
+ # Lists payout destinations for a company
7
+ #
8
+ # Required permissions:
9
+ #
10
+ # - `payout:destination:read`
11
+ #
12
+ # @overload list(company_id:, after: nil, before: nil, first: nil, last: nil, request_options: {})
13
+ #
14
+ # @param company_id [String] The company ID to list payout methods for.
15
+ #
16
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
17
+ #
18
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
19
+ #
20
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
21
+ #
22
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
23
+ #
24
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
25
+ #
26
+ # @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PayoutMethodListResponse>]
27
+ #
28
+ # @see WhopSDK::Models::PayoutMethodListParams
29
+ def list(params)
30
+ parsed, options = WhopSDK::PayoutMethodListParams.dump_request(params)
31
+ @client.request(
32
+ method: :get,
33
+ path: "payout_methods",
34
+ query: parsed,
35
+ page: WhopSDK::Internal::CursorPage,
36
+ model: WhopSDK::Models::PayoutMethodListResponse,
37
+ options: options
38
+ )
39
+ end
40
+
41
+ # @api private
42
+ #
43
+ # @param client [WhopSDK::Client]
44
+ def initialize(client:)
45
+ @client = client
46
+ end
47
+ end
48
+ end
49
+ end
@@ -3,11 +3,45 @@
3
3
  module WhopSDK
4
4
  module Resources
5
5
  class Withdrawals
6
+ # Creates a withdrawal request for a ledger account
7
+ #
8
+ # Required permissions:
9
+ #
10
+ # - `payout:withdraw_funds`
11
+ # - `payout:destination:read`
12
+ #
13
+ # @overload create(amount:, company_id:, currency:, payout_method_id: nil, request_options: {})
14
+ #
15
+ # @param amount [Float] The amount to withdraw in the specified currency
16
+ #
17
+ # @param company_id [String] The ID of the company to withdraw from.
18
+ #
19
+ # @param currency [Symbol, WhopSDK::Models::Currency] The currency that is being withdrawn.
20
+ #
21
+ # @param payout_method_id [String, nil] The ID of the payout method to use for the withdrawal.
22
+ #
23
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
24
+ #
25
+ # @return [WhopSDK::Models::WithdrawalCreateResponse]
26
+ #
27
+ # @see WhopSDK::Models::WithdrawalCreateParams
28
+ def create(params)
29
+ parsed, options = WhopSDK::WithdrawalCreateParams.dump_request(params)
30
+ @client.request(
31
+ method: :post,
32
+ path: "withdrawals",
33
+ body: parsed,
34
+ model: WhopSDK::Models::WithdrawalCreateResponse,
35
+ options: options
36
+ )
37
+ end
38
+
6
39
  # Retrieves a withdrawal by ID
7
40
  #
8
41
  # Required permissions:
9
42
  #
10
43
  # - `payout:withdrawal:read`
44
+ # - `payout:destination:read`
11
45
  #
12
46
  # @overload retrieve(id, request_options: {})
13
47
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhopSDK
4
- VERSION = "0.0.15"
4
+ VERSION = "0.0.16"
5
5
  end
data/lib/whop_sdk.rb CHANGED
@@ -249,6 +249,8 @@ require_relative "whop_sdk/models/page_info"
249
249
  require_relative "whop_sdk/models/payment"
250
250
  require_relative "whop_sdk/models/payment_create_params"
251
251
  require_relative "whop_sdk/models/payment_failed_webhook_event"
252
+ require_relative "whop_sdk/models/payment_list_fees_params"
253
+ require_relative "whop_sdk/models/payment_list_fees_response"
252
254
  require_relative "whop_sdk/models/payment_list_params"
253
255
  require_relative "whop_sdk/models/payment_list_response"
254
256
  require_relative "whop_sdk/models/payment_method_list_params"
@@ -263,6 +265,8 @@ require_relative "whop_sdk/models/payment_retrieve_params"
263
265
  require_relative "whop_sdk/models/payment_retry_params"
264
266
  require_relative "whop_sdk/models/payment_succeeded_webhook_event"
265
267
  require_relative "whop_sdk/models/payment_void_params"
268
+ require_relative "whop_sdk/models/payout_method_list_params"
269
+ require_relative "whop_sdk/models/payout_method_list_response"
266
270
  require_relative "whop_sdk/models/plan"
267
271
  require_relative "whop_sdk/models/plan_create_params"
268
272
  require_relative "whop_sdk/models/plan_delete_params"
@@ -351,6 +355,8 @@ require_relative "whop_sdk/models/who_can_post"
351
355
  require_relative "whop_sdk/models/who_can_post_types"
352
356
  require_relative "whop_sdk/models/who_can_react"
353
357
  require_relative "whop_sdk/models/withdrawal_created_webhook_event"
358
+ require_relative "whop_sdk/models/withdrawal_create_params"
359
+ require_relative "whop_sdk/models/withdrawal_create_response"
354
360
  require_relative "whop_sdk/models/withdrawal_fee_types"
355
361
  require_relative "whop_sdk/models/withdrawal_list_params"
356
362
  require_relative "whop_sdk/models/withdrawal_list_response"
@@ -388,6 +394,7 @@ require_relative "whop_sdk/resources/messages"
388
394
  require_relative "whop_sdk/resources/notifications"
389
395
  require_relative "whop_sdk/resources/payment_methods"
390
396
  require_relative "whop_sdk/resources/payments"
397
+ require_relative "whop_sdk/resources/payout_methods"
391
398
  require_relative "whop_sdk/resources/plans"
392
399
  require_relative "whop_sdk/resources/products"
393
400
  require_relative "whop_sdk/resources/promo_codes"
@@ -139,6 +139,9 @@ module WhopSDK
139
139
  sig { returns(WhopSDK::Resources::FeeMarkups) }
140
140
  attr_reader :fee_markups
141
141
 
142
+ sig { returns(WhopSDK::Resources::PayoutMethods) }
143
+ attr_reader :payout_methods
144
+
142
145
  # @api private
143
146
  sig { override.returns(T::Hash[String, String]) }
144
147
  private def auth_headers
@@ -226,17 +226,49 @@ module WhopSDK
226
226
  sig { returns(Integer) }
227
227
  attr_accessor :order
228
228
 
229
+ # The thumbnail for the lesson
230
+ sig do
231
+ returns(T.nilable(WhopSDK::Course::Chapter::Lesson::Thumbnail))
232
+ end
233
+ attr_reader :thumbnail
234
+
235
+ sig do
236
+ params(
237
+ thumbnail:
238
+ T.nilable(WhopSDK::Course::Chapter::Lesson::Thumbnail::OrHash)
239
+ ).void
240
+ end
241
+ attr_writer :thumbnail
242
+
229
243
  # The title of the lesson
230
244
  sig { returns(String) }
231
245
  attr_accessor :title
232
246
 
247
+ # The associated Mux asset for video lessons
248
+ sig do
249
+ returns(T.nilable(WhopSDK::Course::Chapter::Lesson::VideoAsset))
250
+ end
251
+ attr_reader :video_asset
252
+
253
+ sig do
254
+ params(
255
+ video_asset:
256
+ T.nilable(WhopSDK::Course::Chapter::Lesson::VideoAsset::OrHash)
257
+ ).void
258
+ end
259
+ attr_writer :video_asset
260
+
233
261
  # A lesson from the courses app
234
262
  sig do
235
263
  params(
236
264
  id: String,
237
265
  lesson_type: WhopSDK::LessonTypes::OrSymbol,
238
266
  order: Integer,
239
- title: String
267
+ thumbnail:
268
+ T.nilable(WhopSDK::Course::Chapter::Lesson::Thumbnail::OrHash),
269
+ title: String,
270
+ video_asset:
271
+ T.nilable(WhopSDK::Course::Chapter::Lesson::VideoAsset::OrHash)
240
272
  ).returns(T.attached_class)
241
273
  end
242
274
  def self.new(
@@ -246,8 +278,12 @@ module WhopSDK
246
278
  lesson_type:,
247
279
  # The order of the lesson within its chapter
248
280
  order:,
281
+ # The thumbnail for the lesson
282
+ thumbnail:,
249
283
  # The title of the lesson
250
- title:
284
+ title:,
285
+ # The associated Mux asset for video lessons
286
+ video_asset:
251
287
  )
252
288
  end
253
289
 
@@ -257,12 +293,88 @@ module WhopSDK
257
293
  id: String,
258
294
  lesson_type: WhopSDK::LessonTypes::TaggedSymbol,
259
295
  order: Integer,
260
- title: String
296
+ thumbnail:
297
+ T.nilable(WhopSDK::Course::Chapter::Lesson::Thumbnail),
298
+ title: String,
299
+ video_asset:
300
+ T.nilable(WhopSDK::Course::Chapter::Lesson::VideoAsset)
261
301
  }
262
302
  )
263
303
  end
264
304
  def to_hash
265
305
  end
306
+
307
+ class Thumbnail < WhopSDK::Internal::Type::BaseModel
308
+ OrHash =
309
+ T.type_alias do
310
+ T.any(
311
+ WhopSDK::Course::Chapter::Lesson::Thumbnail,
312
+ WhopSDK::Internal::AnyHash
313
+ )
314
+ end
315
+
316
+ # This is the URL you use to render optimized attachments on the client. This
317
+ # should be used for apps.
318
+ sig { returns(T.nilable(String)) }
319
+ attr_accessor :url
320
+
321
+ # The thumbnail for the lesson
322
+ sig { params(url: T.nilable(String)).returns(T.attached_class) }
323
+ def self.new(
324
+ # This is the URL you use to render optimized attachments on the client. This
325
+ # should be used for apps.
326
+ url:
327
+ )
328
+ end
329
+
330
+ sig { override.returns({ url: T.nilable(String) }) }
331
+ def to_hash
332
+ end
333
+ end
334
+
335
+ class VideoAsset < WhopSDK::Internal::Type::BaseModel
336
+ OrHash =
337
+ T.type_alias do
338
+ T.any(
339
+ WhopSDK::Course::Chapter::Lesson::VideoAsset,
340
+ WhopSDK::Internal::AnyHash
341
+ )
342
+ end
343
+
344
+ # The duration of the video in seconds
345
+ sig { returns(T.nilable(Integer)) }
346
+ attr_accessor :duration_seconds
347
+
348
+ # The signed thumbnail playback token of the Mux asset
349
+ sig { returns(T.nilable(String)) }
350
+ attr_accessor :signed_thumbnail_playback_token
351
+
352
+ # The associated Mux asset for video lessons
353
+ sig do
354
+ params(
355
+ duration_seconds: T.nilable(Integer),
356
+ signed_thumbnail_playback_token: T.nilable(String)
357
+ ).returns(T.attached_class)
358
+ end
359
+ def self.new(
360
+ # The duration of the video in seconds
361
+ duration_seconds:,
362
+ # The signed thumbnail playback token of the Mux asset
363
+ signed_thumbnail_playback_token:
364
+ )
365
+ end
366
+
367
+ sig do
368
+ override.returns(
369
+ {
370
+ duration_seconds: T.nilable(Integer),
371
+ signed_thumbnail_playback_token: T.nilable(String)
372
+ }
373
+ )
374
+ end
375
+ def to_hash
376
+ end
377
+ end
266
378
  end
267
379
  end
268
380