whop_sdk 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +20 -0
- data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +30 -24
- data/lib/whop_sdk/models/assessment_question_types.rb +18 -0
- data/lib/whop_sdk/models/billing_reasons.rb +20 -0
- data/lib/whop_sdk/models/card_brands.rb +30 -0
- data/lib/whop_sdk/models/checkout_configuration.rb +10 -7
- data/lib/whop_sdk/models/checkout_configuration_create_params.rb +140 -3
- data/lib/whop_sdk/models/checkout_configuration_list_response.rb +10 -7
- data/lib/whop_sdk/models/course.rb +230 -0
- data/lib/whop_sdk/models/course_chapter.rb +72 -0
- data/lib/whop_sdk/models/course_chapter_create_params.rb +30 -0
- data/lib/whop_sdk/models/course_chapter_delete_params.rb +14 -0
- data/lib/whop_sdk/models/course_chapter_delete_response.rb +8 -0
- data/lib/whop_sdk/models/course_chapter_list_params.rb +54 -0
- data/lib/whop_sdk/models/course_chapter_list_response.rb +35 -0
- data/lib/whop_sdk/models/course_chapter_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/course_chapter_update_params.rb +22 -0
- data/lib/whop_sdk/models/course_create_params.rb +82 -0
- data/lib/whop_sdk/models/course_delete_params.rb +14 -0
- data/lib/whop_sdk/models/course_delete_response.rb +8 -0
- data/lib/whop_sdk/models/course_lesson_create_params.rb +54 -0
- data/lib/whop_sdk/models/course_lesson_delete_params.rb +14 -0
- data/lib/whop_sdk/models/course_lesson_delete_response.rb +8 -0
- data/lib/whop_sdk/models/course_lesson_list_params.rb +62 -0
- data/lib/whop_sdk/models/course_lesson_list_response.rb +71 -0
- data/lib/whop_sdk/models/course_lesson_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/course_lesson_update_params.rb +278 -0
- data/lib/whop_sdk/models/course_list_params.rb +62 -0
- data/lib/whop_sdk/models/course_list_response.rb +148 -0
- data/lib/whop_sdk/models/course_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/course_update_params.rb +197 -0
- data/lib/whop_sdk/models/experience_duplicate_params.rb +22 -0
- data/lib/whop_sdk/models/forum_post.rb +17 -1
- data/lib/whop_sdk/models/forum_post_list_response.rb +17 -1
- data/lib/whop_sdk/models/forum_post_update_params.rb +80 -0
- data/lib/whop_sdk/models/invoice.rb +6 -2
- data/lib/whop_sdk/models/invoice_list_item.rb +6 -2
- data/lib/whop_sdk/models/languages.rb +36 -0
- data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +9 -0
- data/lib/whop_sdk/models/lesson.rb +365 -0
- data/lib/whop_sdk/models/lesson_types.rb +20 -0
- data/lib/whop_sdk/models/lesson_visibilities.rb +17 -0
- data/lib/whop_sdk/models/member_list_params.rb +9 -1
- data/lib/whop_sdk/models/membership.rb +31 -1
- data/lib/whop_sdk/models/membership_list_params.rb +16 -8
- data/lib/whop_sdk/models/membership_list_response.rb +31 -1
- data/lib/whop_sdk/models/message_update_params.rb +68 -0
- data/lib/whop_sdk/models/payment.rb +24 -21
- data/lib/whop_sdk/models/payment_list_params.rb +3 -18
- data/lib/whop_sdk/models/payment_list_response.rb +24 -21
- data/lib/whop_sdk/models/payment_method_types.rb +98 -0
- data/lib/whop_sdk/models/plan.rb +25 -1
- data/lib/whop_sdk/models/plan_create_params.rb +37 -3
- data/lib/whop_sdk/models/plan_list_response.rb +25 -1
- data/lib/whop_sdk/models/plan_update_params.rb +35 -1
- data/lib/whop_sdk/models/product.rb +11 -1
- data/lib/whop_sdk/models/product_create_params.rb +1 -45
- data/lib/whop_sdk/models/product_list_item.rb +14 -1
- data/lib/whop_sdk/models/product_update_params.rb +30 -1
- data/lib/whop_sdk/models/promo_code.rb +211 -0
- data/lib/whop_sdk/models/promo_code_create_params.rb +140 -0
- data/lib/whop_sdk/models/promo_code_delete_params.rb +14 -0
- data/lib/whop_sdk/models/promo_code_delete_response.rb +8 -0
- data/lib/whop_sdk/models/promo_code_list_params.rb +78 -0
- data/lib/whop_sdk/models/promo_code_list_response.rb +181 -0
- data/lib/whop_sdk/models/promo_code_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/promo_code_status.rb +17 -0
- data/lib/whop_sdk/models/promo_duration.rb +17 -0
- data/lib/whop_sdk/models/review_list_params.rb +70 -0
- data/lib/whop_sdk/models/review_list_response.rb +183 -0
- data/lib/whop_sdk/models/review_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/review_retrieve_response.rb +251 -0
- data/lib/whop_sdk/models/review_status.rb +17 -0
- data/lib/whop_sdk/models.rb +76 -0
- data/lib/whop_sdk/resources/checkout_configurations.rb +2 -0
- data/lib/whop_sdk/resources/course_chapters.rb +151 -0
- data/lib/whop_sdk/resources/course_lessons.rb +178 -0
- data/lib/whop_sdk/resources/courses.rb +178 -0
- data/lib/whop_sdk/resources/experiences.rb +33 -0
- data/lib/whop_sdk/resources/forum_posts.rb +33 -0
- data/lib/whop_sdk/resources/members.rb +3 -1
- data/lib/whop_sdk/resources/memberships.rb +6 -4
- data/lib/whop_sdk/resources/messages.rb +28 -0
- data/lib/whop_sdk/resources/payments.rb +1 -1
- data/lib/whop_sdk/resources/plans.rb +19 -3
- data/lib/whop_sdk/resources/products.rb +4 -6
- data/lib/whop_sdk/resources/promo_codes.rb +161 -0
- data/lib/whop_sdk/resources/reviews.rb +68 -0
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +53 -0
- data/rbi/whop_sdk/client.rbi +15 -0
- data/rbi/whop_sdk/models/assessment_question_types.rbi +31 -0
- data/rbi/whop_sdk/models/billing_reasons.rbi +27 -0
- data/rbi/whop_sdk/models/card_brands.rbi +35 -0
- data/rbi/whop_sdk/models/checkout_configuration.rbi +4 -2
- data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +183 -2
- data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +4 -2
- data/rbi/whop_sdk/models/course.rbi +313 -0
- data/rbi/whop_sdk/models/course_chapter.rbi +101 -0
- data/rbi/whop_sdk/models/course_chapter_create_params.rbi +51 -0
- data/rbi/whop_sdk/models/course_chapter_delete_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_chapter_delete_response.rbi +8 -0
- data/rbi/whop_sdk/models/course_chapter_list_params.rbi +75 -0
- data/rbi/whop_sdk/models/course_chapter_list_response.rbi +47 -0
- data/rbi/whop_sdk/models/course_chapter_retrieve_params.rbi +30 -0
- data/rbi/whop_sdk/models/course_chapter_update_params.rbi +40 -0
- data/rbi/whop_sdk/models/course_create_params.rbi +131 -0
- data/rbi/whop_sdk/models/course_delete_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_delete_response.rbi +7 -0
- data/rbi/whop_sdk/models/course_lesson_create_params.rbi +75 -0
- data/rbi/whop_sdk/models/course_lesson_delete_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_lesson_delete_response.rbi +8 -0
- data/rbi/whop_sdk/models/course_lesson_list_params.rbi +83 -0
- data/rbi/whop_sdk/models/course_lesson_list_response.rbi +91 -0
- data/rbi/whop_sdk/models/course_lesson_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_lesson_update_params.rbi +465 -0
- data/rbi/whop_sdk/models/course_list_params.rbi +83 -0
- data/rbi/whop_sdk/models/course_list_response.rbi +198 -0
- data/rbi/whop_sdk/models/course_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_update_params.rbi +293 -0
- data/rbi/whop_sdk/models/experience_duplicate_params.rbi +40 -0
- data/rbi/whop_sdk/models/forum_post.rbi +16 -0
- data/rbi/whop_sdk/models/forum_post_list_response.rbi +16 -0
- data/rbi/whop_sdk/models/forum_post_update_params.rbi +124 -0
- data/rbi/whop_sdk/models/invoice.rbi +4 -2
- data/rbi/whop_sdk/models/invoice_list_item.rbi +4 -2
- data/rbi/whop_sdk/models/languages.rbi +40 -0
- data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +45 -0
- data/rbi/whop_sdk/models/lesson.rbi +517 -0
- data/rbi/whop_sdk/models/lesson_types.rbi +25 -0
- data/rbi/whop_sdk/models/lesson_visibilities.rbi +23 -0
- data/rbi/whop_sdk/models/member_list_params.rbi +8 -0
- data/rbi/whop_sdk/models/membership.rbi +40 -0
- data/rbi/whop_sdk/models/membership_list_params.rbi +16 -8
- data/rbi/whop_sdk/models/membership_list_response.rbi +47 -0
- data/rbi/whop_sdk/models/message_update_params.rbi +114 -0
- data/rbi/whop_sdk/models/payment.rbi +32 -25
- data/rbi/whop_sdk/models/payment_list_params.rbi +3 -63
- data/rbi/whop_sdk/models/payment_list_response.rbi +32 -25
- data/rbi/whop_sdk/models/payment_method_types.rbi +116 -0
- data/rbi/whop_sdk/models/plan.rbi +24 -0
- data/rbi/whop_sdk/models/plan_create_params.rbi +38 -2
- data/rbi/whop_sdk/models/plan_list_response.rbi +24 -0
- data/rbi/whop_sdk/models/plan_update_params.rbi +36 -0
- data/rbi/whop_sdk/models/product.rbi +12 -0
- data/rbi/whop_sdk/models/product_create_params.rbi +0 -74
- data/rbi/whop_sdk/models/product_list_item.rbi +12 -0
- data/rbi/whop_sdk/models/product_update_params.rbi +59 -0
- data/rbi/whop_sdk/models/promo_code.rbi +248 -0
- data/rbi/whop_sdk/models/promo_code_create_params.rbi +161 -0
- data/rbi/whop_sdk/models/promo_code_delete_params.rbi +27 -0
- data/rbi/whop_sdk/models/promo_code_delete_response.rbi +8 -0
- data/rbi/whop_sdk/models/promo_code_list_params.rbi +99 -0
- data/rbi/whop_sdk/models/promo_code_list_response.rbi +222 -0
- data/rbi/whop_sdk/models/promo_code_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/promo_code_status.rbi +21 -0
- data/rbi/whop_sdk/models/promo_duration.rbi +21 -0
- data/rbi/whop_sdk/models/review_list_params.rbi +91 -0
- data/rbi/whop_sdk/models/review_list_response.rbi +243 -0
- data/rbi/whop_sdk/models/review_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/review_retrieve_response.rbi +354 -0
- data/rbi/whop_sdk/models/review_status.rbi +21 -0
- data/rbi/whop_sdk/models.rbi +76 -0
- data/rbi/whop_sdk/resources/checkout_configurations.rbi +2 -0
- data/rbi/whop_sdk/resources/course_chapters.rbi +115 -0
- data/rbi/whop_sdk/resources/course_lessons.rbi +163 -0
- data/rbi/whop_sdk/resources/courses.rbi +152 -0
- data/rbi/whop_sdk/resources/experiences.rbi +25 -0
- data/rbi/whop_sdk/resources/forum_posts.rbi +29 -0
- data/rbi/whop_sdk/resources/members.rbi +3 -0
- data/rbi/whop_sdk/resources/memberships.rbi +6 -3
- data/rbi/whop_sdk/resources/messages.rbi +25 -0
- data/rbi/whop_sdk/resources/payments.rbi +1 -3
- data/rbi/whop_sdk/resources/plans.rbi +29 -1
- data/rbi/whop_sdk/resources/products.rbi +4 -7
- data/rbi/whop_sdk/resources/promo_codes.rbi +147 -0
- data/rbi/whop_sdk/resources/reviews.rbi +56 -0
- data/sig/whop_sdk/client.rbs +10 -0
- data/sig/whop_sdk/models/assessment_question_types.rbs +17 -0
- data/sig/whop_sdk/models/billing_reasons.rbs +24 -0
- data/sig/whop_sdk/models/card_brands.rbs +44 -0
- data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +87 -0
- data/sig/whop_sdk/models/course.rbs +171 -0
- data/sig/whop_sdk/models/course_chapter.rbs +49 -0
- data/sig/whop_sdk/models/course_chapter_create_params.rbs +28 -0
- data/sig/whop_sdk/models/course_chapter_delete_params.rbs +15 -0
- data/sig/whop_sdk/models/course_chapter_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/course_chapter_list_params.rbs +46 -0
- data/sig/whop_sdk/models/course_chapter_list_response.rbs +18 -0
- data/sig/whop_sdk/models/course_chapter_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/course_chapter_update_params.rbs +23 -0
- data/sig/whop_sdk/models/course_create_params.rbs +58 -0
- data/sig/whop_sdk/models/course_delete_params.rbs +15 -0
- data/sig/whop_sdk/models/course_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/course_lesson_create_params.rbs +46 -0
- data/sig/whop_sdk/models/course_lesson_delete_params.rbs +15 -0
- data/sig/whop_sdk/models/course_lesson_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/course_lesson_list_params.rbs +51 -0
- data/sig/whop_sdk/models/course_lesson_list_response.rbs +50 -0
- data/sig/whop_sdk/models/course_lesson_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/course_lesson_update_params.rbs +162 -0
- data/sig/whop_sdk/models/course_list_params.rbs +51 -0
- data/sig/whop_sdk/models/course_list_response.rbs +102 -0
- data/sig/whop_sdk/models/course_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/course_update_params.rbs +137 -0
- data/sig/whop_sdk/models/experience_duplicate_params.rbs +23 -0
- data/sig/whop_sdk/models/forum_post.rbs +10 -0
- data/sig/whop_sdk/models/forum_post_list_response.rbs +10 -0
- data/sig/whop_sdk/models/forum_post_update_params.rbs +53 -0
- data/sig/whop_sdk/models/languages.rbs +56 -0
- data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +20 -1
- data/sig/whop_sdk/models/lesson.rbs +248 -0
- data/sig/whop_sdk/models/lesson_types.rbs +19 -0
- data/sig/whop_sdk/models/lesson_visibilities.rbs +14 -0
- data/sig/whop_sdk/models/member_list_params.rbs +6 -1
- data/sig/whop_sdk/models/membership.rbs +17 -0
- data/sig/whop_sdk/models/membership_list_params.rbs +11 -6
- data/sig/whop_sdk/models/membership_list_response.rbs +17 -0
- data/sig/whop_sdk/models/message_update_params.rbs +48 -0
- data/sig/whop_sdk/models/payment.rbs +12 -12
- data/sig/whop_sdk/models/payment_list_params.rbs +4 -25
- data/sig/whop_sdk/models/payment_list_response.rbs +12 -12
- data/sig/whop_sdk/models/payment_method_types.rbs +180 -0
- data/sig/whop_sdk/models/plan.rbs +15 -0
- data/sig/whop_sdk/models/plan_create_params.rbs +20 -0
- data/sig/whop_sdk/models/plan_list_response.rbs +15 -0
- data/sig/whop_sdk/models/plan_update_params.rbs +20 -0
- data/sig/whop_sdk/models/product.rbs +5 -0
- data/sig/whop_sdk/models/product_create_params.rbs +0 -22
- data/sig/whop_sdk/models/product_list_item.rbs +5 -0
- data/sig/whop_sdk/models/product_update_params.rbs +17 -0
- data/sig/whop_sdk/models/promo_code.rbs +134 -0
- data/sig/whop_sdk/models/promo_code_create_params.rbs +96 -0
- data/sig/whop_sdk/models/promo_code_delete_params.rbs +15 -0
- data/sig/whop_sdk/models/promo_code_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/promo_code_list_params.rbs +61 -0
- data/sig/whop_sdk/models/promo_code_list_response.rbs +117 -0
- data/sig/whop_sdk/models/promo_code_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/promo_code_status.rbs +15 -0
- data/sig/whop_sdk/models/promo_duration.rbs +15 -0
- data/sig/whop_sdk/models/review_list_params.rbs +56 -0
- data/sig/whop_sdk/models/review_list_response.rbs +116 -0
- data/sig/whop_sdk/models/review_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/review_retrieve_response.rbs +152 -0
- data/sig/whop_sdk/models/review_status.rbs +15 -0
- data/sig/whop_sdk/models.rbs +76 -0
- data/sig/whop_sdk/resources/course_chapters.rbs +35 -0
- data/sig/whop_sdk/resources/course_lessons.rbs +47 -0
- data/sig/whop_sdk/resources/courses.rbs +47 -0
- data/sig/whop_sdk/resources/experiences.rbs +6 -0
- data/sig/whop_sdk/resources/forum_posts.rbs +9 -0
- data/sig/whop_sdk/resources/members.rbs +1 -0
- data/sig/whop_sdk/resources/memberships.rbs +2 -1
- data/sig/whop_sdk/resources/messages.rbs +8 -0
- data/sig/whop_sdk/resources/payments.rbs +1 -1
- data/sig/whop_sdk/resources/plans.rbs +8 -0
- data/sig/whop_sdk/resources/products.rbs +1 -2
- data/sig/whop_sdk/resources/promo_codes.rbs +45 -0
- data/sig/whop_sdk/resources/reviews.rbs +23 -0
- metadata +189 -2
|
@@ -166,7 +166,26 @@ module WhopSDK
|
|
|
166
166
|
sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) }
|
|
167
167
|
attr_accessor :plan_type
|
|
168
168
|
|
|
169
|
-
#
|
|
169
|
+
# Pass this object to create a new product for this plan. We will use the product
|
|
170
|
+
# external identifier to find or create an existing product.
|
|
171
|
+
sig do
|
|
172
|
+
returns(
|
|
173
|
+
T.nilable(WhopSDK::CheckoutConfigurationCreateParams::Plan::Product)
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
attr_reader :product
|
|
177
|
+
|
|
178
|
+
sig do
|
|
179
|
+
params(
|
|
180
|
+
product:
|
|
181
|
+
T.nilable(
|
|
182
|
+
WhopSDK::CheckoutConfigurationCreateParams::Plan::Product::OrHash
|
|
183
|
+
)
|
|
184
|
+
).void
|
|
185
|
+
end
|
|
186
|
+
attr_writer :product
|
|
187
|
+
|
|
188
|
+
# The product the plan is related to. Either this or product is required.
|
|
170
189
|
sig { returns(T.nilable(String)) }
|
|
171
190
|
attr_accessor :product_id
|
|
172
191
|
|
|
@@ -213,6 +232,10 @@ module WhopSDK
|
|
|
213
232
|
internal_notes: T.nilable(String),
|
|
214
233
|
override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol),
|
|
215
234
|
plan_type: T.nilable(WhopSDK::PlanType::OrSymbol),
|
|
235
|
+
product:
|
|
236
|
+
T.nilable(
|
|
237
|
+
WhopSDK::CheckoutConfigurationCreateParams::Plan::Product::OrHash
|
|
238
|
+
),
|
|
216
239
|
product_id: T.nilable(String),
|
|
217
240
|
release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol),
|
|
218
241
|
renewal_price: T.nilable(Float),
|
|
@@ -248,7 +271,10 @@ module WhopSDK
|
|
|
248
271
|
override_tax_type: nil,
|
|
249
272
|
# The type of plan that can be attached to an access pass
|
|
250
273
|
plan_type: nil,
|
|
251
|
-
#
|
|
274
|
+
# Pass this object to create a new product for this plan. We will use the product
|
|
275
|
+
# external identifier to find or create an existing product.
|
|
276
|
+
product: nil,
|
|
277
|
+
# The product the plan is related to. Either this or product is required.
|
|
252
278
|
product_id: nil,
|
|
253
279
|
# The methods of how a plan can be released.
|
|
254
280
|
release_method: nil,
|
|
@@ -286,6 +312,10 @@ module WhopSDK
|
|
|
286
312
|
internal_notes: T.nilable(String),
|
|
287
313
|
override_tax_type: T.nilable(WhopSDK::TaxType::OrSymbol),
|
|
288
314
|
plan_type: T.nilable(WhopSDK::PlanType::OrSymbol),
|
|
315
|
+
product:
|
|
316
|
+
T.nilable(
|
|
317
|
+
WhopSDK::CheckoutConfigurationCreateParams::Plan::Product
|
|
318
|
+
),
|
|
289
319
|
product_id: T.nilable(String),
|
|
290
320
|
release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol),
|
|
291
321
|
renewal_price: T.nilable(Float),
|
|
@@ -421,6 +451,157 @@ module WhopSDK
|
|
|
421
451
|
def to_hash
|
|
422
452
|
end
|
|
423
453
|
end
|
|
454
|
+
|
|
455
|
+
class Product < WhopSDK::Internal::Type::BaseModel
|
|
456
|
+
OrHash =
|
|
457
|
+
T.type_alias do
|
|
458
|
+
T.any(
|
|
459
|
+
WhopSDK::CheckoutConfigurationCreateParams::Plan::Product,
|
|
460
|
+
WhopSDK::Internal::AnyHash
|
|
461
|
+
)
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
# A unique ID used to find or create a product. When provided during creation, we
|
|
465
|
+
# will look for an existing product with this external identifier — if found, it
|
|
466
|
+
# will be updated; otherwise, a new product will be created.
|
|
467
|
+
sig { returns(String) }
|
|
468
|
+
attr_accessor :external_identifier
|
|
469
|
+
|
|
470
|
+
# The title of the product.
|
|
471
|
+
sig { returns(String) }
|
|
472
|
+
attr_accessor :title
|
|
473
|
+
|
|
474
|
+
# The different business types a company can be.
|
|
475
|
+
sig { returns(T.nilable(WhopSDK::BusinessTypes::OrSymbol)) }
|
|
476
|
+
attr_accessor :business_type
|
|
477
|
+
|
|
478
|
+
# Whether or not to collect shipping information at checkout from the customer.
|
|
479
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
480
|
+
attr_accessor :collect_shipping_address
|
|
481
|
+
|
|
482
|
+
# The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
|
|
483
|
+
# between 5 and 22 characters, contain at least one letter, and not contain any of
|
|
484
|
+
# the following characters: <, >, \, ', "
|
|
485
|
+
sig { returns(T.nilable(String)) }
|
|
486
|
+
attr_accessor :custom_statement_descriptor
|
|
487
|
+
|
|
488
|
+
# A written description of the product.
|
|
489
|
+
sig { returns(T.nilable(String)) }
|
|
490
|
+
attr_accessor :description
|
|
491
|
+
|
|
492
|
+
# The percentage of the revenue that goes to the global affiliate program.
|
|
493
|
+
sig { returns(T.nilable(Float)) }
|
|
494
|
+
attr_accessor :global_affiliate_percentage
|
|
495
|
+
|
|
496
|
+
# The different statuses of the global affiliate program for an access pass.
|
|
497
|
+
sig { returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) }
|
|
498
|
+
attr_accessor :global_affiliate_status
|
|
499
|
+
|
|
500
|
+
# The headline of the product.
|
|
501
|
+
sig { returns(T.nilable(String)) }
|
|
502
|
+
attr_accessor :headline
|
|
503
|
+
|
|
504
|
+
# The different industry types a company can be in.
|
|
505
|
+
sig { returns(T.nilable(WhopSDK::IndustryTypes::OrSymbol)) }
|
|
506
|
+
attr_accessor :industry_type
|
|
507
|
+
|
|
508
|
+
# The ID of the product tax code to apply to this product.
|
|
509
|
+
sig { returns(T.nilable(String)) }
|
|
510
|
+
attr_accessor :product_tax_code_id
|
|
511
|
+
|
|
512
|
+
# The URL to redirect the customer to after a purchase.
|
|
513
|
+
sig { returns(T.nilable(String)) }
|
|
514
|
+
attr_accessor :redirect_purchase_url
|
|
515
|
+
|
|
516
|
+
# The route of the product.
|
|
517
|
+
sig { returns(T.nilable(String)) }
|
|
518
|
+
attr_accessor :route
|
|
519
|
+
|
|
520
|
+
# Visibility of a resource
|
|
521
|
+
sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) }
|
|
522
|
+
attr_accessor :visibility
|
|
523
|
+
|
|
524
|
+
# Pass this object to create a new product for this plan. We will use the product
|
|
525
|
+
# external identifier to find or create an existing product.
|
|
526
|
+
sig do
|
|
527
|
+
params(
|
|
528
|
+
external_identifier: String,
|
|
529
|
+
title: String,
|
|
530
|
+
business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
|
|
531
|
+
collect_shipping_address: T.nilable(T::Boolean),
|
|
532
|
+
custom_statement_descriptor: T.nilable(String),
|
|
533
|
+
description: T.nilable(String),
|
|
534
|
+
global_affiliate_percentage: T.nilable(Float),
|
|
535
|
+
global_affiliate_status:
|
|
536
|
+
T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol),
|
|
537
|
+
headline: T.nilable(String),
|
|
538
|
+
industry_type: T.nilable(WhopSDK::IndustryTypes::OrSymbol),
|
|
539
|
+
product_tax_code_id: T.nilable(String),
|
|
540
|
+
redirect_purchase_url: T.nilable(String),
|
|
541
|
+
route: T.nilable(String),
|
|
542
|
+
visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
|
|
543
|
+
).returns(T.attached_class)
|
|
544
|
+
end
|
|
545
|
+
def self.new(
|
|
546
|
+
# A unique ID used to find or create a product. When provided during creation, we
|
|
547
|
+
# will look for an existing product with this external identifier — if found, it
|
|
548
|
+
# will be updated; otherwise, a new product will be created.
|
|
549
|
+
external_identifier:,
|
|
550
|
+
# The title of the product.
|
|
551
|
+
title:,
|
|
552
|
+
# The different business types a company can be.
|
|
553
|
+
business_type: nil,
|
|
554
|
+
# Whether or not to collect shipping information at checkout from the customer.
|
|
555
|
+
collect_shipping_address: nil,
|
|
556
|
+
# The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
|
|
557
|
+
# between 5 and 22 characters, contain at least one letter, and not contain any of
|
|
558
|
+
# the following characters: <, >, \, ', "
|
|
559
|
+
custom_statement_descriptor: nil,
|
|
560
|
+
# A written description of the product.
|
|
561
|
+
description: nil,
|
|
562
|
+
# The percentage of the revenue that goes to the global affiliate program.
|
|
563
|
+
global_affiliate_percentage: nil,
|
|
564
|
+
# The different statuses of the global affiliate program for an access pass.
|
|
565
|
+
global_affiliate_status: nil,
|
|
566
|
+
# The headline of the product.
|
|
567
|
+
headline: nil,
|
|
568
|
+
# The different industry types a company can be in.
|
|
569
|
+
industry_type: nil,
|
|
570
|
+
# The ID of the product tax code to apply to this product.
|
|
571
|
+
product_tax_code_id: nil,
|
|
572
|
+
# The URL to redirect the customer to after a purchase.
|
|
573
|
+
redirect_purchase_url: nil,
|
|
574
|
+
# The route of the product.
|
|
575
|
+
route: nil,
|
|
576
|
+
# Visibility of a resource
|
|
577
|
+
visibility: nil
|
|
578
|
+
)
|
|
579
|
+
end
|
|
580
|
+
|
|
581
|
+
sig do
|
|
582
|
+
override.returns(
|
|
583
|
+
{
|
|
584
|
+
external_identifier: String,
|
|
585
|
+
title: String,
|
|
586
|
+
business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
|
|
587
|
+
collect_shipping_address: T.nilable(T::Boolean),
|
|
588
|
+
custom_statement_descriptor: T.nilable(String),
|
|
589
|
+
description: T.nilable(String),
|
|
590
|
+
global_affiliate_percentage: T.nilable(Float),
|
|
591
|
+
global_affiliate_status:
|
|
592
|
+
T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol),
|
|
593
|
+
headline: T.nilable(String),
|
|
594
|
+
industry_type: T.nilable(WhopSDK::IndustryTypes::OrSymbol),
|
|
595
|
+
product_tax_code_id: T.nilable(String),
|
|
596
|
+
redirect_purchase_url: T.nilable(String),
|
|
597
|
+
route: T.nilable(String),
|
|
598
|
+
visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
|
|
599
|
+
}
|
|
600
|
+
)
|
|
601
|
+
end
|
|
602
|
+
def to_hash
|
|
603
|
+
end
|
|
604
|
+
end
|
|
424
605
|
end
|
|
425
606
|
end
|
|
426
607
|
end
|
|
@@ -38,7 +38,8 @@ module WhopSDK
|
|
|
38
38
|
end
|
|
39
39
|
attr_writer :plan
|
|
40
40
|
|
|
41
|
-
#
|
|
41
|
+
# A URL you can send to customers to complete a checkout. It looks like
|
|
42
|
+
# `/checkout/plan_xxxx?session={id}`
|
|
42
43
|
sig { returns(String) }
|
|
43
44
|
attr_accessor :purchase_url
|
|
44
45
|
|
|
@@ -74,7 +75,8 @@ module WhopSDK
|
|
|
74
75
|
metadata:,
|
|
75
76
|
# The plan to use for the checkout configuration
|
|
76
77
|
plan:,
|
|
77
|
-
#
|
|
78
|
+
# A URL you can send to customers to complete a checkout. It looks like
|
|
79
|
+
# `/checkout/plan_xxxx?session={id}`
|
|
78
80
|
purchase_url:,
|
|
79
81
|
# The URL to redirect the user to after the checkout configuration is created
|
|
80
82
|
redirect_url:
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class Course < WhopSDK::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(WhopSDK::Course, WhopSDK::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# The ID of the course. Looks like cors_XXX
|
|
10
|
+
sig { returns(String) }
|
|
11
|
+
attr_accessor :id
|
|
12
|
+
|
|
13
|
+
# Whether the course will award its students a PDF certificate after completing
|
|
14
|
+
# all lessons
|
|
15
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
16
|
+
attr_accessor :certificate_after_completion_enabled
|
|
17
|
+
|
|
18
|
+
# The chapters in this course
|
|
19
|
+
sig { returns(T::Array[WhopSDK::Course::Chapter]) }
|
|
20
|
+
attr_accessor :chapters
|
|
21
|
+
|
|
22
|
+
# The timestamp of when the course was created
|
|
23
|
+
sig { returns(Time) }
|
|
24
|
+
attr_accessor :created_at
|
|
25
|
+
|
|
26
|
+
# A short description of the course
|
|
27
|
+
sig { returns(T.nilable(String)) }
|
|
28
|
+
attr_accessor :description
|
|
29
|
+
|
|
30
|
+
# The language spoken in the video content of the course, used to generate closed
|
|
31
|
+
# captions in the right language
|
|
32
|
+
sig { returns(WhopSDK::Languages::TaggedSymbol) }
|
|
33
|
+
attr_accessor :language
|
|
34
|
+
|
|
35
|
+
# Whether the course requires students to complete the previous lesson before
|
|
36
|
+
# moving on to the next one
|
|
37
|
+
sig { returns(T::Boolean) }
|
|
38
|
+
attr_accessor :require_completing_lessons_in_order
|
|
39
|
+
|
|
40
|
+
# A short tagline for the course. It is displayed under the course title in the UI
|
|
41
|
+
sig { returns(T.nilable(String)) }
|
|
42
|
+
attr_accessor :tagline
|
|
43
|
+
|
|
44
|
+
# The thumbnail for the course
|
|
45
|
+
sig { returns(T.nilable(WhopSDK::Course::Thumbnail)) }
|
|
46
|
+
attr_reader :thumbnail
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
params(thumbnail: T.nilable(WhopSDK::Course::Thumbnail::OrHash)).void
|
|
50
|
+
end
|
|
51
|
+
attr_writer :thumbnail
|
|
52
|
+
|
|
53
|
+
# The title of the course
|
|
54
|
+
sig { returns(T.nilable(String)) }
|
|
55
|
+
attr_accessor :title
|
|
56
|
+
|
|
57
|
+
# The timestamp of when the course was last updated
|
|
58
|
+
sig { returns(Time) }
|
|
59
|
+
attr_accessor :updated_at
|
|
60
|
+
|
|
61
|
+
# A course from the courses app
|
|
62
|
+
sig do
|
|
63
|
+
params(
|
|
64
|
+
id: String,
|
|
65
|
+
certificate_after_completion_enabled: T.nilable(T::Boolean),
|
|
66
|
+
chapters: T::Array[WhopSDK::Course::Chapter::OrHash],
|
|
67
|
+
created_at: Time,
|
|
68
|
+
description: T.nilable(String),
|
|
69
|
+
language: WhopSDK::Languages::OrSymbol,
|
|
70
|
+
require_completing_lessons_in_order: T::Boolean,
|
|
71
|
+
tagline: T.nilable(String),
|
|
72
|
+
thumbnail: T.nilable(WhopSDK::Course::Thumbnail::OrHash),
|
|
73
|
+
title: T.nilable(String),
|
|
74
|
+
updated_at: Time
|
|
75
|
+
).returns(T.attached_class)
|
|
76
|
+
end
|
|
77
|
+
def self.new(
|
|
78
|
+
# The ID of the course. Looks like cors_XXX
|
|
79
|
+
id:,
|
|
80
|
+
# Whether the course will award its students a PDF certificate after completing
|
|
81
|
+
# all lessons
|
|
82
|
+
certificate_after_completion_enabled:,
|
|
83
|
+
# The chapters in this course
|
|
84
|
+
chapters:,
|
|
85
|
+
# The timestamp of when the course was created
|
|
86
|
+
created_at:,
|
|
87
|
+
# A short description of the course
|
|
88
|
+
description:,
|
|
89
|
+
# The language spoken in the video content of the course, used to generate closed
|
|
90
|
+
# captions in the right language
|
|
91
|
+
language:,
|
|
92
|
+
# Whether the course requires students to complete the previous lesson before
|
|
93
|
+
# moving on to the next one
|
|
94
|
+
require_completing_lessons_in_order:,
|
|
95
|
+
# A short tagline for the course. It is displayed under the course title in the UI
|
|
96
|
+
tagline:,
|
|
97
|
+
# The thumbnail for the course
|
|
98
|
+
thumbnail:,
|
|
99
|
+
# The title of the course
|
|
100
|
+
title:,
|
|
101
|
+
# The timestamp of when the course was last updated
|
|
102
|
+
updated_at:
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
sig do
|
|
107
|
+
override.returns(
|
|
108
|
+
{
|
|
109
|
+
id: String,
|
|
110
|
+
certificate_after_completion_enabled: T.nilable(T::Boolean),
|
|
111
|
+
chapters: T::Array[WhopSDK::Course::Chapter],
|
|
112
|
+
created_at: Time,
|
|
113
|
+
description: T.nilable(String),
|
|
114
|
+
language: WhopSDK::Languages::TaggedSymbol,
|
|
115
|
+
require_completing_lessons_in_order: T::Boolean,
|
|
116
|
+
tagline: T.nilable(String),
|
|
117
|
+
thumbnail: T.nilable(WhopSDK::Course::Thumbnail),
|
|
118
|
+
title: T.nilable(String),
|
|
119
|
+
updated_at: Time
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
def to_hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
class Chapter < WhopSDK::Internal::Type::BaseModel
|
|
127
|
+
OrHash =
|
|
128
|
+
T.type_alias do
|
|
129
|
+
T.any(WhopSDK::Course::Chapter, WhopSDK::Internal::AnyHash)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# The ID of the chapter. Looks like chap_XXX
|
|
133
|
+
sig { returns(String) }
|
|
134
|
+
attr_accessor :id
|
|
135
|
+
|
|
136
|
+
# The lessons in this chapter
|
|
137
|
+
sig { returns(T::Array[WhopSDK::Course::Chapter::Lesson]) }
|
|
138
|
+
attr_accessor :lessons
|
|
139
|
+
|
|
140
|
+
# The order of the chapter within its course
|
|
141
|
+
sig { returns(Integer) }
|
|
142
|
+
attr_accessor :order
|
|
143
|
+
|
|
144
|
+
# The title of the chapter
|
|
145
|
+
sig { returns(String) }
|
|
146
|
+
attr_accessor :title
|
|
147
|
+
|
|
148
|
+
# A chapter from the courses app
|
|
149
|
+
sig do
|
|
150
|
+
params(
|
|
151
|
+
id: String,
|
|
152
|
+
lessons: T::Array[WhopSDK::Course::Chapter::Lesson::OrHash],
|
|
153
|
+
order: Integer,
|
|
154
|
+
title: String
|
|
155
|
+
).returns(T.attached_class)
|
|
156
|
+
end
|
|
157
|
+
def self.new(
|
|
158
|
+
# The ID of the chapter. Looks like chap_XXX
|
|
159
|
+
id:,
|
|
160
|
+
# The lessons in this chapter
|
|
161
|
+
lessons:,
|
|
162
|
+
# The order of the chapter within its course
|
|
163
|
+
order:,
|
|
164
|
+
# The title of the chapter
|
|
165
|
+
title:
|
|
166
|
+
)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
sig do
|
|
170
|
+
override.returns(
|
|
171
|
+
{
|
|
172
|
+
id: String,
|
|
173
|
+
lessons: T::Array[WhopSDK::Course::Chapter::Lesson],
|
|
174
|
+
order: Integer,
|
|
175
|
+
title: String
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
end
|
|
179
|
+
def to_hash
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
class Lesson < WhopSDK::Internal::Type::BaseModel
|
|
183
|
+
OrHash =
|
|
184
|
+
T.type_alias do
|
|
185
|
+
T.any(
|
|
186
|
+
WhopSDK::Course::Chapter::Lesson,
|
|
187
|
+
WhopSDK::Internal::AnyHash
|
|
188
|
+
)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# The ID of the lesson
|
|
192
|
+
sig { returns(String) }
|
|
193
|
+
attr_accessor :id
|
|
194
|
+
|
|
195
|
+
# The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
|
|
196
|
+
sig { returns(WhopSDK::LessonTypes::TaggedSymbol) }
|
|
197
|
+
attr_accessor :lesson_type
|
|
198
|
+
|
|
199
|
+
# The order of the lesson within its chapter
|
|
200
|
+
sig { returns(Integer) }
|
|
201
|
+
attr_accessor :order
|
|
202
|
+
|
|
203
|
+
# The title of the lesson
|
|
204
|
+
sig { returns(String) }
|
|
205
|
+
attr_accessor :title
|
|
206
|
+
|
|
207
|
+
# A lesson from the courses app
|
|
208
|
+
sig do
|
|
209
|
+
params(
|
|
210
|
+
id: String,
|
|
211
|
+
lesson_type: WhopSDK::LessonTypes::OrSymbol,
|
|
212
|
+
order: Integer,
|
|
213
|
+
title: String
|
|
214
|
+
).returns(T.attached_class)
|
|
215
|
+
end
|
|
216
|
+
def self.new(
|
|
217
|
+
# The ID of the lesson
|
|
218
|
+
id:,
|
|
219
|
+
# The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
|
|
220
|
+
lesson_type:,
|
|
221
|
+
# The order of the lesson within its chapter
|
|
222
|
+
order:,
|
|
223
|
+
# The title of the lesson
|
|
224
|
+
title:
|
|
225
|
+
)
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
sig do
|
|
229
|
+
override.returns(
|
|
230
|
+
{
|
|
231
|
+
id: String,
|
|
232
|
+
lesson_type: WhopSDK::LessonTypes::TaggedSymbol,
|
|
233
|
+
order: Integer,
|
|
234
|
+
title: String
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
end
|
|
238
|
+
def to_hash
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
class Thumbnail < WhopSDK::Internal::Type::BaseModel
|
|
244
|
+
OrHash =
|
|
245
|
+
T.type_alias do
|
|
246
|
+
T.any(WhopSDK::Course::Thumbnail, WhopSDK::Internal::AnyHash)
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# The ID of the attachment
|
|
250
|
+
sig { returns(String) }
|
|
251
|
+
attr_accessor :id
|
|
252
|
+
|
|
253
|
+
# The attachment's content type (e.g., image/jpg, video/mp4)
|
|
254
|
+
sig { returns(T.nilable(String)) }
|
|
255
|
+
attr_accessor :content_type
|
|
256
|
+
|
|
257
|
+
# The name of the file
|
|
258
|
+
sig { returns(T.nilable(String)) }
|
|
259
|
+
attr_accessor :filename
|
|
260
|
+
|
|
261
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
262
|
+
# should be used for apps.
|
|
263
|
+
sig { returns(T.nilable(String)) }
|
|
264
|
+
attr_accessor :optimized_url
|
|
265
|
+
|
|
266
|
+
# The original URL of the attachment, such as a direct link to S3. This should
|
|
267
|
+
# never be displayed on the client and always passed to an Imgproxy transformer.
|
|
268
|
+
sig { returns(T.nilable(String)) }
|
|
269
|
+
attr_accessor :source_url
|
|
270
|
+
|
|
271
|
+
# The thumbnail for the course
|
|
272
|
+
sig do
|
|
273
|
+
params(
|
|
274
|
+
id: String,
|
|
275
|
+
content_type: T.nilable(String),
|
|
276
|
+
filename: T.nilable(String),
|
|
277
|
+
optimized_url: T.nilable(String),
|
|
278
|
+
source_url: T.nilable(String)
|
|
279
|
+
).returns(T.attached_class)
|
|
280
|
+
end
|
|
281
|
+
def self.new(
|
|
282
|
+
# The ID of the attachment
|
|
283
|
+
id:,
|
|
284
|
+
# The attachment's content type (e.g., image/jpg, video/mp4)
|
|
285
|
+
content_type:,
|
|
286
|
+
# The name of the file
|
|
287
|
+
filename:,
|
|
288
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
289
|
+
# should be used for apps.
|
|
290
|
+
optimized_url:,
|
|
291
|
+
# The original URL of the attachment, such as a direct link to S3. This should
|
|
292
|
+
# never be displayed on the client and always passed to an Imgproxy transformer.
|
|
293
|
+
source_url:
|
|
294
|
+
)
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
sig do
|
|
298
|
+
override.returns(
|
|
299
|
+
{
|
|
300
|
+
id: String,
|
|
301
|
+
content_type: T.nilable(String),
|
|
302
|
+
filename: T.nilable(String),
|
|
303
|
+
optimized_url: T.nilable(String),
|
|
304
|
+
source_url: T.nilable(String)
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
end
|
|
308
|
+
def to_hash
|
|
309
|
+
end
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
end
|
|
313
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class CourseChapter < WhopSDK::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(WhopSDK::CourseChapter, WhopSDK::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The ID of the chapter. Looks like chap_XXX
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :id
|
|
14
|
+
|
|
15
|
+
# The lessons in this chapter
|
|
16
|
+
sig { returns(T::Array[WhopSDK::CourseChapter::Lesson]) }
|
|
17
|
+
attr_accessor :lessons
|
|
18
|
+
|
|
19
|
+
# The order of the chapter within its course
|
|
20
|
+
sig { returns(Integer) }
|
|
21
|
+
attr_accessor :order
|
|
22
|
+
|
|
23
|
+
# The title of the chapter
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
attr_accessor :title
|
|
26
|
+
|
|
27
|
+
# A chapter from the courses app
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
id: String,
|
|
31
|
+
lessons: T::Array[WhopSDK::CourseChapter::Lesson::OrHash],
|
|
32
|
+
order: Integer,
|
|
33
|
+
title: String
|
|
34
|
+
).returns(T.attached_class)
|
|
35
|
+
end
|
|
36
|
+
def self.new(
|
|
37
|
+
# The ID of the chapter. Looks like chap_XXX
|
|
38
|
+
id:,
|
|
39
|
+
# The lessons in this chapter
|
|
40
|
+
lessons:,
|
|
41
|
+
# The order of the chapter within its course
|
|
42
|
+
order:,
|
|
43
|
+
# The title of the chapter
|
|
44
|
+
title:
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
override.returns(
|
|
50
|
+
{
|
|
51
|
+
id: String,
|
|
52
|
+
lessons: T::Array[WhopSDK::CourseChapter::Lesson],
|
|
53
|
+
order: Integer,
|
|
54
|
+
title: String
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
def to_hash
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class Lesson < WhopSDK::Internal::Type::BaseModel
|
|
62
|
+
OrHash =
|
|
63
|
+
T.type_alias do
|
|
64
|
+
T.any(WhopSDK::CourseChapter::Lesson, WhopSDK::Internal::AnyHash)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# The ID of the lesson
|
|
68
|
+
sig { returns(String) }
|
|
69
|
+
attr_accessor :id
|
|
70
|
+
|
|
71
|
+
# The order of the lesson within its chapter
|
|
72
|
+
sig { returns(Integer) }
|
|
73
|
+
attr_accessor :order
|
|
74
|
+
|
|
75
|
+
# The title of the lesson
|
|
76
|
+
sig { returns(String) }
|
|
77
|
+
attr_accessor :title
|
|
78
|
+
|
|
79
|
+
# A lesson from the courses app
|
|
80
|
+
sig do
|
|
81
|
+
params(id: String, order: Integer, title: String).returns(
|
|
82
|
+
T.attached_class
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
def self.new(
|
|
86
|
+
# The ID of the lesson
|
|
87
|
+
id:,
|
|
88
|
+
# The order of the lesson within its chapter
|
|
89
|
+
order:,
|
|
90
|
+
# The title of the lesson
|
|
91
|
+
title:
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
sig { override.returns({ id: String, order: Integer, title: String }) }
|
|
96
|
+
def to_hash
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class CourseChapterCreateParams < 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::CourseChapterCreateParams, WhopSDK::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the course to create the chapter in
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :course_id
|
|
17
|
+
|
|
18
|
+
# The title of the chapter
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_accessor :title
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
course_id: String,
|
|
25
|
+
title: T.nilable(String),
|
|
26
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
27
|
+
).returns(T.attached_class)
|
|
28
|
+
end
|
|
29
|
+
def self.new(
|
|
30
|
+
# The ID of the course to create the chapter in
|
|
31
|
+
course_id:,
|
|
32
|
+
# The title of the chapter
|
|
33
|
+
title: nil,
|
|
34
|
+
request_options: {}
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
sig do
|
|
39
|
+
override.returns(
|
|
40
|
+
{
|
|
41
|
+
course_id: String,
|
|
42
|
+
title: T.nilable(String),
|
|
43
|
+
request_options: WhopSDK::RequestOptions
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
def to_hash
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|