whop_sdk 0.0.2 → 0.0.4
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 +51 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +24 -0
- data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +30 -24
- data/lib/whop_sdk/models/app_build_create_params.rb +53 -29
- data/lib/whop_sdk/models/app_update_params.rb +53 -29
- 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 +251 -38
- data/lib/whop_sdk/models/checkout_configuration_list_response.rb +10 -7
- data/lib/whop_sdk/models/company.rb +13 -1
- data/lib/whop_sdk/models/company_create_params.rb +46 -0
- data/lib/whop_sdk/models/company_list_params.rb +62 -0
- data/lib/whop_sdk/models/company_list_response.rb +175 -0
- 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 +127 -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 +399 -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_student_list_params.rb +62 -0
- data/lib/whop_sdk/models/course_student_list_response.rb +97 -0
- data/lib/whop_sdk/models/course_student_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/course_student_retrieve_response.rb +149 -0
- data/lib/whop_sdk/models/course_update_params.rb +221 -0
- data/lib/whop_sdk/models/experience_duplicate_params.rb +22 -0
- data/lib/whop_sdk/models/experience_update_params.rb +53 -29
- data/lib/whop_sdk/models/forum_post.rb +17 -1
- data/lib/whop_sdk/models/forum_post_create_params.rb +51 -27
- data/lib/whop_sdk/models/forum_post_list_response.rb +17 -1
- data/lib/whop_sdk/models/forum_post_update_params.rb +104 -0
- data/lib/whop_sdk/models/invoice.rb +6 -2
- data/lib/whop_sdk/models/invoice_create_params.rb +48 -32
- 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 +373 -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_create_params.rb +51 -27
- data/lib/whop_sdk/models/message_update_params.rb +92 -0
- data/lib/whop_sdk/models/payment.rb +34 -22
- data/lib/whop_sdk/models/payment_list_params.rb +3 -18
- data/lib/whop_sdk/models/payment_list_response.rb +34 -22
- data/lib/whop_sdk/models/payment_method_types.rb +99 -0
- data/lib/whop_sdk/models/plan.rb +72 -1
- data/lib/whop_sdk/models/plan_create_params.rb +133 -24
- data/lib/whop_sdk/models/plan_list_response.rb +75 -1
- data/lib/whop_sdk/models/plan_update_params.rb +131 -22
- 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 +76 -23
- 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/transfer.rb +9 -1
- data/lib/whop_sdk/models/transfer_create_params.rb +9 -1
- data/lib/whop_sdk/models/transfer_list_response.rb +9 -1
- data/lib/whop_sdk/models.rb +84 -0
- data/lib/whop_sdk/resources/app_builds.rb +1 -1
- data/lib/whop_sdk/resources/apps.rb +1 -1
- data/lib/whop_sdk/resources/checkout_configurations.rb +8 -6
- data/lib/whop_sdk/resources/companies.rb +70 -0
- data/lib/whop_sdk/resources/course_chapters.rb +151 -0
- data/lib/whop_sdk/resources/course_lesson_interactions.rb +2 -2
- data/lib/whop_sdk/resources/course_lessons.rb +182 -0
- data/lib/whop_sdk/resources/course_students.rb +76 -0
- data/lib/whop_sdk/resources/courses.rb +185 -0
- data/lib/whop_sdk/resources/experiences.rb +34 -1
- data/lib/whop_sdk/resources/forum_posts.rb +34 -1
- data/lib/whop_sdk/resources/invoices.rb +11 -11
- 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 +29 -1
- data/lib/whop_sdk/resources/payments.rb +1 -1
- data/lib/whop_sdk/resources/plans.rb +25 -5
- data/lib/whop_sdk/resources/products.rb +5 -7
- data/lib/whop_sdk/resources/promo_codes.rb +161 -0
- data/lib/whop_sdk/resources/reviews.rb +68 -0
- data/lib/whop_sdk/resources/transfers.rb +3 -1
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +61 -1
- data/rbi/whop_sdk/client.rbi +18 -0
- data/rbi/whop_sdk/models/app_build_create_params.rbi +80 -40
- data/rbi/whop_sdk/models/app_update_params.rbi +86 -37
- 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 +371 -62
- data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +4 -2
- data/rbi/whop_sdk/models/company.rbi +10 -0
- data/rbi/whop_sdk/models/company_create_params.rbi +67 -0
- data/rbi/whop_sdk/models/company_list_params.rbi +83 -0
- data/rbi/whop_sdk/models/company_list_response.rbi +235 -0
- 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 +197 -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 +677 -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_student_list_params.rbi +83 -0
- data/rbi/whop_sdk/models/course_student_list_response.rbi +142 -0
- data/rbi/whop_sdk/models/course_student_retrieve_params.rbi +30 -0
- data/rbi/whop_sdk/models/course_student_retrieve_response.rbi +250 -0
- data/rbi/whop_sdk/models/course_update_params.rbi +339 -0
- data/rbi/whop_sdk/models/experience_duplicate_params.rbi +40 -0
- data/rbi/whop_sdk/models/experience_update_params.rbi +84 -38
- data/rbi/whop_sdk/models/forum_post.rbi +16 -0
- data/rbi/whop_sdk/models/forum_post_create_params.rbi +85 -32
- data/rbi/whop_sdk/models/forum_post_list_response.rbi +16 -0
- data/rbi/whop_sdk/models/forum_post_update_params.rbi +177 -0
- data/rbi/whop_sdk/models/invoice.rbi +4 -2
- data/rbi/whop_sdk/models/invoice_create_params.rbi +58 -44
- 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 +521 -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_create_params.rbi +85 -32
- data/rbi/whop_sdk/models/message_update_params.rbi +167 -0
- data/rbi/whop_sdk/models/payment.rbi +42 -25
- data/rbi/whop_sdk/models/payment_list_params.rbi +3 -63
- data/rbi/whop_sdk/models/payment_list_response.rbi +42 -25
- data/rbi/whop_sdk/models/payment_method_types.rbi +118 -0
- data/rbi/whop_sdk/models/plan.rbi +106 -0
- data/rbi/whop_sdk/models/plan_create_params.rbi +212 -34
- data/rbi/whop_sdk/models/plan_list_response.rbi +118 -0
- data/rbi/whop_sdk/models/plan_update_params.rbi +210 -32
- 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 +136 -33
- 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/transfer.rbi +8 -0
- data/rbi/whop_sdk/models/transfer_create_params.rbi +8 -0
- data/rbi/whop_sdk/models/transfer_list_response.rbi +8 -0
- data/rbi/whop_sdk/models.rbi +84 -0
- data/rbi/whop_sdk/resources/app_builds.rbi +5 -1
- data/rbi/whop_sdk/resources/apps.rbi +7 -1
- data/rbi/whop_sdk/resources/checkout_configurations.rbi +8 -7
- data/rbi/whop_sdk/resources/companies.rbi +63 -0
- data/rbi/whop_sdk/resources/course_chapters.rbi +115 -0
- data/rbi/whop_sdk/resources/course_lesson_interactions.rbi +2 -2
- data/rbi/whop_sdk/resources/course_lessons.rbi +182 -0
- data/rbi/whop_sdk/resources/course_students.rbi +65 -0
- data/rbi/whop_sdk/resources/courses.rbi +172 -0
- data/rbi/whop_sdk/resources/experiences.rbi +32 -1
- data/rbi/whop_sdk/resources/forum_posts.rbi +40 -1
- data/rbi/whop_sdk/resources/invoices.rbi +18 -18
- 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 +36 -1
- data/rbi/whop_sdk/resources/payments.rbi +1 -3
- data/rbi/whop_sdk/resources/plans.rbi +57 -3
- data/rbi/whop_sdk/resources/products.rbi +10 -8
- data/rbi/whop_sdk/resources/promo_codes.rbi +147 -0
- data/rbi/whop_sdk/resources/reviews.rbi +56 -0
- data/rbi/whop_sdk/resources/transfers.rbi +3 -0
- data/sig/whop_sdk/client.rbs +12 -0
- data/sig/whop_sdk/models/app_build_create_params.rbs +29 -10
- data/sig/whop_sdk/models/app_update_params.rbs +29 -10
- 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 +159 -21
- data/sig/whop_sdk/models/company.rbs +5 -0
- data/sig/whop_sdk/models/company_create_params.rbs +41 -0
- data/sig/whop_sdk/models/company_list_params.rbs +51 -0
- data/sig/whop_sdk/models/company_list_response.rbs +109 -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 +87 -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 +248 -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_student_list_params.rbs +51 -0
- data/sig/whop_sdk/models/course_student_list_response.rbs +64 -0
- data/sig/whop_sdk/models/course_student_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/course_student_retrieve_response.rbs +106 -0
- data/sig/whop_sdk/models/course_update_params.rbs +156 -0
- data/sig/whop_sdk/models/experience_duplicate_params.rbs +23 -0
- data/sig/whop_sdk/models/experience_update_params.rbs +29 -10
- data/sig/whop_sdk/models/forum_post.rbs +10 -0
- data/sig/whop_sdk/models/forum_post_create_params.rbs +29 -10
- data/sig/whop_sdk/models/forum_post_list_response.rbs +10 -0
- data/sig/whop_sdk/models/forum_post_update_params.rbs +72 -0
- data/sig/whop_sdk/models/invoice_create_params.rbs +28 -18
- 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_create_params.rbs +29 -10
- data/sig/whop_sdk/models/message_update_params.rbs +67 -0
- data/sig/whop_sdk/models/payment.rbs +17 -12
- data/sig/whop_sdk/models/payment_list_params.rbs +4 -25
- data/sig/whop_sdk/models/payment_list_response.rbs +17 -12
- data/sig/whop_sdk/models/payment_method_types.rbs +182 -0
- data/sig/whop_sdk/models/plan.rbs +47 -0
- data/sig/whop_sdk/models/plan_create_params.rbs +81 -10
- data/sig/whop_sdk/models/plan_list_response.rbs +47 -0
- data/sig/whop_sdk/models/plan_update_params.rbs +81 -10
- 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 +46 -10
- 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/transfer.rbs +5 -0
- data/sig/whop_sdk/models/transfer_create_params.rbs +5 -0
- data/sig/whop_sdk/models/transfer_list_response.rbs +5 -0
- data/sig/whop_sdk/models.rbs +84 -0
- data/sig/whop_sdk/resources/app_builds.rbs +1 -1
- data/sig/whop_sdk/resources/apps.rbs +1 -1
- data/sig/whop_sdk/resources/checkout_configurations.rbs +2 -2
- data/sig/whop_sdk/resources/companies.rbs +18 -0
- data/sig/whop_sdk/resources/course_chapters.rbs +35 -0
- data/sig/whop_sdk/resources/course_lessons.rbs +49 -0
- data/sig/whop_sdk/resources/course_students.rbs +22 -0
- data/sig/whop_sdk/resources/courses.rbs +49 -0
- data/sig/whop_sdk/resources/experiences.rbs +7 -1
- data/sig/whop_sdk/resources/forum_posts.rbs +10 -1
- data/sig/whop_sdk/resources/invoices.rbs +5 -5
- 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 +9 -1
- data/sig/whop_sdk/resources/payments.rbs +1 -1
- data/sig/whop_sdk/resources/plans.rbs +12 -2
- data/sig/whop_sdk/resources/products.rbs +2 -3
- data/sig/whop_sdk/resources/promo_codes.rbs +45 -0
- data/sig/whop_sdk/resources/reviews.rbs +23 -0
- data/sig/whop_sdk/resources/transfers.rbs +1 -0
- metadata +213 -5
- data/lib/whop_sdk/models/invoice_create_response.rb +0 -27
- data/rbi/whop_sdk/models/invoice_create_response.rbi +0 -49
- data/sig/whop_sdk/models/invoice_create_response.rbs +0 -19
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::PromoCodes#create
|
|
6
|
+
class PromoCode < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The ID of the promo.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute amount_off
|
|
14
|
+
# The amount off (% or flat amount) for the promo.
|
|
15
|
+
#
|
|
16
|
+
# @return [Float]
|
|
17
|
+
required :amount_off, Float
|
|
18
|
+
|
|
19
|
+
# @!attribute churned_users_only
|
|
20
|
+
# Restricts promo use to only users who have churned from the company before.
|
|
21
|
+
#
|
|
22
|
+
# @return [Boolean]
|
|
23
|
+
required :churned_users_only, WhopSDK::Internal::Type::Boolean
|
|
24
|
+
|
|
25
|
+
# @!attribute code
|
|
26
|
+
# The specific code used to apply the promo at checkout.
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
required :code, String, nil?: true
|
|
30
|
+
|
|
31
|
+
# @!attribute company
|
|
32
|
+
# The company for the promo code.
|
|
33
|
+
#
|
|
34
|
+
# @return [WhopSDK::Models::PromoCode::Company]
|
|
35
|
+
required :company, -> { WhopSDK::PromoCode::Company }
|
|
36
|
+
|
|
37
|
+
# @!attribute created_at
|
|
38
|
+
# The timestamp of when the promo was created.
|
|
39
|
+
#
|
|
40
|
+
# @return [Time]
|
|
41
|
+
required :created_at, Time
|
|
42
|
+
|
|
43
|
+
# @!attribute currency
|
|
44
|
+
# The monetary currency of the promo code.
|
|
45
|
+
#
|
|
46
|
+
# @return [Symbol, WhopSDK::Models::Currency]
|
|
47
|
+
required :currency, enum: -> { WhopSDK::Currency }
|
|
48
|
+
|
|
49
|
+
# @!attribute duration
|
|
50
|
+
# The duration setting for the promo code
|
|
51
|
+
#
|
|
52
|
+
# @return [Symbol, WhopSDK::Models::PromoDuration, nil]
|
|
53
|
+
required :duration, enum: -> { WhopSDK::PromoDuration }, nil?: true
|
|
54
|
+
|
|
55
|
+
# @!attribute existing_memberships_only
|
|
56
|
+
# Restricts promo use to only be applied to already purchased memberships.
|
|
57
|
+
#
|
|
58
|
+
# @return [Boolean]
|
|
59
|
+
required :existing_memberships_only, WhopSDK::Internal::Type::Boolean
|
|
60
|
+
|
|
61
|
+
# @!attribute expires_at
|
|
62
|
+
# The date/time of when the promo expires.
|
|
63
|
+
#
|
|
64
|
+
# @return [Time, nil]
|
|
65
|
+
required :expires_at, Time, nil?: true
|
|
66
|
+
|
|
67
|
+
# @!attribute new_users_only
|
|
68
|
+
# Restricts promo use to only users who have never purchased from the company
|
|
69
|
+
# before.
|
|
70
|
+
#
|
|
71
|
+
# @return [Boolean]
|
|
72
|
+
required :new_users_only, WhopSDK::Internal::Type::Boolean
|
|
73
|
+
|
|
74
|
+
# @!attribute one_per_customer
|
|
75
|
+
# Restricts promo use to only be applied once per customer.
|
|
76
|
+
#
|
|
77
|
+
# @return [Boolean]
|
|
78
|
+
required :one_per_customer, WhopSDK::Internal::Type::Boolean
|
|
79
|
+
|
|
80
|
+
# @!attribute product
|
|
81
|
+
# The access pass associated with the promo code.
|
|
82
|
+
#
|
|
83
|
+
# @return [WhopSDK::Models::PromoCode::Product, nil]
|
|
84
|
+
required :product, -> { WhopSDK::PromoCode::Product }, nil?: true
|
|
85
|
+
|
|
86
|
+
# @!attribute promo_duration_months
|
|
87
|
+
# The number of months the promo is applied for.
|
|
88
|
+
#
|
|
89
|
+
# @return [Integer, nil]
|
|
90
|
+
required :promo_duration_months, Integer, nil?: true
|
|
91
|
+
|
|
92
|
+
# @!attribute promo_type
|
|
93
|
+
# The type (% or flat amount) of the promo.
|
|
94
|
+
#
|
|
95
|
+
# @return [Symbol, WhopSDK::Models::PromoType]
|
|
96
|
+
required :promo_type, enum: -> { WhopSDK::PromoType }
|
|
97
|
+
|
|
98
|
+
# @!attribute status
|
|
99
|
+
# Indicates if the promo code is live or disabled.
|
|
100
|
+
#
|
|
101
|
+
# @return [Symbol, WhopSDK::Models::PromoCodeStatus]
|
|
102
|
+
required :status, enum: -> { WhopSDK::PromoCodeStatus }
|
|
103
|
+
|
|
104
|
+
# @!attribute stock
|
|
105
|
+
# The quantity limit on the number of uses.
|
|
106
|
+
#
|
|
107
|
+
# @return [Integer]
|
|
108
|
+
required :stock, Integer
|
|
109
|
+
|
|
110
|
+
# @!attribute unlimited_stock
|
|
111
|
+
# Whether or not the promo code has unlimited stock.
|
|
112
|
+
#
|
|
113
|
+
# @return [Boolean]
|
|
114
|
+
required :unlimited_stock, WhopSDK::Internal::Type::Boolean
|
|
115
|
+
|
|
116
|
+
# @!attribute uses
|
|
117
|
+
# The amount of times the promo codes has been used.
|
|
118
|
+
#
|
|
119
|
+
# @return [Integer]
|
|
120
|
+
required :uses, Integer
|
|
121
|
+
|
|
122
|
+
# @!method initialize(id:, amount_off:, churned_users_only:, code:, company:, created_at:, currency:, duration:, existing_memberships_only:, expires_at:, new_users_only:, one_per_customer:, product:, promo_duration_months:, promo_type:, status:, stock:, unlimited_stock:, uses:)
|
|
123
|
+
# Some parameter documentations has been truncated, see
|
|
124
|
+
# {WhopSDK::Models::PromoCode} for more details.
|
|
125
|
+
#
|
|
126
|
+
# An object representing a promo code for a plan.
|
|
127
|
+
#
|
|
128
|
+
# @param id [String] The ID of the promo.
|
|
129
|
+
#
|
|
130
|
+
# @param amount_off [Float] The amount off (% or flat amount) for the promo.
|
|
131
|
+
#
|
|
132
|
+
# @param churned_users_only [Boolean] Restricts promo use to only users who have churned from the company before.
|
|
133
|
+
#
|
|
134
|
+
# @param code [String, nil] The specific code used to apply the promo at checkout.
|
|
135
|
+
#
|
|
136
|
+
# @param company [WhopSDK::Models::PromoCode::Company] The company for the promo code.
|
|
137
|
+
#
|
|
138
|
+
# @param created_at [Time] The timestamp of when the promo was created.
|
|
139
|
+
#
|
|
140
|
+
# @param currency [Symbol, WhopSDK::Models::Currency] The monetary currency of the promo code.
|
|
141
|
+
#
|
|
142
|
+
# @param duration [Symbol, WhopSDK::Models::PromoDuration, nil] The duration setting for the promo code
|
|
143
|
+
#
|
|
144
|
+
# @param existing_memberships_only [Boolean] Restricts promo use to only be applied to already purchased memberships.
|
|
145
|
+
#
|
|
146
|
+
# @param expires_at [Time, nil] The date/time of when the promo expires.
|
|
147
|
+
#
|
|
148
|
+
# @param new_users_only [Boolean] Restricts promo use to only users who have never purchased from the company befo
|
|
149
|
+
#
|
|
150
|
+
# @param one_per_customer [Boolean] Restricts promo use to only be applied once per customer.
|
|
151
|
+
#
|
|
152
|
+
# @param product [WhopSDK::Models::PromoCode::Product, nil] The access pass associated with the promo code.
|
|
153
|
+
#
|
|
154
|
+
# @param promo_duration_months [Integer, nil] The number of months the promo is applied for.
|
|
155
|
+
#
|
|
156
|
+
# @param promo_type [Symbol, WhopSDK::Models::PromoType] The type (% or flat amount) of the promo.
|
|
157
|
+
#
|
|
158
|
+
# @param status [Symbol, WhopSDK::Models::PromoCodeStatus] Indicates if the promo code is live or disabled.
|
|
159
|
+
#
|
|
160
|
+
# @param stock [Integer] The quantity limit on the number of uses.
|
|
161
|
+
#
|
|
162
|
+
# @param unlimited_stock [Boolean] Whether or not the promo code has unlimited stock.
|
|
163
|
+
#
|
|
164
|
+
# @param uses [Integer] The amount of times the promo codes has been used.
|
|
165
|
+
|
|
166
|
+
# @see WhopSDK::Models::PromoCode#company
|
|
167
|
+
class Company < WhopSDK::Internal::Type::BaseModel
|
|
168
|
+
# @!attribute id
|
|
169
|
+
# The ID of the company
|
|
170
|
+
#
|
|
171
|
+
# @return [String]
|
|
172
|
+
required :id, String
|
|
173
|
+
|
|
174
|
+
# @!attribute title
|
|
175
|
+
# The written name of the company.
|
|
176
|
+
#
|
|
177
|
+
# @return [String]
|
|
178
|
+
required :title, String
|
|
179
|
+
|
|
180
|
+
# @!method initialize(id:, title:)
|
|
181
|
+
# The company for the promo code.
|
|
182
|
+
#
|
|
183
|
+
# @param id [String] The ID of the company
|
|
184
|
+
#
|
|
185
|
+
# @param title [String] The written name of the company.
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# @see WhopSDK::Models::PromoCode#product
|
|
189
|
+
class Product < WhopSDK::Internal::Type::BaseModel
|
|
190
|
+
# @!attribute id
|
|
191
|
+
# The internal ID of the public product.
|
|
192
|
+
#
|
|
193
|
+
# @return [String]
|
|
194
|
+
required :id, String
|
|
195
|
+
|
|
196
|
+
# @!attribute title
|
|
197
|
+
# The title of the product. Use for Whop 4.0.
|
|
198
|
+
#
|
|
199
|
+
# @return [String]
|
|
200
|
+
required :title, String
|
|
201
|
+
|
|
202
|
+
# @!method initialize(id:, title:)
|
|
203
|
+
# The access pass associated with the promo code.
|
|
204
|
+
#
|
|
205
|
+
# @param id [String] The internal ID of the public product.
|
|
206
|
+
#
|
|
207
|
+
# @param title [String] The title of the product. Use for Whop 4.0.
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
end
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::PromoCodes#create
|
|
6
|
+
class PromoCodeCreateParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute amount_off
|
|
11
|
+
# The amount off (% or flat amount) for the promo.
|
|
12
|
+
#
|
|
13
|
+
# @return [Float]
|
|
14
|
+
required :amount_off, Float
|
|
15
|
+
|
|
16
|
+
# @!attribute base_currency
|
|
17
|
+
# The monetary currency of the promo code.
|
|
18
|
+
#
|
|
19
|
+
# @return [Symbol, WhopSDK::Models::Currency]
|
|
20
|
+
required :base_currency, enum: -> { WhopSDK::Currency }
|
|
21
|
+
|
|
22
|
+
# @!attribute code
|
|
23
|
+
# The specific code used to apply the promo at checkout.
|
|
24
|
+
#
|
|
25
|
+
# @return [String]
|
|
26
|
+
required :code, String
|
|
27
|
+
|
|
28
|
+
# @!attribute company_id
|
|
29
|
+
# The id of the company to create the promo code for.
|
|
30
|
+
#
|
|
31
|
+
# @return [String]
|
|
32
|
+
required :company_id, String
|
|
33
|
+
|
|
34
|
+
# @!attribute new_users_only
|
|
35
|
+
# Restricts promo use to only users who have never purchased from the company
|
|
36
|
+
# before.
|
|
37
|
+
#
|
|
38
|
+
# @return [Boolean]
|
|
39
|
+
required :new_users_only, WhopSDK::Internal::Type::Boolean
|
|
40
|
+
|
|
41
|
+
# @!attribute promo_duration_months
|
|
42
|
+
# The number of months this promo code is applied and valid for.
|
|
43
|
+
#
|
|
44
|
+
# @return [Integer]
|
|
45
|
+
required :promo_duration_months, Integer
|
|
46
|
+
|
|
47
|
+
# @!attribute promo_type
|
|
48
|
+
# The type (% or flat amount) of the promo.
|
|
49
|
+
#
|
|
50
|
+
# @return [Symbol, WhopSDK::Models::PromoType]
|
|
51
|
+
required :promo_type, enum: -> { WhopSDK::PromoType }
|
|
52
|
+
|
|
53
|
+
# @!attribute churned_users_only
|
|
54
|
+
# Restricts promo use to only users who have churned from the company before.
|
|
55
|
+
#
|
|
56
|
+
# @return [Boolean, nil]
|
|
57
|
+
optional :churned_users_only, WhopSDK::Internal::Type::Boolean, nil?: true
|
|
58
|
+
|
|
59
|
+
# @!attribute existing_memberships_only
|
|
60
|
+
# Whether this promo code is for existing memberships only (cancelations)
|
|
61
|
+
#
|
|
62
|
+
# @return [Boolean, nil]
|
|
63
|
+
optional :existing_memberships_only, WhopSDK::Internal::Type::Boolean, nil?: true
|
|
64
|
+
|
|
65
|
+
# @!attribute expires_at
|
|
66
|
+
# The date/time of when the promo expires.
|
|
67
|
+
#
|
|
68
|
+
# @return [Time, nil]
|
|
69
|
+
optional :expires_at, Time, nil?: true
|
|
70
|
+
|
|
71
|
+
# @!attribute one_per_customer
|
|
72
|
+
# Restricts promo use to only be applied once per customer.
|
|
73
|
+
#
|
|
74
|
+
# @return [Boolean, nil]
|
|
75
|
+
optional :one_per_customer, WhopSDK::Internal::Type::Boolean, nil?: true
|
|
76
|
+
|
|
77
|
+
# @!attribute plan_ids
|
|
78
|
+
# The IDs of the plans that the promo code applies to. If product_id is provided,
|
|
79
|
+
# it will only apply to plans attached to that product
|
|
80
|
+
#
|
|
81
|
+
# @return [Array<String>, nil]
|
|
82
|
+
optional :plan_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true
|
|
83
|
+
|
|
84
|
+
# @!attribute product_id
|
|
85
|
+
# The product to lock the promo code to, if any. If provided will filter out any
|
|
86
|
+
# plan ids not attached to this product
|
|
87
|
+
#
|
|
88
|
+
# @return [String, nil]
|
|
89
|
+
optional :product_id, String, nil?: true
|
|
90
|
+
|
|
91
|
+
# @!attribute stock
|
|
92
|
+
# The quantity limit on the number of uses.
|
|
93
|
+
#
|
|
94
|
+
# @return [Integer, nil]
|
|
95
|
+
optional :stock, Integer, nil?: true
|
|
96
|
+
|
|
97
|
+
# @!attribute unlimited_stock
|
|
98
|
+
# Whether or not the promo code should have unlimited stock.
|
|
99
|
+
#
|
|
100
|
+
# @return [Boolean, nil]
|
|
101
|
+
optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true
|
|
102
|
+
|
|
103
|
+
# @!method initialize(amount_off:, base_currency:, code:, company_id:, new_users_only:, promo_duration_months:, promo_type:, churned_users_only: nil, existing_memberships_only: nil, expires_at: nil, one_per_customer: nil, plan_ids: nil, product_id: nil, stock: nil, unlimited_stock: nil, request_options: {})
|
|
104
|
+
# Some parameter documentations has been truncated, see
|
|
105
|
+
# {WhopSDK::Models::PromoCodeCreateParams} for more details.
|
|
106
|
+
#
|
|
107
|
+
# @param amount_off [Float] The amount off (% or flat amount) for the promo.
|
|
108
|
+
#
|
|
109
|
+
# @param base_currency [Symbol, WhopSDK::Models::Currency] The monetary currency of the promo code.
|
|
110
|
+
#
|
|
111
|
+
# @param code [String] The specific code used to apply the promo at checkout.
|
|
112
|
+
#
|
|
113
|
+
# @param company_id [String] The id of the company to create the promo code for.
|
|
114
|
+
#
|
|
115
|
+
# @param new_users_only [Boolean] Restricts promo use to only users who have never purchased from the company befo
|
|
116
|
+
#
|
|
117
|
+
# @param promo_duration_months [Integer] The number of months this promo code is applied and valid for.
|
|
118
|
+
#
|
|
119
|
+
# @param promo_type [Symbol, WhopSDK::Models::PromoType] The type (% or flat amount) of the promo.
|
|
120
|
+
#
|
|
121
|
+
# @param churned_users_only [Boolean, nil] Restricts promo use to only users who have churned from the company before.
|
|
122
|
+
#
|
|
123
|
+
# @param existing_memberships_only [Boolean, nil] Whether this promo code is for existing memberships only (cancelations)
|
|
124
|
+
#
|
|
125
|
+
# @param expires_at [Time, nil] The date/time of when the promo expires.
|
|
126
|
+
#
|
|
127
|
+
# @param one_per_customer [Boolean, nil] Restricts promo use to only be applied once per customer.
|
|
128
|
+
#
|
|
129
|
+
# @param plan_ids [Array<String>, nil] The IDs of the plans that the promo code applies to. If product_id is provided,
|
|
130
|
+
#
|
|
131
|
+
# @param product_id [String, nil] The product to lock the promo code to, if any. If provided will filter out any p
|
|
132
|
+
#
|
|
133
|
+
# @param stock [Integer, nil] The quantity limit on the number of uses.
|
|
134
|
+
#
|
|
135
|
+
# @param unlimited_stock [Boolean, nil] Whether or not the promo code should have unlimited stock.
|
|
136
|
+
#
|
|
137
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::PromoCodes#delete
|
|
6
|
+
class PromoCodeDeleteParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::PromoCodes#list
|
|
6
|
+
class PromoCodeListParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute company_id
|
|
11
|
+
# The ID of the company to list promo codes for
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :company_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute after
|
|
17
|
+
# Returns the elements in the list that come after the specified cursor.
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :after, String, nil?: true
|
|
21
|
+
|
|
22
|
+
# @!attribute before
|
|
23
|
+
# Returns the elements in the list that come before the specified cursor.
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :before, String, nil?: true
|
|
27
|
+
|
|
28
|
+
# @!attribute first
|
|
29
|
+
# Returns the first _n_ elements from the list.
|
|
30
|
+
#
|
|
31
|
+
# @return [Integer, nil]
|
|
32
|
+
optional :first, Integer, nil?: true
|
|
33
|
+
|
|
34
|
+
# @!attribute last
|
|
35
|
+
# Returns the last _n_ elements from the list.
|
|
36
|
+
#
|
|
37
|
+
# @return [Integer, nil]
|
|
38
|
+
optional :last, Integer, nil?: true
|
|
39
|
+
|
|
40
|
+
# @!attribute plan_ids
|
|
41
|
+
# Filter promo codes by plan ID(s)
|
|
42
|
+
#
|
|
43
|
+
# @return [Array<String>, nil]
|
|
44
|
+
optional :plan_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true
|
|
45
|
+
|
|
46
|
+
# @!attribute product_ids
|
|
47
|
+
# Filter promo codes by product ID(s)
|
|
48
|
+
#
|
|
49
|
+
# @return [Array<String>, nil]
|
|
50
|
+
optional :product_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true
|
|
51
|
+
|
|
52
|
+
# @!attribute status
|
|
53
|
+
# Statuses for promo codes
|
|
54
|
+
#
|
|
55
|
+
# @return [Symbol, WhopSDK::Models::PromoCodeStatus, nil]
|
|
56
|
+
optional :status, enum: -> { WhopSDK::PromoCodeStatus }, nil?: true
|
|
57
|
+
|
|
58
|
+
# @!method initialize(company_id:, after: nil, before: nil, first: nil, last: nil, plan_ids: nil, product_ids: nil, status: nil, request_options: {})
|
|
59
|
+
# @param company_id [String] The ID of the company to list promo codes for
|
|
60
|
+
#
|
|
61
|
+
# @param after [String, nil] Returns the elements in the list that come after the specified cursor.
|
|
62
|
+
#
|
|
63
|
+
# @param before [String, nil] Returns the elements in the list that come before the specified cursor.
|
|
64
|
+
#
|
|
65
|
+
# @param first [Integer, nil] Returns the first _n_ elements from the list.
|
|
66
|
+
#
|
|
67
|
+
# @param last [Integer, nil] Returns the last _n_ elements from the list.
|
|
68
|
+
#
|
|
69
|
+
# @param plan_ids [Array<String>, nil] Filter promo codes by plan ID(s)
|
|
70
|
+
#
|
|
71
|
+
# @param product_ids [Array<String>, nil] Filter promo codes by product ID(s)
|
|
72
|
+
#
|
|
73
|
+
# @param status [Symbol, WhopSDK::Models::PromoCodeStatus, nil] Statuses for promo codes
|
|
74
|
+
#
|
|
75
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::PromoCodes#list
|
|
6
|
+
class PromoCodeListResponse < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The ID of the promo.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute amount_off
|
|
14
|
+
# The amount off (% or flat amount) for the promo.
|
|
15
|
+
#
|
|
16
|
+
# @return [Float]
|
|
17
|
+
required :amount_off, Float
|
|
18
|
+
|
|
19
|
+
# @!attribute churned_users_only
|
|
20
|
+
# Restricts promo use to only users who have churned from the company before.
|
|
21
|
+
#
|
|
22
|
+
# @return [Boolean]
|
|
23
|
+
required :churned_users_only, WhopSDK::Internal::Type::Boolean
|
|
24
|
+
|
|
25
|
+
# @!attribute code
|
|
26
|
+
# The specific code used to apply the promo at checkout.
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
required :code, String, nil?: true
|
|
30
|
+
|
|
31
|
+
# @!attribute created_at
|
|
32
|
+
# The timestamp of when the promo was created.
|
|
33
|
+
#
|
|
34
|
+
# @return [Time]
|
|
35
|
+
required :created_at, Time
|
|
36
|
+
|
|
37
|
+
# @!attribute currency
|
|
38
|
+
# The monetary currency of the promo code.
|
|
39
|
+
#
|
|
40
|
+
# @return [Symbol, WhopSDK::Models::Currency]
|
|
41
|
+
required :currency, enum: -> { WhopSDK::Currency }
|
|
42
|
+
|
|
43
|
+
# @!attribute duration
|
|
44
|
+
# The duration setting for the promo code
|
|
45
|
+
#
|
|
46
|
+
# @return [Symbol, WhopSDK::Models::PromoDuration, nil]
|
|
47
|
+
required :duration, enum: -> { WhopSDK::PromoDuration }, nil?: true
|
|
48
|
+
|
|
49
|
+
# @!attribute existing_memberships_only
|
|
50
|
+
# Restricts promo use to only be applied to already purchased memberships.
|
|
51
|
+
#
|
|
52
|
+
# @return [Boolean]
|
|
53
|
+
required :existing_memberships_only, WhopSDK::Internal::Type::Boolean
|
|
54
|
+
|
|
55
|
+
# @!attribute expires_at
|
|
56
|
+
# The date/time of when the promo expires.
|
|
57
|
+
#
|
|
58
|
+
# @return [Time, nil]
|
|
59
|
+
required :expires_at, Time, nil?: true
|
|
60
|
+
|
|
61
|
+
# @!attribute new_users_only
|
|
62
|
+
# Restricts promo use to only users who have never purchased from the company
|
|
63
|
+
# before.
|
|
64
|
+
#
|
|
65
|
+
# @return [Boolean]
|
|
66
|
+
required :new_users_only, WhopSDK::Internal::Type::Boolean
|
|
67
|
+
|
|
68
|
+
# @!attribute one_per_customer
|
|
69
|
+
# Restricts promo use to only be applied once per customer.
|
|
70
|
+
#
|
|
71
|
+
# @return [Boolean]
|
|
72
|
+
required :one_per_customer, WhopSDK::Internal::Type::Boolean
|
|
73
|
+
|
|
74
|
+
# @!attribute product
|
|
75
|
+
# The access pass associated with the promo code.
|
|
76
|
+
#
|
|
77
|
+
# @return [WhopSDK::Models::PromoCodeListResponse::Product, nil]
|
|
78
|
+
required :product, -> { WhopSDK::Models::PromoCodeListResponse::Product }, nil?: true
|
|
79
|
+
|
|
80
|
+
# @!attribute promo_duration_months
|
|
81
|
+
# The number of months the promo is applied for.
|
|
82
|
+
#
|
|
83
|
+
# @return [Integer, nil]
|
|
84
|
+
required :promo_duration_months, Integer, nil?: true
|
|
85
|
+
|
|
86
|
+
# @!attribute promo_type
|
|
87
|
+
# The type (% or flat amount) of the promo.
|
|
88
|
+
#
|
|
89
|
+
# @return [Symbol, WhopSDK::Models::PromoType]
|
|
90
|
+
required :promo_type, enum: -> { WhopSDK::PromoType }
|
|
91
|
+
|
|
92
|
+
# @!attribute status
|
|
93
|
+
# Indicates if the promo code is live or disabled.
|
|
94
|
+
#
|
|
95
|
+
# @return [Symbol, WhopSDK::Models::PromoCodeStatus]
|
|
96
|
+
required :status, enum: -> { WhopSDK::PromoCodeStatus }
|
|
97
|
+
|
|
98
|
+
# @!attribute stock
|
|
99
|
+
# The quantity limit on the number of uses.
|
|
100
|
+
#
|
|
101
|
+
# @return [Integer]
|
|
102
|
+
required :stock, Integer
|
|
103
|
+
|
|
104
|
+
# @!attribute unlimited_stock
|
|
105
|
+
# Whether or not the promo code has unlimited stock.
|
|
106
|
+
#
|
|
107
|
+
# @return [Boolean]
|
|
108
|
+
required :unlimited_stock, WhopSDK::Internal::Type::Boolean
|
|
109
|
+
|
|
110
|
+
# @!attribute uses
|
|
111
|
+
# The amount of times the promo codes has been used.
|
|
112
|
+
#
|
|
113
|
+
# @return [Integer]
|
|
114
|
+
required :uses, Integer
|
|
115
|
+
|
|
116
|
+
# @!method initialize(id:, amount_off:, churned_users_only:, code:, created_at:, currency:, duration:, existing_memberships_only:, expires_at:, new_users_only:, one_per_customer:, product:, promo_duration_months:, promo_type:, status:, stock:, unlimited_stock:, uses:)
|
|
117
|
+
# Some parameter documentations has been truncated, see
|
|
118
|
+
# {WhopSDK::Models::PromoCodeListResponse} for more details.
|
|
119
|
+
#
|
|
120
|
+
# An object representing a promo code for a plan.
|
|
121
|
+
#
|
|
122
|
+
# @param id [String] The ID of the promo.
|
|
123
|
+
#
|
|
124
|
+
# @param amount_off [Float] The amount off (% or flat amount) for the promo.
|
|
125
|
+
#
|
|
126
|
+
# @param churned_users_only [Boolean] Restricts promo use to only users who have churned from the company before.
|
|
127
|
+
#
|
|
128
|
+
# @param code [String, nil] The specific code used to apply the promo at checkout.
|
|
129
|
+
#
|
|
130
|
+
# @param created_at [Time] The timestamp of when the promo was created.
|
|
131
|
+
#
|
|
132
|
+
# @param currency [Symbol, WhopSDK::Models::Currency] The monetary currency of the promo code.
|
|
133
|
+
#
|
|
134
|
+
# @param duration [Symbol, WhopSDK::Models::PromoDuration, nil] The duration setting for the promo code
|
|
135
|
+
#
|
|
136
|
+
# @param existing_memberships_only [Boolean] Restricts promo use to only be applied to already purchased memberships.
|
|
137
|
+
#
|
|
138
|
+
# @param expires_at [Time, nil] The date/time of when the promo expires.
|
|
139
|
+
#
|
|
140
|
+
# @param new_users_only [Boolean] Restricts promo use to only users who have never purchased from the company befo
|
|
141
|
+
#
|
|
142
|
+
# @param one_per_customer [Boolean] Restricts promo use to only be applied once per customer.
|
|
143
|
+
#
|
|
144
|
+
# @param product [WhopSDK::Models::PromoCodeListResponse::Product, nil] The access pass associated with the promo code.
|
|
145
|
+
#
|
|
146
|
+
# @param promo_duration_months [Integer, nil] The number of months the promo is applied for.
|
|
147
|
+
#
|
|
148
|
+
# @param promo_type [Symbol, WhopSDK::Models::PromoType] The type (% or flat amount) of the promo.
|
|
149
|
+
#
|
|
150
|
+
# @param status [Symbol, WhopSDK::Models::PromoCodeStatus] Indicates if the promo code is live or disabled.
|
|
151
|
+
#
|
|
152
|
+
# @param stock [Integer] The quantity limit on the number of uses.
|
|
153
|
+
#
|
|
154
|
+
# @param unlimited_stock [Boolean] Whether or not the promo code has unlimited stock.
|
|
155
|
+
#
|
|
156
|
+
# @param uses [Integer] The amount of times the promo codes has been used.
|
|
157
|
+
|
|
158
|
+
# @see WhopSDK::Models::PromoCodeListResponse#product
|
|
159
|
+
class Product < WhopSDK::Internal::Type::BaseModel
|
|
160
|
+
# @!attribute id
|
|
161
|
+
# The internal ID of the public product.
|
|
162
|
+
#
|
|
163
|
+
# @return [String]
|
|
164
|
+
required :id, String
|
|
165
|
+
|
|
166
|
+
# @!attribute title
|
|
167
|
+
# The title of the product. Use for Whop 4.0.
|
|
168
|
+
#
|
|
169
|
+
# @return [String]
|
|
170
|
+
required :title, String
|
|
171
|
+
|
|
172
|
+
# @!method initialize(id:, title:)
|
|
173
|
+
# The access pass associated with the promo code.
|
|
174
|
+
#
|
|
175
|
+
# @param id [String] The internal ID of the public product.
|
|
176
|
+
#
|
|
177
|
+
# @param title [String] The title of the product. Use for Whop 4.0.
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::PromoCodes#retrieve
|
|
6
|
+
class PromoCodeRetrieveParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# Statuses for promo codes
|
|
6
|
+
module PromoCodeStatus
|
|
7
|
+
extend WhopSDK::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
ACTIVE = :active
|
|
10
|
+
INACTIVE = :inactive
|
|
11
|
+
ARCHIVED = :archived
|
|
12
|
+
|
|
13
|
+
# @!method self.values
|
|
14
|
+
# @return [Array<Symbol>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# The duration setting for the promo code
|
|
6
|
+
module PromoDuration
|
|
7
|
+
extend WhopSDK::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
FOREVER = :forever
|
|
10
|
+
ONCE = :once
|
|
11
|
+
REPEATING = :repeating
|
|
12
|
+
|
|
13
|
+
# @!method self.values
|
|
14
|
+
# @return [Array<Symbol>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|