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
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class Lesson < WhopSDK::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(WhopSDK::Lesson, WhopSDK::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# The ID of the lesson
|
|
10
|
+
sig { returns(String) }
|
|
11
|
+
attr_accessor :id
|
|
12
|
+
|
|
13
|
+
# Assessment questions for quiz/knowledge check lessons
|
|
14
|
+
sig { returns(T::Array[WhopSDK::Lesson::AssessmentQuestion]) }
|
|
15
|
+
attr_accessor :assessment_questions
|
|
16
|
+
|
|
17
|
+
# The attached files in this lesson as a flat array
|
|
18
|
+
sig { returns(T::Array[WhopSDK::Lesson::Attachment]) }
|
|
19
|
+
attr_accessor :attachments
|
|
20
|
+
|
|
21
|
+
# The content of the lesson
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_accessor :content
|
|
24
|
+
|
|
25
|
+
# Number of days from course start until the lesson is unlocked
|
|
26
|
+
sig { returns(T.nilable(Integer)) }
|
|
27
|
+
attr_accessor :days_from_course_start_until_unlock
|
|
28
|
+
|
|
29
|
+
# The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
|
|
30
|
+
sig { returns(WhopSDK::LessonTypes::TaggedSymbol) }
|
|
31
|
+
attr_accessor :lesson_type
|
|
32
|
+
|
|
33
|
+
# The main PDF file for this lesson
|
|
34
|
+
sig { returns(T.nilable(WhopSDK::Lesson::MainPdf)) }
|
|
35
|
+
attr_reader :main_pdf
|
|
36
|
+
|
|
37
|
+
sig { params(main_pdf: T.nilable(WhopSDK::Lesson::MainPdf::OrHash)).void }
|
|
38
|
+
attr_writer :main_pdf
|
|
39
|
+
|
|
40
|
+
# The order of the lesson within its chapter
|
|
41
|
+
sig { returns(Integer) }
|
|
42
|
+
attr_accessor :order
|
|
43
|
+
|
|
44
|
+
# The title of the lesson
|
|
45
|
+
sig { returns(String) }
|
|
46
|
+
attr_accessor :title
|
|
47
|
+
|
|
48
|
+
# The associated Mux asset for video lessons
|
|
49
|
+
sig { returns(T.nilable(WhopSDK::Lesson::VideoAsset)) }
|
|
50
|
+
attr_reader :video_asset
|
|
51
|
+
|
|
52
|
+
sig do
|
|
53
|
+
params(video_asset: T.nilable(WhopSDK::Lesson::VideoAsset::OrHash)).void
|
|
54
|
+
end
|
|
55
|
+
attr_writer :video_asset
|
|
56
|
+
|
|
57
|
+
# The visibility of the lesson. Determines how / whether this lesson is visible to
|
|
58
|
+
# users.
|
|
59
|
+
sig { returns(WhopSDK::LessonVisibilities::TaggedSymbol) }
|
|
60
|
+
attr_accessor :visibility
|
|
61
|
+
|
|
62
|
+
# A lesson from the courses app
|
|
63
|
+
sig do
|
|
64
|
+
params(
|
|
65
|
+
id: String,
|
|
66
|
+
assessment_questions:
|
|
67
|
+
T::Array[WhopSDK::Lesson::AssessmentQuestion::OrHash],
|
|
68
|
+
attachments: T::Array[WhopSDK::Lesson::Attachment::OrHash],
|
|
69
|
+
content: T.nilable(String),
|
|
70
|
+
days_from_course_start_until_unlock: T.nilable(Integer),
|
|
71
|
+
lesson_type: WhopSDK::LessonTypes::OrSymbol,
|
|
72
|
+
main_pdf: T.nilable(WhopSDK::Lesson::MainPdf::OrHash),
|
|
73
|
+
order: Integer,
|
|
74
|
+
title: String,
|
|
75
|
+
video_asset: T.nilable(WhopSDK::Lesson::VideoAsset::OrHash),
|
|
76
|
+
visibility: WhopSDK::LessonVisibilities::OrSymbol
|
|
77
|
+
).returns(T.attached_class)
|
|
78
|
+
end
|
|
79
|
+
def self.new(
|
|
80
|
+
# The ID of the lesson
|
|
81
|
+
id:,
|
|
82
|
+
# Assessment questions for quiz/knowledge check lessons
|
|
83
|
+
assessment_questions:,
|
|
84
|
+
# The attached files in this lesson as a flat array
|
|
85
|
+
attachments:,
|
|
86
|
+
# The content of the lesson
|
|
87
|
+
content:,
|
|
88
|
+
# Number of days from course start until the lesson is unlocked
|
|
89
|
+
days_from_course_start_until_unlock:,
|
|
90
|
+
# The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
|
|
91
|
+
lesson_type:,
|
|
92
|
+
# The main PDF file for this lesson
|
|
93
|
+
main_pdf:,
|
|
94
|
+
# The order of the lesson within its chapter
|
|
95
|
+
order:,
|
|
96
|
+
# The title of the lesson
|
|
97
|
+
title:,
|
|
98
|
+
# The associated Mux asset for video lessons
|
|
99
|
+
video_asset:,
|
|
100
|
+
# The visibility of the lesson. Determines how / whether this lesson is visible to
|
|
101
|
+
# users.
|
|
102
|
+
visibility:
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
sig do
|
|
107
|
+
override.returns(
|
|
108
|
+
{
|
|
109
|
+
id: String,
|
|
110
|
+
assessment_questions: T::Array[WhopSDK::Lesson::AssessmentQuestion],
|
|
111
|
+
attachments: T::Array[WhopSDK::Lesson::Attachment],
|
|
112
|
+
content: T.nilable(String),
|
|
113
|
+
days_from_course_start_until_unlock: T.nilable(Integer),
|
|
114
|
+
lesson_type: WhopSDK::LessonTypes::TaggedSymbol,
|
|
115
|
+
main_pdf: T.nilable(WhopSDK::Lesson::MainPdf),
|
|
116
|
+
order: Integer,
|
|
117
|
+
title: String,
|
|
118
|
+
video_asset: T.nilable(WhopSDK::Lesson::VideoAsset),
|
|
119
|
+
visibility: WhopSDK::LessonVisibilities::TaggedSymbol
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
def to_hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
class AssessmentQuestion < WhopSDK::Internal::Type::BaseModel
|
|
127
|
+
OrHash =
|
|
128
|
+
T.type_alias do
|
|
129
|
+
T.any(
|
|
130
|
+
WhopSDK::Lesson::AssessmentQuestion,
|
|
131
|
+
WhopSDK::Internal::AnyHash
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# The ID of the assessment question
|
|
136
|
+
sig { returns(String) }
|
|
137
|
+
attr_accessor :id
|
|
138
|
+
|
|
139
|
+
# The correct answer for the question. Used for short answer questions
|
|
140
|
+
sig { returns(String) }
|
|
141
|
+
attr_accessor :correct_answer
|
|
142
|
+
|
|
143
|
+
# When the question was created
|
|
144
|
+
sig { returns(Time) }
|
|
145
|
+
attr_accessor :created_at
|
|
146
|
+
|
|
147
|
+
# Optional image attachment for the question
|
|
148
|
+
sig { returns(T.nilable(WhopSDK::Lesson::AssessmentQuestion::Image)) }
|
|
149
|
+
attr_reader :image
|
|
150
|
+
|
|
151
|
+
sig do
|
|
152
|
+
params(
|
|
153
|
+
image: T.nilable(WhopSDK::Lesson::AssessmentQuestion::Image::OrHash)
|
|
154
|
+
).void
|
|
155
|
+
end
|
|
156
|
+
attr_writer :image
|
|
157
|
+
|
|
158
|
+
# The answer options for multiple choice/select questions
|
|
159
|
+
sig { returns(T::Array[WhopSDK::Lesson::AssessmentQuestion::Option]) }
|
|
160
|
+
attr_accessor :options
|
|
161
|
+
|
|
162
|
+
# The order of the question within its lesson
|
|
163
|
+
sig { returns(Integer) }
|
|
164
|
+
attr_accessor :order
|
|
165
|
+
|
|
166
|
+
# The text of the question
|
|
167
|
+
sig { returns(String) }
|
|
168
|
+
attr_accessor :question_text
|
|
169
|
+
|
|
170
|
+
# The type of the question
|
|
171
|
+
sig { returns(WhopSDK::AssessmentQuestionTypes::TaggedSymbol) }
|
|
172
|
+
attr_accessor :question_type
|
|
173
|
+
|
|
174
|
+
# An assessment question in a course quiz or knowledge check
|
|
175
|
+
sig do
|
|
176
|
+
params(
|
|
177
|
+
id: String,
|
|
178
|
+
correct_answer: String,
|
|
179
|
+
created_at: Time,
|
|
180
|
+
image:
|
|
181
|
+
T.nilable(WhopSDK::Lesson::AssessmentQuestion::Image::OrHash),
|
|
182
|
+
options:
|
|
183
|
+
T::Array[WhopSDK::Lesson::AssessmentQuestion::Option::OrHash],
|
|
184
|
+
order: Integer,
|
|
185
|
+
question_text: String,
|
|
186
|
+
question_type: WhopSDK::AssessmentQuestionTypes::OrSymbol
|
|
187
|
+
).returns(T.attached_class)
|
|
188
|
+
end
|
|
189
|
+
def self.new(
|
|
190
|
+
# The ID of the assessment question
|
|
191
|
+
id:,
|
|
192
|
+
# The correct answer for the question. Used for short answer questions
|
|
193
|
+
correct_answer:,
|
|
194
|
+
# When the question was created
|
|
195
|
+
created_at:,
|
|
196
|
+
# Optional image attachment for the question
|
|
197
|
+
image:,
|
|
198
|
+
# The answer options for multiple choice/select questions
|
|
199
|
+
options:,
|
|
200
|
+
# The order of the question within its lesson
|
|
201
|
+
order:,
|
|
202
|
+
# The text of the question
|
|
203
|
+
question_text:,
|
|
204
|
+
# The type of the question
|
|
205
|
+
question_type:
|
|
206
|
+
)
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
sig do
|
|
210
|
+
override.returns(
|
|
211
|
+
{
|
|
212
|
+
id: String,
|
|
213
|
+
correct_answer: String,
|
|
214
|
+
created_at: Time,
|
|
215
|
+
image: T.nilable(WhopSDK::Lesson::AssessmentQuestion::Image),
|
|
216
|
+
options: T::Array[WhopSDK::Lesson::AssessmentQuestion::Option],
|
|
217
|
+
order: Integer,
|
|
218
|
+
question_text: String,
|
|
219
|
+
question_type: WhopSDK::AssessmentQuestionTypes::TaggedSymbol
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
end
|
|
223
|
+
def to_hash
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
class Image < WhopSDK::Internal::Type::BaseModel
|
|
227
|
+
OrHash =
|
|
228
|
+
T.type_alias do
|
|
229
|
+
T.any(
|
|
230
|
+
WhopSDK::Lesson::AssessmentQuestion::Image,
|
|
231
|
+
WhopSDK::Internal::AnyHash
|
|
232
|
+
)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# The ID of the attachment
|
|
236
|
+
sig { returns(String) }
|
|
237
|
+
attr_accessor :id
|
|
238
|
+
|
|
239
|
+
# The attachment's content type (e.g., image/jpg, video/mp4)
|
|
240
|
+
sig { returns(T.nilable(String)) }
|
|
241
|
+
attr_accessor :content_type
|
|
242
|
+
|
|
243
|
+
# The name of the file
|
|
244
|
+
sig { returns(T.nilable(String)) }
|
|
245
|
+
attr_accessor :filename
|
|
246
|
+
|
|
247
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
248
|
+
# should be used for apps.
|
|
249
|
+
sig { returns(T.nilable(String)) }
|
|
250
|
+
attr_accessor :url
|
|
251
|
+
|
|
252
|
+
# Optional image attachment for the question
|
|
253
|
+
sig do
|
|
254
|
+
params(
|
|
255
|
+
id: String,
|
|
256
|
+
content_type: T.nilable(String),
|
|
257
|
+
filename: T.nilable(String),
|
|
258
|
+
url: T.nilable(String)
|
|
259
|
+
).returns(T.attached_class)
|
|
260
|
+
end
|
|
261
|
+
def self.new(
|
|
262
|
+
# The ID of the attachment
|
|
263
|
+
id:,
|
|
264
|
+
# The attachment's content type (e.g., image/jpg, video/mp4)
|
|
265
|
+
content_type:,
|
|
266
|
+
# The name of the file
|
|
267
|
+
filename:,
|
|
268
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
269
|
+
# should be used for apps.
|
|
270
|
+
url:
|
|
271
|
+
)
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
sig do
|
|
275
|
+
override.returns(
|
|
276
|
+
{
|
|
277
|
+
id: String,
|
|
278
|
+
content_type: T.nilable(String),
|
|
279
|
+
filename: T.nilable(String),
|
|
280
|
+
url: T.nilable(String)
|
|
281
|
+
}
|
|
282
|
+
)
|
|
283
|
+
end
|
|
284
|
+
def to_hash
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
class Option < WhopSDK::Internal::Type::BaseModel
|
|
289
|
+
OrHash =
|
|
290
|
+
T.type_alias do
|
|
291
|
+
T.any(
|
|
292
|
+
WhopSDK::Lesson::AssessmentQuestion::Option,
|
|
293
|
+
WhopSDK::Internal::AnyHash
|
|
294
|
+
)
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# The ID of the assessment question option
|
|
298
|
+
sig { returns(String) }
|
|
299
|
+
attr_accessor :id
|
|
300
|
+
|
|
301
|
+
# Whether this option is a correct answer
|
|
302
|
+
sig { returns(T::Boolean) }
|
|
303
|
+
attr_accessor :is_correct
|
|
304
|
+
|
|
305
|
+
# The text of the answer option
|
|
306
|
+
sig { returns(String) }
|
|
307
|
+
attr_accessor :option_text
|
|
308
|
+
|
|
309
|
+
# The order of this option within the question
|
|
310
|
+
sig { returns(Integer) }
|
|
311
|
+
attr_accessor :order
|
|
312
|
+
|
|
313
|
+
# An answer option for a multiple choice or multiple select assessment question
|
|
314
|
+
sig do
|
|
315
|
+
params(
|
|
316
|
+
id: String,
|
|
317
|
+
is_correct: T::Boolean,
|
|
318
|
+
option_text: String,
|
|
319
|
+
order: Integer
|
|
320
|
+
).returns(T.attached_class)
|
|
321
|
+
end
|
|
322
|
+
def self.new(
|
|
323
|
+
# The ID of the assessment question option
|
|
324
|
+
id:,
|
|
325
|
+
# Whether this option is a correct answer
|
|
326
|
+
is_correct:,
|
|
327
|
+
# The text of the answer option
|
|
328
|
+
option_text:,
|
|
329
|
+
# The order of this option within the question
|
|
330
|
+
order:
|
|
331
|
+
)
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
sig do
|
|
335
|
+
override.returns(
|
|
336
|
+
{
|
|
337
|
+
id: String,
|
|
338
|
+
is_correct: T::Boolean,
|
|
339
|
+
option_text: String,
|
|
340
|
+
order: Integer
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
end
|
|
344
|
+
def to_hash
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
class Attachment < WhopSDK::Internal::Type::BaseModel
|
|
350
|
+
OrHash =
|
|
351
|
+
T.type_alias do
|
|
352
|
+
T.any(WhopSDK::Lesson::Attachment, WhopSDK::Internal::AnyHash)
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
# The ID of the attachment
|
|
356
|
+
sig { returns(String) }
|
|
357
|
+
attr_accessor :id
|
|
358
|
+
|
|
359
|
+
# The attachment's content type (e.g., image/jpg, video/mp4)
|
|
360
|
+
sig { returns(T.nilable(String)) }
|
|
361
|
+
attr_accessor :content_type
|
|
362
|
+
|
|
363
|
+
# The name of the file
|
|
364
|
+
sig { returns(T.nilable(String)) }
|
|
365
|
+
attr_accessor :filename
|
|
366
|
+
|
|
367
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
368
|
+
# should be used for apps.
|
|
369
|
+
sig { returns(T.nilable(String)) }
|
|
370
|
+
attr_accessor :url
|
|
371
|
+
|
|
372
|
+
# Represents an image attachment
|
|
373
|
+
sig do
|
|
374
|
+
params(
|
|
375
|
+
id: String,
|
|
376
|
+
content_type: T.nilable(String),
|
|
377
|
+
filename: T.nilable(String),
|
|
378
|
+
url: T.nilable(String)
|
|
379
|
+
).returns(T.attached_class)
|
|
380
|
+
end
|
|
381
|
+
def self.new(
|
|
382
|
+
# The ID of the attachment
|
|
383
|
+
id:,
|
|
384
|
+
# The attachment's content type (e.g., image/jpg, video/mp4)
|
|
385
|
+
content_type:,
|
|
386
|
+
# The name of the file
|
|
387
|
+
filename:,
|
|
388
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
389
|
+
# should be used for apps.
|
|
390
|
+
url:
|
|
391
|
+
)
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
sig do
|
|
395
|
+
override.returns(
|
|
396
|
+
{
|
|
397
|
+
id: String,
|
|
398
|
+
content_type: T.nilable(String),
|
|
399
|
+
filename: T.nilable(String),
|
|
400
|
+
url: T.nilable(String)
|
|
401
|
+
}
|
|
402
|
+
)
|
|
403
|
+
end
|
|
404
|
+
def to_hash
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
class MainPdf < WhopSDK::Internal::Type::BaseModel
|
|
409
|
+
OrHash =
|
|
410
|
+
T.type_alias do
|
|
411
|
+
T.any(WhopSDK::Lesson::MainPdf, WhopSDK::Internal::AnyHash)
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
# The ID of the attachment
|
|
415
|
+
sig { returns(String) }
|
|
416
|
+
attr_accessor :id
|
|
417
|
+
|
|
418
|
+
# The attachment's content type (e.g., image/jpg, video/mp4)
|
|
419
|
+
sig { returns(T.nilable(String)) }
|
|
420
|
+
attr_accessor :content_type
|
|
421
|
+
|
|
422
|
+
# The name of the file
|
|
423
|
+
sig { returns(T.nilable(String)) }
|
|
424
|
+
attr_accessor :filename
|
|
425
|
+
|
|
426
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
427
|
+
# should be used for apps.
|
|
428
|
+
sig { returns(T.nilable(String)) }
|
|
429
|
+
attr_accessor :url
|
|
430
|
+
|
|
431
|
+
# The main PDF file for this lesson
|
|
432
|
+
sig do
|
|
433
|
+
params(
|
|
434
|
+
id: String,
|
|
435
|
+
content_type: T.nilable(String),
|
|
436
|
+
filename: T.nilable(String),
|
|
437
|
+
url: T.nilable(String)
|
|
438
|
+
).returns(T.attached_class)
|
|
439
|
+
end
|
|
440
|
+
def self.new(
|
|
441
|
+
# The ID of the attachment
|
|
442
|
+
id:,
|
|
443
|
+
# The attachment's content type (e.g., image/jpg, video/mp4)
|
|
444
|
+
content_type:,
|
|
445
|
+
# The name of the file
|
|
446
|
+
filename:,
|
|
447
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
448
|
+
# should be used for apps.
|
|
449
|
+
url:
|
|
450
|
+
)
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
sig do
|
|
454
|
+
override.returns(
|
|
455
|
+
{
|
|
456
|
+
id: String,
|
|
457
|
+
content_type: T.nilable(String),
|
|
458
|
+
filename: T.nilable(String),
|
|
459
|
+
url: T.nilable(String)
|
|
460
|
+
}
|
|
461
|
+
)
|
|
462
|
+
end
|
|
463
|
+
def to_hash
|
|
464
|
+
end
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
class VideoAsset < WhopSDK::Internal::Type::BaseModel
|
|
468
|
+
OrHash =
|
|
469
|
+
T.type_alias do
|
|
470
|
+
T.any(WhopSDK::Lesson::VideoAsset, WhopSDK::Internal::AnyHash)
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
# The ID of the Mux asset
|
|
474
|
+
sig { returns(String) }
|
|
475
|
+
attr_accessor :id
|
|
476
|
+
|
|
477
|
+
# The Mux-provided ID of the asset
|
|
478
|
+
sig { returns(T.nilable(String)) }
|
|
479
|
+
attr_accessor :asset_id
|
|
480
|
+
|
|
481
|
+
# The public playback ID of the Mux asset
|
|
482
|
+
sig { returns(T.nilable(String)) }
|
|
483
|
+
attr_accessor :playback_id
|
|
484
|
+
|
|
485
|
+
# The associated Mux asset for video lessons
|
|
486
|
+
sig do
|
|
487
|
+
params(
|
|
488
|
+
id: String,
|
|
489
|
+
asset_id: T.nilable(String),
|
|
490
|
+
playback_id: T.nilable(String)
|
|
491
|
+
).returns(T.attached_class)
|
|
492
|
+
end
|
|
493
|
+
def self.new(
|
|
494
|
+
# The ID of the Mux asset
|
|
495
|
+
id:,
|
|
496
|
+
# The Mux-provided ID of the asset
|
|
497
|
+
asset_id:,
|
|
498
|
+
# The public playback ID of the Mux asset
|
|
499
|
+
playback_id:
|
|
500
|
+
)
|
|
501
|
+
end
|
|
502
|
+
|
|
503
|
+
sig do
|
|
504
|
+
override.returns(
|
|
505
|
+
{
|
|
506
|
+
id: String,
|
|
507
|
+
asset_id: T.nilable(String),
|
|
508
|
+
playback_id: T.nilable(String)
|
|
509
|
+
}
|
|
510
|
+
)
|
|
511
|
+
end
|
|
512
|
+
def to_hash
|
|
513
|
+
end
|
|
514
|
+
end
|
|
515
|
+
end
|
|
516
|
+
end
|
|
517
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# The available types for a lesson
|
|
6
|
+
module LessonTypes
|
|
7
|
+
extend WhopSDK::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::LessonTypes) }
|
|
10
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
11
|
+
|
|
12
|
+
TEXT = T.let(:text, WhopSDK::LessonTypes::TaggedSymbol)
|
|
13
|
+
VIDEO = T.let(:video, WhopSDK::LessonTypes::TaggedSymbol)
|
|
14
|
+
PDF = T.let(:pdf, WhopSDK::LessonTypes::TaggedSymbol)
|
|
15
|
+
MULTI = T.let(:multi, WhopSDK::LessonTypes::TaggedSymbol)
|
|
16
|
+
QUIZ = T.let(:quiz, WhopSDK::LessonTypes::TaggedSymbol)
|
|
17
|
+
KNOWLEDGE_CHECK =
|
|
18
|
+
T.let(:knowledge_check, WhopSDK::LessonTypes::TaggedSymbol)
|
|
19
|
+
|
|
20
|
+
sig { override.returns(T::Array[WhopSDK::LessonTypes::TaggedSymbol]) }
|
|
21
|
+
def self.values
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# The available visibilities for a lesson. Determines how / whether a lesson is
|
|
6
|
+
# visible to users.
|
|
7
|
+
module LessonVisibilities
|
|
8
|
+
extend WhopSDK::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::LessonVisibilities) }
|
|
11
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
12
|
+
|
|
13
|
+
VISIBLE = T.let(:visible, WhopSDK::LessonVisibilities::TaggedSymbol)
|
|
14
|
+
HIDDEN = T.let(:hidden, WhopSDK::LessonVisibilities::TaggedSymbol)
|
|
15
|
+
|
|
16
|
+
sig do
|
|
17
|
+
override.returns(T::Array[WhopSDK::LessonVisibilities::TaggedSymbol])
|
|
18
|
+
end
|
|
19
|
+
def self.values
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -78,6 +78,10 @@ module WhopSDK
|
|
|
78
78
|
sig { returns(T.nilable(T::Array[WhopSDK::MemberStatuses::OrSymbol])) }
|
|
79
79
|
attr_accessor :statuses
|
|
80
80
|
|
|
81
|
+
# The user IDs to filter the members by
|
|
82
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
83
|
+
attr_accessor :user_ids
|
|
84
|
+
|
|
81
85
|
sig do
|
|
82
86
|
params(
|
|
83
87
|
company_id: String,
|
|
@@ -97,6 +101,7 @@ module WhopSDK
|
|
|
97
101
|
promo_code_ids: T.nilable(T::Array[String]),
|
|
98
102
|
query: T.nilable(String),
|
|
99
103
|
statuses: T.nilable(T::Array[WhopSDK::MemberStatuses::OrSymbol]),
|
|
104
|
+
user_ids: T.nilable(T::Array[String]),
|
|
100
105
|
request_options: WhopSDK::RequestOptions::OrHash
|
|
101
106
|
).returns(T.attached_class)
|
|
102
107
|
end
|
|
@@ -134,6 +139,8 @@ module WhopSDK
|
|
|
134
139
|
query: nil,
|
|
135
140
|
# The statuses to filter the members by
|
|
136
141
|
statuses: nil,
|
|
142
|
+
# The user IDs to filter the members by
|
|
143
|
+
user_ids: nil,
|
|
137
144
|
request_options: {}
|
|
138
145
|
)
|
|
139
146
|
end
|
|
@@ -158,6 +165,7 @@ module WhopSDK
|
|
|
158
165
|
promo_code_ids: T.nilable(T::Array[String]),
|
|
159
166
|
query: T.nilable(String),
|
|
160
167
|
statuses: T.nilable(T::Array[WhopSDK::MemberStatuses::OrSymbol]),
|
|
168
|
+
user_ids: T.nilable(T::Array[String]),
|
|
161
169
|
request_options: WhopSDK::RequestOptions
|
|
162
170
|
}
|
|
163
171
|
)
|
|
@@ -71,6 +71,13 @@ module WhopSDK
|
|
|
71
71
|
sig { params(plan: WhopSDK::Membership::Plan::OrHash).void }
|
|
72
72
|
attr_writer :plan
|
|
73
73
|
|
|
74
|
+
# The Product this Membership grants access to.
|
|
75
|
+
sig { returns(WhopSDK::Membership::Product) }
|
|
76
|
+
attr_reader :product
|
|
77
|
+
|
|
78
|
+
sig { params(product: WhopSDK::Membership::Product::OrHash).void }
|
|
79
|
+
attr_writer :product
|
|
80
|
+
|
|
74
81
|
# The Promo Code that is currently applied to this Membership.
|
|
75
82
|
sig { returns(T.nilable(WhopSDK::Membership::PromoCode)) }
|
|
76
83
|
attr_reader :promo_code
|
|
@@ -124,6 +131,7 @@ module WhopSDK
|
|
|
124
131
|
metadata: T::Hash[Symbol, T.anything],
|
|
125
132
|
payment_collection_paused: T::Boolean,
|
|
126
133
|
plan: WhopSDK::Membership::Plan::OrHash,
|
|
134
|
+
product: WhopSDK::Membership::Product::OrHash,
|
|
127
135
|
promo_code: T.nilable(WhopSDK::Membership::PromoCode::OrHash),
|
|
128
136
|
renewal_period_end: T.nilable(Time),
|
|
129
137
|
renewal_period_start: T.nilable(Time),
|
|
@@ -161,6 +169,8 @@ module WhopSDK
|
|
|
161
169
|
payment_collection_paused:,
|
|
162
170
|
# The Plan this Membership is for.
|
|
163
171
|
plan:,
|
|
172
|
+
# The Product this Membership grants access to.
|
|
173
|
+
product:,
|
|
164
174
|
# The Promo Code that is currently applied to this Membership.
|
|
165
175
|
promo_code:,
|
|
166
176
|
# The timestamp in seconds at which the current billing cycle for this
|
|
@@ -194,6 +204,7 @@ module WhopSDK
|
|
|
194
204
|
metadata: T::Hash[Symbol, T.anything],
|
|
195
205
|
payment_collection_paused: T::Boolean,
|
|
196
206
|
plan: WhopSDK::Membership::Plan,
|
|
207
|
+
product: WhopSDK::Membership::Product,
|
|
197
208
|
promo_code: T.nilable(WhopSDK::Membership::PromoCode),
|
|
198
209
|
renewal_period_end: T.nilable(Time),
|
|
199
210
|
renewal_period_start: T.nilable(Time),
|
|
@@ -281,6 +292,35 @@ module WhopSDK
|
|
|
281
292
|
end
|
|
282
293
|
end
|
|
283
294
|
|
|
295
|
+
class Product < WhopSDK::Internal::Type::BaseModel
|
|
296
|
+
OrHash =
|
|
297
|
+
T.type_alias do
|
|
298
|
+
T.any(WhopSDK::Membership::Product, WhopSDK::Internal::AnyHash)
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# The internal ID of the public product.
|
|
302
|
+
sig { returns(String) }
|
|
303
|
+
attr_accessor :id
|
|
304
|
+
|
|
305
|
+
# The title of the product. Use for Whop 4.0.
|
|
306
|
+
sig { returns(String) }
|
|
307
|
+
attr_accessor :title
|
|
308
|
+
|
|
309
|
+
# The Product this Membership grants access to.
|
|
310
|
+
sig { params(id: String, title: String).returns(T.attached_class) }
|
|
311
|
+
def self.new(
|
|
312
|
+
# The internal ID of the public product.
|
|
313
|
+
id:,
|
|
314
|
+
# The title of the product. Use for Whop 4.0.
|
|
315
|
+
title:
|
|
316
|
+
)
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
sig { override.returns({ id: String, title: String }) }
|
|
320
|
+
def to_hash
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
284
324
|
class PromoCode < WhopSDK::Internal::Type::BaseModel
|
|
285
325
|
OrHash =
|
|
286
326
|
T.type_alias do
|