whop_sdk 0.0.4 → 0.0.6
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 +40 -0
- data/README.md +4 -7
- data/lib/whop_sdk/client.rb +21 -6
- data/lib/whop_sdk/internal/transport/base_client.rb +7 -1
- data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +6 -2
- data/lib/whop_sdk/models/access_level.rb +1 -1
- data/lib/whop_sdk/models/access_pass_type.rb +2 -1
- data/lib/whop_sdk/models/access_token_create_params.rb +67 -0
- data/lib/whop_sdk/models/access_token_create_response.rb +27 -0
- data/lib/whop_sdk/models/checkout_configuration_create_params.rb +4 -4
- data/lib/whop_sdk/models/company.rb +1 -0
- data/lib/whop_sdk/models/course.rb +18 -1
- data/lib/whop_sdk/models/course_create_params.rb +20 -1
- data/lib/whop_sdk/models/course_lesson_create_params.rb +77 -1
- data/lib/whop_sdk/models/course_lesson_list_response.rb +43 -1
- data/lib/whop_sdk/models/course_lesson_update_params.rb +77 -1
- data/lib/whop_sdk/models/course_list_response.rb +18 -1
- data/lib/whop_sdk/models/course_update_params.rb +19 -1
- data/lib/whop_sdk/models/course_visibilities.rb +17 -0
- data/lib/whop_sdk/models/dispute.rb +672 -0
- data/lib/whop_sdk/models/dispute_created_webhook_event.rb +48 -0
- data/lib/whop_sdk/models/dispute_list_params.rb +62 -0
- data/lib/whop_sdk/models/dispute_list_response.rb +187 -0
- data/lib/whop_sdk/models/dispute_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/dispute_statuses.rb +23 -0
- data/lib/whop_sdk/models/dispute_submit_evidence_params.rb +14 -0
- data/lib/whop_sdk/models/dispute_update_evidence_params.rb +342 -0
- data/lib/whop_sdk/models/dispute_updated_webhook_event.rb +48 -0
- data/lib/whop_sdk/models/embed_type.rb +16 -0
- data/lib/whop_sdk/models/entry.rb +3 -3
- data/lib/whop_sdk/models/entry_list_response.rb +3 -3
- data/lib/whop_sdk/models/experience.rb +5 -6
- data/lib/whop_sdk/models/forum_post.rb +2 -2
- data/lib/whop_sdk/models/forum_post_list_response.rb +2 -2
- data/lib/whop_sdk/models/global_affiliate_status.rb +1 -1
- data/lib/whop_sdk/models/invoice_create_params.rb +2 -2
- data/lib/whop_sdk/models/invoice_list_params.rb +27 -40
- data/lib/whop_sdk/models/lesson.rb +43 -1
- data/lib/whop_sdk/models/member_list_params.rb +11 -11
- data/lib/whop_sdk/models/member_list_response.rb +3 -3
- data/lib/whop_sdk/models/member_retrieve_response.rb +3 -3
- data/lib/whop_sdk/models/membership_list_params.rb +9 -9
- data/lib/whop_sdk/models/message.rb +2 -2
- data/lib/whop_sdk/models/message_list_response.rb +2 -2
- data/lib/whop_sdk/models/notification_create_params.rb +88 -0
- data/lib/whop_sdk/models/notification_create_response.rb +19 -0
- data/lib/whop_sdk/models/payment.rb +3 -3
- data/lib/whop_sdk/models/payment_list_response.rb +3 -3
- data/lib/whop_sdk/models/plan.rb +6 -4
- data/lib/whop_sdk/models/plan_create_params.rb +2 -2
- data/lib/whop_sdk/models/plan_list_response.rb +6 -4
- data/lib/whop_sdk/models/plan_type.rb +1 -1
- data/lib/whop_sdk/models/product.rb +1 -1
- data/lib/whop_sdk/models/product_create_params.rb +6 -6
- data/lib/whop_sdk/models/product_list_item.rb +1 -1
- data/lib/whop_sdk/models/product_update_params.rb +4 -4
- data/lib/whop_sdk/models/promo_code.rb +3 -3
- data/lib/whop_sdk/models/promo_code_list_response.rb +3 -3
- data/lib/whop_sdk/models/unwrap_webhook_event.rb +5 -1
- data/lib/whop_sdk/models.rb +24 -0
- data/lib/whop_sdk/resources/access_tokens.rb +46 -0
- data/lib/whop_sdk/resources/app_builds.rb +4 -2
- data/lib/whop_sdk/resources/apps.rb +3 -2
- data/lib/whop_sdk/resources/authorized_users.rb +2 -1
- data/lib/whop_sdk/resources/chat_channels.rb +9 -2
- data/lib/whop_sdk/resources/checkout_configurations.rb +2 -1
- data/lib/whop_sdk/resources/companies.rb +2 -1
- data/lib/whop_sdk/resources/course_chapters.rb +5 -3
- data/lib/whop_sdk/resources/course_lesson_interactions.rb +2 -1
- data/lib/whop_sdk/resources/course_lessons.rb +19 -5
- data/lib/whop_sdk/resources/course_students.rb +2 -1
- data/lib/whop_sdk/resources/courses.rb +15 -5
- data/lib/whop_sdk/resources/disputes.rb +182 -0
- data/lib/whop_sdk/resources/entries.rb +6 -3
- data/lib/whop_sdk/resources/experiences.rb +8 -6
- data/lib/whop_sdk/resources/forum_posts.rb +3 -2
- data/lib/whop_sdk/resources/forums.rb +3 -2
- data/lib/whop_sdk/resources/invoices.rb +11 -5
- data/lib/whop_sdk/resources/ledger_accounts.rb +6 -2
- data/lib/whop_sdk/resources/members.rb +6 -5
- data/lib/whop_sdk/resources/memberships.rb +10 -8
- data/lib/whop_sdk/resources/messages.rb +3 -2
- data/lib/whop_sdk/resources/notifications.rb +53 -0
- data/lib/whop_sdk/resources/payments.rb +7 -4
- data/lib/whop_sdk/resources/plans.rb +6 -4
- data/lib/whop_sdk/resources/products.rb +9 -7
- data/lib/whop_sdk/resources/promo_codes.rb +4 -2
- data/lib/whop_sdk/resources/reactions.rb +2 -1
- data/lib/whop_sdk/resources/reviews.rb +2 -1
- data/lib/whop_sdk/resources/shipments.rb +2 -1
- data/lib/whop_sdk/resources/support_channels.rb +2 -1
- data/lib/whop_sdk/resources/transfers.rb +2 -1
- data/lib/whop_sdk/resources/users.rb +9 -3
- data/lib/whop_sdk/resources/webhooks.rb +1 -1
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +19 -0
- data/manifest.yaml +1 -0
- data/rbi/whop_sdk/client.rbi +14 -2
- data/rbi/whop_sdk/internal/transport/base_client.rbi +5 -0
- data/rbi/whop_sdk/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/whop_sdk/internal/type/base_model.rbi +8 -4
- data/rbi/whop_sdk/models/access_level.rbi +1 -1
- data/rbi/whop_sdk/models/access_pass_type.rbi +2 -1
- data/rbi/whop_sdk/models/access_token_create_params.rbi +126 -0
- data/rbi/whop_sdk/models/access_token_create_response.rbi +37 -0
- data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +4 -4
- data/rbi/whop_sdk/models/company.rbi +2 -0
- data/rbi/whop_sdk/models/course.rbi +21 -3
- data/rbi/whop_sdk/models/course_create_params.rbi +22 -0
- data/rbi/whop_sdk/models/course_lesson_create_params.rbi +126 -0
- data/rbi/whop_sdk/models/course_lesson_list_response.rbi +68 -0
- data/rbi/whop_sdk/models/course_lesson_update_params.rbi +126 -0
- data/rbi/whop_sdk/models/course_list_response.rbi +21 -3
- data/rbi/whop_sdk/models/course_update_params.rbi +20 -0
- data/rbi/whop_sdk/models/course_visibilities.rbi +23 -0
- data/rbi/whop_sdk/models/dispute.rbi +938 -0
- data/rbi/whop_sdk/models/dispute_created_webhook_event.rbi +72 -0
- data/rbi/whop_sdk/models/dispute_list_params.rbi +83 -0
- data/rbi/whop_sdk/models/dispute_list_response.rbi +287 -0
- data/rbi/whop_sdk/models/dispute_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/dispute_statuses.rbi +32 -0
- data/rbi/whop_sdk/models/dispute_submit_evidence_params.rbi +30 -0
- data/rbi/whop_sdk/models/dispute_update_evidence_params.rbi +566 -0
- data/rbi/whop_sdk/models/dispute_updated_webhook_event.rbi +72 -0
- data/rbi/whop_sdk/models/embed_type.rbi +20 -0
- data/rbi/whop_sdk/models/entry.rbi +3 -3
- data/rbi/whop_sdk/models/entry_list_response.rbi +3 -3
- data/rbi/whop_sdk/models/experience.rbi +7 -9
- data/rbi/whop_sdk/models/forum_post.rbi +2 -2
- data/rbi/whop_sdk/models/forum_post_list_response.rbi +2 -2
- data/rbi/whop_sdk/models/global_affiliate_status.rbi +1 -1
- data/rbi/whop_sdk/models/invoice_create_params.rbi +2 -2
- data/rbi/whop_sdk/models/invoice_list_params.rbi +26 -71
- data/rbi/whop_sdk/models/lesson.rbi +54 -0
- data/rbi/whop_sdk/models/member_list_params.rbi +10 -10
- data/rbi/whop_sdk/models/member_list_response.rbi +6 -6
- data/rbi/whop_sdk/models/member_retrieve_response.rbi +6 -6
- data/rbi/whop_sdk/models/membership_list_params.rbi +8 -8
- data/rbi/whop_sdk/models/message.rbi +2 -2
- data/rbi/whop_sdk/models/message_list_response.rbi +2 -2
- data/rbi/whop_sdk/models/notification_create_params.rbi +113 -0
- data/rbi/whop_sdk/models/notification_create_response.rbi +31 -0
- data/rbi/whop_sdk/models/payment.rbi +3 -3
- data/rbi/whop_sdk/models/payment_list_response.rbi +3 -3
- data/rbi/whop_sdk/models/plan.rbi +6 -4
- data/rbi/whop_sdk/models/plan_create_params.rbi +2 -2
- data/rbi/whop_sdk/models/plan_list_response.rbi +6 -4
- data/rbi/whop_sdk/models/plan_type.rbi +1 -1
- data/rbi/whop_sdk/models/product.rbi +1 -1
- data/rbi/whop_sdk/models/product_create_params.rbi +6 -6
- data/rbi/whop_sdk/models/product_list_item.rbi +1 -1
- data/rbi/whop_sdk/models/product_update_params.rbi +4 -4
- data/rbi/whop_sdk/models/promo_code.rbi +3 -3
- data/rbi/whop_sdk/models/promo_code_list_response.rbi +3 -3
- data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -1
- data/rbi/whop_sdk/models.rbi +24 -0
- data/rbi/whop_sdk/resources/access_tokens.rbi +41 -0
- data/rbi/whop_sdk/resources/app_builds.rbi +10 -2
- data/rbi/whop_sdk/resources/apps.rbi +6 -1
- data/rbi/whop_sdk/resources/authorized_users.rbi +5 -1
- data/rbi/whop_sdk/resources/chat_channels.rbi +8 -1
- data/rbi/whop_sdk/resources/checkout_configurations.rbi +5 -1
- data/rbi/whop_sdk/resources/companies.rbi +5 -1
- data/rbi/whop_sdk/resources/course_chapters.rbi +11 -2
- data/rbi/whop_sdk/resources/course_lesson_interactions.rbi +5 -1
- data/rbi/whop_sdk/resources/course_lessons.rbi +41 -2
- data/rbi/whop_sdk/resources/course_students.rbi +5 -1
- data/rbi/whop_sdk/resources/courses.rbi +28 -2
- data/rbi/whop_sdk/resources/disputes.rbi +194 -0
- data/rbi/whop_sdk/resources/entries.rbi +15 -3
- data/rbi/whop_sdk/resources/experiences.rbi +14 -2
- data/rbi/whop_sdk/resources/forum_posts.rbi +6 -1
- data/rbi/whop_sdk/resources/forums.rbi +6 -1
- data/rbi/whop_sdk/resources/invoices.rbi +20 -5
- data/rbi/whop_sdk/resources/ledger_accounts.rbi +7 -2
- data/rbi/whop_sdk/resources/members.rbi +9 -5
- data/rbi/whop_sdk/resources/memberships.rbi +16 -5
- data/rbi/whop_sdk/resources/messages.rbi +6 -1
- data/rbi/whop_sdk/resources/notifications.rbi +54 -0
- data/rbi/whop_sdk/resources/payments.rbi +16 -3
- data/rbi/whop_sdk/resources/plans.rbi +12 -3
- data/rbi/whop_sdk/resources/products.rbi +15 -6
- data/rbi/whop_sdk/resources/promo_codes.rbi +10 -2
- data/rbi/whop_sdk/resources/reactions.rbi +5 -1
- data/rbi/whop_sdk/resources/reviews.rbi +5 -1
- data/rbi/whop_sdk/resources/shipments.rbi +5 -1
- data/rbi/whop_sdk/resources/support_channels.rbi +5 -1
- data/rbi/whop_sdk/resources/transfers.rbi +5 -1
- data/rbi/whop_sdk/resources/users.rbi +13 -2
- data/rbi/whop_sdk/resources/webhooks.rbi +3 -1
- data/sig/whop_sdk/client.rbs +7 -1
- data/sig/whop_sdk/internal/transport/base_client.rbs +2 -0
- data/sig/whop_sdk/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/whop_sdk/models/access_token_create_params.rbs +56 -0
- data/sig/whop_sdk/models/access_token_create_response.rbs +15 -0
- data/sig/whop_sdk/models/company.rbs +2 -0
- data/sig/whop_sdk/models/course.rbs +13 -3
- data/sig/whop_sdk/models/course_create_params.rbs +11 -1
- data/sig/whop_sdk/models/course_lesson_create_params.rbs +46 -0
- data/sig/whop_sdk/models/course_lesson_list_response.rbs +25 -0
- data/sig/whop_sdk/models/course_lesson_update_params.rbs +46 -0
- data/sig/whop_sdk/models/course_list_response.rbs +13 -3
- data/sig/whop_sdk/models/course_update_params.rbs +11 -1
- data/sig/whop_sdk/models/course_visibilities.rbs +14 -0
- data/sig/whop_sdk/models/dispute.rbs +437 -0
- data/sig/whop_sdk/models/dispute_created_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/dispute_list_params.rbs +51 -0
- data/sig/whop_sdk/models/dispute_list_response.rbs +124 -0
- data/sig/whop_sdk/models/dispute_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/dispute_statuses.rbs +30 -0
- data/sig/whop_sdk/models/dispute_submit_evidence_params.rbs +15 -0
- data/sig/whop_sdk/models/dispute_update_evidence_params.rbs +215 -0
- data/sig/whop_sdk/models/dispute_updated_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/embed_type.rbs +14 -0
- data/sig/whop_sdk/models/invoice_list_params.rbs +16 -33
- data/sig/whop_sdk/models/lesson.rbs +25 -0
- data/sig/whop_sdk/models/member_list_params.rbs +5 -5
- data/sig/whop_sdk/models/membership_list_params.rbs +5 -5
- data/sig/whop_sdk/models/notification_create_params.rbs +61 -0
- data/sig/whop_sdk/models/notification_create_response.rbs +13 -0
- data/sig/whop_sdk/models/unwrap_webhook_event.rbs +2 -0
- data/sig/whop_sdk/models.rbs +24 -0
- data/sig/whop_sdk/resources/access_tokens.rbs +15 -0
- data/sig/whop_sdk/resources/course_lessons.rbs +6 -0
- data/sig/whop_sdk/resources/courses.rbs +4 -0
- data/sig/whop_sdk/resources/disputes.rbs +46 -0
- data/sig/whop_sdk/resources/invoices.rbs +3 -1
- data/sig/whop_sdk/resources/members.rbs +1 -1
- data/sig/whop_sdk/resources/memberships.rbs +1 -1
- data/sig/whop_sdk/resources/notifications.rbs +19 -0
- data/sig/whop_sdk/resources/webhooks.rbs +3 -1
- metadata +56 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 732d86cb6f20a898b79b19dc92e2404632edcf05d822e0e1b7b922647b61e932
|
|
4
|
+
data.tar.gz: c056debc5fdb1000cd5262befd3fced0a578b45ad0ac8010e11b6ea9cd9cad14
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2763f3095b8e970464194a4eb59e86b69e8459a0efca643db385d1cc0ae01fd0c78cf0f6587be07a27320e4bd4040a4c0249fc11a7661c58396a9e273f10ddc
|
|
7
|
+
data.tar.gz: d79ef16946f2a1e1fe950af483e8c4beceb50eb026ebf872ef1662bfcdb72b03d6051cb3a89e84ec17de393ea352ee77e799447945a3759fd2429aef6389ed89
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.6 (2025-11-10)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.0.5...v0.0.6](https://github.com/whopio/whopsdk-ruby/compare/v0.0.5...v0.0.6)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([40bd47a](https://github.com/whopio/whopsdk-ruby/commit/40bd47ab707c869f865202b879d2818a1365c785))
|
|
10
|
+
* **api:** manual updates ([59f44e4](https://github.com/whopio/whopsdk-ruby/commit/59f44e454e7c1727a1d8566b316f7e61e98ce00b))
|
|
11
|
+
* **api:** manual updates ([f4dcf3a](https://github.com/whopio/whopsdk-ruby/commit/f4dcf3a5be316eaa0452b4786c7c986c75a3d8b2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **api:** allow optional app id in constructor ([#4](https://github.com/whopio/whopsdk-ruby/issues/4)) ([7e6bd87](https://github.com/whopio/whopsdk-ruby/commit/7e6bd873a73acb9f76c24a51945f94fb0eb65d13))
|
|
17
|
+
|
|
18
|
+
## 0.0.5 (2025-11-08)
|
|
19
|
+
|
|
20
|
+
Full Changelog: [v0.0.4...v0.0.5](https://github.com/whopio/whopsdk-ruby/compare/v0.0.4...v0.0.5)
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **api:** api update ([004569d](https://github.com/whopio/whopsdk-ruby/commit/004569d4a072e5601649fa95ac7ef94e2899ff27))
|
|
25
|
+
* **api:** api update ([9d6bd6c](https://github.com/whopio/whopsdk-ruby/commit/9d6bd6cc2175d40a88de394eab0c46d419b959a3))
|
|
26
|
+
* **api:** api update ([b3c2d9f](https://github.com/whopio/whopsdk-ruby/commit/b3c2d9fc0e1e4a3bf25dc220d347bd44e07e5583))
|
|
27
|
+
* **api:** api update ([d7313ca](https://github.com/whopio/whopsdk-ruby/commit/d7313cac52bdc1dcc76d1154418c97c24b84d381))
|
|
28
|
+
* **api:** api update ([02d0ec1](https://github.com/whopio/whopsdk-ruby/commit/02d0ec11a555f7d5a16827c4b6d9c4010ef14bd2))
|
|
29
|
+
* **api:** api update ([9995686](https://github.com/whopio/whopsdk-ruby/commit/9995686b5552d60a39f8523d7c0052cf5b1acfd5))
|
|
30
|
+
* **api:** api update ([53eb5c1](https://github.com/whopio/whopsdk-ruby/commit/53eb5c18cb24f630d6353fa7c1281fc97d7c5292))
|
|
31
|
+
* **api:** manual updates ([55961b2](https://github.com/whopio/whopsdk-ruby/commit/55961b26868a3df976aa07393fff947df5fdebe7))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* better thread safety via early initializing SSL store during HTTP client creation ([80ee4a2](https://github.com/whopio/whopsdk-ruby/commit/80ee4a25aac1e217cfdfac3443280f23391a5afa))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Chores
|
|
40
|
+
|
|
41
|
+
* bump dependency version and update sorbet types ([70e8094](https://github.com/whopio/whopsdk-ruby/commit/70e8094874d1701d0162b92d1a788abcb3ea4335))
|
|
42
|
+
|
|
3
43
|
## 0.0.4 (2025-11-02)
|
|
4
44
|
|
|
5
45
|
Full Changelog: [v0.0.3...v0.0.4](https://github.com/whopio/whopsdk-ruby/compare/v0.0.3...v0.0.4)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "whop_sdk", "~> 0.0.
|
|
20
|
+
gem "whop_sdk", "~> 0.0.6"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -29,8 +29,7 @@ require "bundler/setup"
|
|
|
29
29
|
require "whop_sdk"
|
|
30
30
|
|
|
31
31
|
whop = WhopSDK::Client.new(
|
|
32
|
-
api_key: ENV["WHOP_API_KEY"]
|
|
33
|
-
app_id: "app_xxxxxxxxxxxxxx"
|
|
32
|
+
api_key: ENV["WHOP_API_KEY"] # This is the default and can be omitted
|
|
34
33
|
)
|
|
35
34
|
|
|
36
35
|
page = whop.payments.list(company_id: "biz_xxxxxxxxxxxxxx")
|
|
@@ -111,8 +110,7 @@ You can use the `max_retries` option to configure or disable this:
|
|
|
111
110
|
```ruby
|
|
112
111
|
# Configure the default for all requests:
|
|
113
112
|
whop = WhopSDK::Client.new(
|
|
114
|
-
max_retries: 0
|
|
115
|
-
app_id: "app_xxxxxxxxxxxxxx"
|
|
113
|
+
max_retries: 0 # default is 2
|
|
116
114
|
)
|
|
117
115
|
|
|
118
116
|
# Or, configure per-request:
|
|
@@ -126,8 +124,7 @@ By default, requests will time out after 60 seconds. You can use the timeout opt
|
|
|
126
124
|
```ruby
|
|
127
125
|
# Configure the default for all requests:
|
|
128
126
|
whop = WhopSDK::Client.new(
|
|
129
|
-
timeout: nil
|
|
130
|
-
app_id: "app_xxxxxxxxxxxxxx"
|
|
127
|
+
timeout: nil # default is 60
|
|
131
128
|
)
|
|
132
129
|
|
|
133
130
|
# Or, configure per-request:
|
data/lib/whop_sdk/client.rb
CHANGED
|
@@ -19,7 +19,9 @@ module WhopSDK
|
|
|
19
19
|
# @return [String]
|
|
20
20
|
attr_reader :api_key
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# When using the SDK in app mode pass this parameter to allow verifying user
|
|
23
|
+
# tokens
|
|
24
|
+
# @return [String, nil]
|
|
23
25
|
attr_reader :app_id
|
|
24
26
|
|
|
25
27
|
# @return [WhopSDK::Resources::Apps]
|
|
@@ -115,6 +117,15 @@ module WhopSDK
|
|
|
115
117
|
# @return [WhopSDK::Resources::CourseStudents]
|
|
116
118
|
attr_reader :course_students
|
|
117
119
|
|
|
120
|
+
# @return [WhopSDK::Resources::AccessTokens]
|
|
121
|
+
attr_reader :access_tokens
|
|
122
|
+
|
|
123
|
+
# @return [WhopSDK::Resources::Notifications]
|
|
124
|
+
attr_reader :notifications
|
|
125
|
+
|
|
126
|
+
# @return [WhopSDK::Resources::Disputes]
|
|
127
|
+
attr_reader :disputes
|
|
128
|
+
|
|
118
129
|
# @api private
|
|
119
130
|
#
|
|
120
131
|
# @return [Hash{String=>String}]
|
|
@@ -129,7 +140,8 @@ module WhopSDK
|
|
|
129
140
|
# @param api_key [String, nil] The app API key from an app from the /dashboard/developer page Defaults to
|
|
130
141
|
# `ENV["WHOP_API_KEY"]`
|
|
131
142
|
#
|
|
132
|
-
# @param app_id [String, nil]
|
|
143
|
+
# @param app_id [String, nil] When using the SDK in app mode pass this parameter to allow verifying user
|
|
144
|
+
# tokens Defaults to `ENV["WHOP_APP_ID"]`
|
|
133
145
|
#
|
|
134
146
|
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
|
|
135
147
|
# `"https://api.example.com/v2/"`. Defaults to `ENV["WHOP_BASE_URL"]`
|
|
@@ -152,15 +164,12 @@ module WhopSDK
|
|
|
152
164
|
)
|
|
153
165
|
base_url ||= "https://api.whop.com/api/v1"
|
|
154
166
|
|
|
155
|
-
if app_id.nil?
|
|
156
|
-
raise ArgumentError.new("app_id is required, and can be set via environ: \"WHOP_APP_ID\"")
|
|
157
|
-
end
|
|
158
167
|
if api_key.nil?
|
|
159
168
|
raise ArgumentError.new("api_key is required, and can be set via environ: \"WHOP_API_KEY\"")
|
|
160
169
|
end
|
|
161
170
|
|
|
162
171
|
headers = {
|
|
163
|
-
"x-whop-app-id" => (@app_id = app_id
|
|
172
|
+
"x-whop-app-id" => (@app_id = app_id&.to_s)
|
|
164
173
|
}
|
|
165
174
|
|
|
166
175
|
@api_key = api_key.to_s
|
|
@@ -205,6 +214,9 @@ module WhopSDK
|
|
|
205
214
|
@course_lessons = WhopSDK::Resources::CourseLessons.new(client: self)
|
|
206
215
|
@reviews = WhopSDK::Resources::Reviews.new(client: self)
|
|
207
216
|
@course_students = WhopSDK::Resources::CourseStudents.new(client: self)
|
|
217
|
+
@access_tokens = WhopSDK::Resources::AccessTokens.new(client: self)
|
|
218
|
+
@notifications = WhopSDK::Resources::Notifications.new(client: self)
|
|
219
|
+
@disputes = WhopSDK::Resources::Disputes.new(client: self)
|
|
208
220
|
end
|
|
209
221
|
|
|
210
222
|
# Verifies a Whop user token
|
|
@@ -217,6 +229,9 @@ module WhopSDK
|
|
|
217
229
|
# @raise [StandardError] If verification fails
|
|
218
230
|
def verify_user_token!(token_or_headers, **opts)
|
|
219
231
|
opts[:app_id] ||= app_id
|
|
232
|
+
unless opts[:app_id]
|
|
233
|
+
raise StandardError, "You must set app_id in the Whop client if you want to verify user tokens"
|
|
234
|
+
end
|
|
220
235
|
Helpers::VerifyUserToken.verify_user_token!(token_or_headers, **opts)
|
|
221
236
|
end
|
|
222
237
|
|
|
@@ -201,7 +201,8 @@ module WhopSDK
|
|
|
201
201
|
self.class::PLATFORM_HEADERS,
|
|
202
202
|
{
|
|
203
203
|
"accept" => "application/json",
|
|
204
|
-
"content-type" => "application/json"
|
|
204
|
+
"content-type" => "application/json",
|
|
205
|
+
"user-agent" => user_agent
|
|
205
206
|
},
|
|
206
207
|
headers
|
|
207
208
|
)
|
|
@@ -219,6 +220,11 @@ module WhopSDK
|
|
|
219
220
|
# @return [Hash{String=>String}]
|
|
220
221
|
private def auth_headers = {}
|
|
221
222
|
|
|
223
|
+
# @api private
|
|
224
|
+
#
|
|
225
|
+
# @return [String]
|
|
226
|
+
private def user_agent = "#{self.class.name}/Ruby #{WhopSDK::VERSION}"
|
|
227
|
+
|
|
222
228
|
# @api private
|
|
223
229
|
#
|
|
224
230
|
# @return [String]
|
|
@@ -16,10 +16,11 @@ module WhopSDK
|
|
|
16
16
|
class << self
|
|
17
17
|
# @api private
|
|
18
18
|
#
|
|
19
|
+
# @param cert_store [OpenSSL::X509::Store]
|
|
19
20
|
# @param url [URI::Generic]
|
|
20
21
|
#
|
|
21
22
|
# @return [Net::HTTP]
|
|
22
|
-
def connect(url)
|
|
23
|
+
def connect(cert_store:, url:)
|
|
23
24
|
port =
|
|
24
25
|
case [url.port, url.scheme]
|
|
25
26
|
in [Integer, _]
|
|
@@ -33,6 +34,8 @@ module WhopSDK
|
|
|
33
34
|
Net::HTTP.new(url.host, port).tap do
|
|
34
35
|
_1.use_ssl = %w[https wss].include?(url.scheme)
|
|
35
36
|
_1.max_retries = 0
|
|
37
|
+
|
|
38
|
+
(_1.cert_store = cert_store) if _1.use_ssl?
|
|
36
39
|
end
|
|
37
40
|
end
|
|
38
41
|
|
|
@@ -102,7 +105,7 @@ module WhopSDK
|
|
|
102
105
|
pool =
|
|
103
106
|
@mutex.synchronize do
|
|
104
107
|
@pools[origin] ||= ConnectionPool.new(size: @size) do
|
|
105
|
-
self.class.connect(url)
|
|
108
|
+
self.class.connect(cert_store: @cert_store, url: url)
|
|
106
109
|
end
|
|
107
110
|
end
|
|
108
111
|
|
|
@@ -192,6 +195,7 @@ module WhopSDK
|
|
|
192
195
|
def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
|
|
193
196
|
@mutex = Mutex.new
|
|
194
197
|
@size = size
|
|
198
|
+
@cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
|
195
199
|
@pools = {}
|
|
196
200
|
end
|
|
197
201
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::AccessTokens#create
|
|
6
|
+
class AccessTokenCreateParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute scoped_actions
|
|
11
|
+
# Array of desired scoped actions for the access token. This list must be a subset
|
|
12
|
+
# of the API keys's existing permissions. Otherwise, an error will be raised.
|
|
13
|
+
#
|
|
14
|
+
# @return [Array<String>]
|
|
15
|
+
required :scoped_actions, WhopSDK::Internal::Type::ArrayOf[String]
|
|
16
|
+
|
|
17
|
+
# @!attribute target_resource_id
|
|
18
|
+
# The ID of the target resource (Company, User, etc.) for which the access token
|
|
19
|
+
# is being created.
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :target_resource_id, String
|
|
23
|
+
|
|
24
|
+
# @!attribute target_resource_type
|
|
25
|
+
# The type of the target resource (company, user, product, experience, etc.).
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, WhopSDK::Models::AccessTokenCreateParams::TargetResourceType]
|
|
28
|
+
required :target_resource_type, enum: -> { WhopSDK::AccessTokenCreateParams::TargetResourceType }
|
|
29
|
+
|
|
30
|
+
# @!attribute expires_at
|
|
31
|
+
# The expiration timestamp for the access token. If not provided, a default
|
|
32
|
+
# expiration time of 1 hour will be used. The expiration can be set to a maximum
|
|
33
|
+
# of 3 hours from the current time.
|
|
34
|
+
#
|
|
35
|
+
# @return [Time, nil]
|
|
36
|
+
optional :expires_at, Time, nil?: true
|
|
37
|
+
|
|
38
|
+
# @!method initialize(scoped_actions:, target_resource_id:, target_resource_type:, expires_at: nil, request_options: {})
|
|
39
|
+
# Some parameter documentations has been truncated, see
|
|
40
|
+
# {WhopSDK::Models::AccessTokenCreateParams} for more details.
|
|
41
|
+
#
|
|
42
|
+
# @param scoped_actions [Array<String>] Array of desired scoped actions for the access token. This list must be a subset
|
|
43
|
+
#
|
|
44
|
+
# @param target_resource_id [String] The ID of the target resource (Company, User, etc.) for which the access token i
|
|
45
|
+
#
|
|
46
|
+
# @param target_resource_type [Symbol, WhopSDK::Models::AccessTokenCreateParams::TargetResourceType] The type of the target resource (company, user, product, experience, etc.).
|
|
47
|
+
#
|
|
48
|
+
# @param expires_at [Time, nil] The expiration timestamp for the access token. If not provided, a default expira
|
|
49
|
+
#
|
|
50
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
51
|
+
|
|
52
|
+
# The type of the target resource (company, user, product, experience, etc.).
|
|
53
|
+
module TargetResourceType
|
|
54
|
+
extend WhopSDK::Internal::Type::Enum
|
|
55
|
+
|
|
56
|
+
COMPANY = :company
|
|
57
|
+
PRODUCT = :product
|
|
58
|
+
EXPERIENCE = :experience
|
|
59
|
+
APP = :app
|
|
60
|
+
USER = :user
|
|
61
|
+
|
|
62
|
+
# @!method self.values
|
|
63
|
+
# @return [Array<Symbol>]
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::AccessTokens#create
|
|
6
|
+
class AccessTokenCreateResponse < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute token
|
|
8
|
+
# The JWT access token string.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :token, String
|
|
12
|
+
|
|
13
|
+
# @!attribute expires_at
|
|
14
|
+
# The expiration timestamp of the access token.
|
|
15
|
+
#
|
|
16
|
+
# @return [Time]
|
|
17
|
+
required :expires_at, Time
|
|
18
|
+
|
|
19
|
+
# @!method initialize(token:, expires_at:)
|
|
20
|
+
# An object representing an access token used for authenticating API requests.
|
|
21
|
+
#
|
|
22
|
+
# @param token [String] The JWT access token string.
|
|
23
|
+
#
|
|
24
|
+
# @param expires_at [Time] The expiration timestamp of the access token.
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -133,7 +133,7 @@ module WhopSDK
|
|
|
133
133
|
nil?: true
|
|
134
134
|
|
|
135
135
|
# @!attribute plan_type
|
|
136
|
-
# The type of plan that can be attached to
|
|
136
|
+
# The type of plan that can be attached to a product
|
|
137
137
|
#
|
|
138
138
|
# @return [Symbol, WhopSDK::Models::PlanType, nil]
|
|
139
139
|
optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true
|
|
@@ -211,7 +211,7 @@ module WhopSDK
|
|
|
211
211
|
#
|
|
212
212
|
# @param payment_method_configuration [WhopSDK::Models::CheckoutConfigurationCreateParams::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla
|
|
213
213
|
#
|
|
214
|
-
# @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to
|
|
214
|
+
# @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product
|
|
215
215
|
#
|
|
216
216
|
# @param product [WhopSDK::Models::CheckoutConfigurationCreateParams::Plan::Product, nil] Pass this object to create a new product for this plan. We will use the product
|
|
217
217
|
#
|
|
@@ -422,7 +422,7 @@ module WhopSDK
|
|
|
422
422
|
optional :global_affiliate_percentage, Float, nil?: true
|
|
423
423
|
|
|
424
424
|
# @!attribute global_affiliate_status
|
|
425
|
-
# The different statuses of the global affiliate program for
|
|
425
|
+
# The different statuses of the global affiliate program for a product.
|
|
426
426
|
#
|
|
427
427
|
# @return [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil]
|
|
428
428
|
optional :global_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }, nil?: true
|
|
@@ -486,7 +486,7 @@ module WhopSDK
|
|
|
486
486
|
#
|
|
487
487
|
# @param global_affiliate_percentage [Float, nil] The percentage of the revenue that goes to the global affiliate program.
|
|
488
488
|
#
|
|
489
|
-
# @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for
|
|
489
|
+
# @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product.
|
|
490
490
|
#
|
|
491
491
|
# @param headline [String, nil] The headline of the product.
|
|
492
492
|
#
|
|
@@ -42,6 +42,12 @@ module WhopSDK
|
|
|
42
42
|
# @return [Symbol, WhopSDK::Models::Languages]
|
|
43
43
|
required :language, enum: -> { WhopSDK::Languages }
|
|
44
44
|
|
|
45
|
+
# @!attribute order
|
|
46
|
+
# The order of the course within its experience
|
|
47
|
+
#
|
|
48
|
+
# @return [String]
|
|
49
|
+
required :order, String
|
|
50
|
+
|
|
45
51
|
# @!attribute require_completing_lessons_in_order
|
|
46
52
|
# Whether the course requires students to complete the previous lesson before
|
|
47
53
|
# moving on to the next one
|
|
@@ -73,7 +79,14 @@ module WhopSDK
|
|
|
73
79
|
# @return [Time]
|
|
74
80
|
required :updated_at, Time
|
|
75
81
|
|
|
76
|
-
# @!
|
|
82
|
+
# @!attribute visibility
|
|
83
|
+
# The visibility of the course. Determines how / whether this course is visible to
|
|
84
|
+
# users.
|
|
85
|
+
#
|
|
86
|
+
# @return [Symbol, WhopSDK::Models::CourseVisibilities]
|
|
87
|
+
required :visibility, enum: -> { WhopSDK::CourseVisibilities }
|
|
88
|
+
|
|
89
|
+
# @!method initialize(id:, certificate_after_completion_enabled:, chapters:, created_at:, description:, language:, order:, require_completing_lessons_in_order:, tagline:, thumbnail:, title:, updated_at:, visibility:)
|
|
77
90
|
# Some parameter documentations has been truncated, see {WhopSDK::Models::Course}
|
|
78
91
|
# for more details.
|
|
79
92
|
#
|
|
@@ -91,6 +104,8 @@ module WhopSDK
|
|
|
91
104
|
#
|
|
92
105
|
# @param language [Symbol, WhopSDK::Models::Languages] The language spoken in the video content of the course, used to generate closed
|
|
93
106
|
#
|
|
107
|
+
# @param order [String] The order of the course within its experience
|
|
108
|
+
#
|
|
94
109
|
# @param require_completing_lessons_in_order [Boolean] Whether the course requires students to complete the previous lesson before movi
|
|
95
110
|
#
|
|
96
111
|
# @param tagline [String, nil] A short tagline for the course. It is displayed under the course title in the UI
|
|
@@ -100,6 +115,8 @@ module WhopSDK
|
|
|
100
115
|
# @param title [String, nil] The title of the course
|
|
101
116
|
#
|
|
102
117
|
# @param updated_at [Time] The timestamp of when the course was last updated
|
|
118
|
+
#
|
|
119
|
+
# @param visibility [Symbol, WhopSDK::Models::CourseVisibilities] The visibility of the course. Determines how / whether this course is visible to
|
|
103
120
|
|
|
104
121
|
class Chapter < WhopSDK::Internal::Type::BaseModel
|
|
105
122
|
# @!attribute id
|
|
@@ -32,6 +32,14 @@ module WhopSDK
|
|
|
32
32
|
# @return [String, nil]
|
|
33
33
|
optional :cover_image, String, nil?: true
|
|
34
34
|
|
|
35
|
+
# @!attribute order
|
|
36
|
+
# The decimal order position of the course within its experience. If not provided,
|
|
37
|
+
# it will be set to the next sequential order. Use fractional values (e.g., 1.5)
|
|
38
|
+
# to place between existing courses.
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :order, String, nil?: true
|
|
42
|
+
|
|
35
43
|
# @!attribute require_completing_lessons_in_order
|
|
36
44
|
# Whether the course requires students to complete the previous lesson before
|
|
37
45
|
# moving on to the next one
|
|
@@ -51,7 +59,14 @@ module WhopSDK
|
|
|
51
59
|
# @return [WhopSDK::Models::CourseCreateParams::Thumbnail::AttachmentInputWithDirectUploadID, WhopSDK::Models::CourseCreateParams::Thumbnail::AttachmentInputWithID, nil]
|
|
52
60
|
optional :thumbnail, union: -> { WhopSDK::CourseCreateParams::Thumbnail }, nil?: true
|
|
53
61
|
|
|
54
|
-
# @!
|
|
62
|
+
# @!attribute visibility
|
|
63
|
+
# The available visibilities for a course. Determines how / whether a course is
|
|
64
|
+
# visible to users.
|
|
65
|
+
#
|
|
66
|
+
# @return [Symbol, WhopSDK::Models::CourseVisibilities, nil]
|
|
67
|
+
optional :visibility, enum: -> { WhopSDK::CourseVisibilities }, nil?: true
|
|
68
|
+
|
|
69
|
+
# @!method initialize(experience_id:, title:, certificate_after_completion_enabled: nil, cover_image: nil, order: nil, require_completing_lessons_in_order: nil, tagline: nil, thumbnail: nil, visibility: nil, request_options: {})
|
|
55
70
|
# Some parameter documentations has been truncated, see
|
|
56
71
|
# {WhopSDK::Models::CourseCreateParams} for more details.
|
|
57
72
|
#
|
|
@@ -63,12 +78,16 @@ module WhopSDK
|
|
|
63
78
|
#
|
|
64
79
|
# @param cover_image [String, nil] The cover image URL of the course
|
|
65
80
|
#
|
|
81
|
+
# @param order [String, nil] The decimal order position of the course within its experience. If not provided,
|
|
82
|
+
#
|
|
66
83
|
# @param require_completing_lessons_in_order [Boolean, nil] Whether the course requires students to complete the previous lesson before movi
|
|
67
84
|
#
|
|
68
85
|
# @param tagline [String, nil] The tagline of the course
|
|
69
86
|
#
|
|
70
87
|
# @param thumbnail [WhopSDK::Models::CourseCreateParams::Thumbnail::AttachmentInputWithDirectUploadID, WhopSDK::Models::CourseCreateParams::Thumbnail::AttachmentInputWithID, nil] The thumbnail for the course in png, jpeg, or gif format
|
|
71
88
|
#
|
|
89
|
+
# @param visibility [Symbol, WhopSDK::Models::CourseVisibilities, nil] The available visibilities for a course. Determines how / whether a course is vi
|
|
90
|
+
#
|
|
72
91
|
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
73
92
|
|
|
74
93
|
# The thumbnail for the course in png, jpeg, or gif format
|
|
@@ -31,13 +31,31 @@ module WhopSDK
|
|
|
31
31
|
# @return [Integer, nil]
|
|
32
32
|
optional :days_from_course_start_until_unlock, Integer, nil?: true
|
|
33
33
|
|
|
34
|
+
# @!attribute embed_id
|
|
35
|
+
# ID for the embed (YouTube video ID or Loom share ID)
|
|
36
|
+
#
|
|
37
|
+
# @return [String, nil]
|
|
38
|
+
optional :embed_id, String, nil?: true
|
|
39
|
+
|
|
40
|
+
# @!attribute embed_type
|
|
41
|
+
# The type of embed for a lesson
|
|
42
|
+
#
|
|
43
|
+
# @return [Symbol, WhopSDK::Models::EmbedType, nil]
|
|
44
|
+
optional :embed_type, enum: -> { WhopSDK::EmbedType }, nil?: true
|
|
45
|
+
|
|
46
|
+
# @!attribute thumbnail
|
|
47
|
+
# The thumbnail for the lesson in png, jpeg, or gif format
|
|
48
|
+
#
|
|
49
|
+
# @return [WhopSDK::Models::CourseLessonCreateParams::Thumbnail::AttachmentInputWithDirectUploadID, WhopSDK::Models::CourseLessonCreateParams::Thumbnail::AttachmentInputWithID, nil]
|
|
50
|
+
optional :thumbnail, union: -> { WhopSDK::CourseLessonCreateParams::Thumbnail }, nil?: true
|
|
51
|
+
|
|
34
52
|
# @!attribute title
|
|
35
53
|
# The title of the lesson
|
|
36
54
|
#
|
|
37
55
|
# @return [String, nil]
|
|
38
56
|
optional :title, String, nil?: true
|
|
39
57
|
|
|
40
|
-
# @!method initialize(chapter_id:, lesson_type:, content: nil, days_from_course_start_until_unlock: nil, title: nil, request_options: {})
|
|
58
|
+
# @!method initialize(chapter_id:, lesson_type:, content: nil, days_from_course_start_until_unlock: nil, embed_id: nil, embed_type: nil, thumbnail: nil, title: nil, request_options: {})
|
|
41
59
|
# @param chapter_id [String] The ID of the chapter to create the lesson in
|
|
42
60
|
#
|
|
43
61
|
# @param lesson_type [Symbol, WhopSDK::Models::LessonTypes] The type of the lesson
|
|
@@ -46,9 +64,67 @@ module WhopSDK
|
|
|
46
64
|
#
|
|
47
65
|
# @param days_from_course_start_until_unlock [Integer, nil] Days from course start until unlock
|
|
48
66
|
#
|
|
67
|
+
# @param embed_id [String, nil] ID for the embed (YouTube video ID or Loom share ID)
|
|
68
|
+
#
|
|
69
|
+
# @param embed_type [Symbol, WhopSDK::Models::EmbedType, nil] The type of embed for a lesson
|
|
70
|
+
#
|
|
71
|
+
# @param thumbnail [WhopSDK::Models::CourseLessonCreateParams::Thumbnail::AttachmentInputWithDirectUploadID, WhopSDK::Models::CourseLessonCreateParams::Thumbnail::AttachmentInputWithID, nil] The thumbnail for the lesson in png, jpeg, or gif format
|
|
72
|
+
#
|
|
49
73
|
# @param title [String, nil] The title of the lesson
|
|
50
74
|
#
|
|
51
75
|
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
76
|
+
|
|
77
|
+
# The thumbnail for the lesson in png, jpeg, or gif format
|
|
78
|
+
module Thumbnail
|
|
79
|
+
extend WhopSDK::Internal::Type::Union
|
|
80
|
+
|
|
81
|
+
# Input for an attachment
|
|
82
|
+
variant -> { WhopSDK::CourseLessonCreateParams::Thumbnail::AttachmentInputWithDirectUploadID }
|
|
83
|
+
|
|
84
|
+
# Input for an attachment
|
|
85
|
+
variant -> { WhopSDK::CourseLessonCreateParams::Thumbnail::AttachmentInputWithID }
|
|
86
|
+
|
|
87
|
+
class AttachmentInputWithDirectUploadID < WhopSDK::Internal::Type::BaseModel
|
|
88
|
+
# @!attribute direct_upload_id
|
|
89
|
+
# This ID should be used the first time you upload an attachment. It is the ID of
|
|
90
|
+
# the direct upload that was created when uploading the file to S3 via the
|
|
91
|
+
# mediaDirectUpload mutation.
|
|
92
|
+
#
|
|
93
|
+
# @return [String]
|
|
94
|
+
required :direct_upload_id, String
|
|
95
|
+
|
|
96
|
+
# @!method initialize(direct_upload_id:)
|
|
97
|
+
# Some parameter documentations has been truncated, see
|
|
98
|
+
# {WhopSDK::Models::CourseLessonCreateParams::Thumbnail::AttachmentInputWithDirectUploadID}
|
|
99
|
+
# for more details.
|
|
100
|
+
#
|
|
101
|
+
# Input for an attachment
|
|
102
|
+
#
|
|
103
|
+
# @param direct_upload_id [String] This ID should be used the first time you upload an attachment. It is the ID of
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
class AttachmentInputWithID < WhopSDK::Internal::Type::BaseModel
|
|
107
|
+
# @!attribute id
|
|
108
|
+
# The ID of an existing attachment object. Use this when updating a resource and
|
|
109
|
+
# keeping a subset of the attachments. Don't use this unless you know what you're
|
|
110
|
+
# doing.
|
|
111
|
+
#
|
|
112
|
+
# @return [String]
|
|
113
|
+
required :id, String
|
|
114
|
+
|
|
115
|
+
# @!method initialize(id:)
|
|
116
|
+
# Some parameter documentations has been truncated, see
|
|
117
|
+
# {WhopSDK::Models::CourseLessonCreateParams::Thumbnail::AttachmentInputWithID}
|
|
118
|
+
# for more details.
|
|
119
|
+
#
|
|
120
|
+
# Input for an attachment
|
|
121
|
+
#
|
|
122
|
+
# @param id [String] The ID of an existing attachment object. Use this when updating a resource and k
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# @!method self.variants
|
|
126
|
+
# @return [Array(WhopSDK::Models::CourseLessonCreateParams::Thumbnail::AttachmentInputWithDirectUploadID, WhopSDK::Models::CourseLessonCreateParams::Thumbnail::AttachmentInputWithID)]
|
|
127
|
+
end
|
|
52
128
|
end
|
|
53
129
|
end
|
|
54
130
|
end
|
|
@@ -22,6 +22,18 @@ module WhopSDK
|
|
|
22
22
|
# @return [Integer, nil]
|
|
23
23
|
required :days_from_course_start_until_unlock, Integer, nil?: true
|
|
24
24
|
|
|
25
|
+
# @!attribute embed_id
|
|
26
|
+
# ID for the embed (YouTube video ID or Loom share ID)
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
required :embed_id, String, nil?: true
|
|
30
|
+
|
|
31
|
+
# @!attribute embed_type
|
|
32
|
+
# The type of embed for a lesson
|
|
33
|
+
#
|
|
34
|
+
# @return [Symbol, WhopSDK::Models::EmbedType, nil]
|
|
35
|
+
required :embed_type, enum: -> { WhopSDK::EmbedType }, nil?: true
|
|
36
|
+
|
|
25
37
|
# @!attribute lesson_type
|
|
26
38
|
# The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
|
|
27
39
|
#
|
|
@@ -34,6 +46,12 @@ module WhopSDK
|
|
|
34
46
|
# @return [Integer]
|
|
35
47
|
required :order, Integer
|
|
36
48
|
|
|
49
|
+
# @!attribute thumbnail
|
|
50
|
+
# The thumbnail for the lesson
|
|
51
|
+
#
|
|
52
|
+
# @return [WhopSDK::Models::CourseLessonListResponse::Thumbnail, nil]
|
|
53
|
+
required :thumbnail, -> { WhopSDK::Models::CourseLessonListResponse::Thumbnail }, nil?: true
|
|
54
|
+
|
|
37
55
|
# @!attribute title
|
|
38
56
|
# The title of the lesson
|
|
39
57
|
#
|
|
@@ -47,7 +65,7 @@ module WhopSDK
|
|
|
47
65
|
# @return [Symbol, WhopSDK::Models::LessonVisibilities]
|
|
48
66
|
required :visibility, enum: -> { WhopSDK::LessonVisibilities }
|
|
49
67
|
|
|
50
|
-
# @!method initialize(id:, content:, days_from_course_start_until_unlock:, lesson_type:, order:, title:, visibility:)
|
|
68
|
+
# @!method initialize(id:, content:, days_from_course_start_until_unlock:, embed_id:, embed_type:, lesson_type:, order:, thumbnail:, title:, visibility:)
|
|
51
69
|
# Some parameter documentations has been truncated, see
|
|
52
70
|
# {WhopSDK::Models::CourseLessonListResponse} for more details.
|
|
53
71
|
#
|
|
@@ -59,13 +77,37 @@ module WhopSDK
|
|
|
59
77
|
#
|
|
60
78
|
# @param days_from_course_start_until_unlock [Integer, nil] Number of days from course start until the lesson is unlocked
|
|
61
79
|
#
|
|
80
|
+
# @param embed_id [String, nil] ID for the embed (YouTube video ID or Loom share ID)
|
|
81
|
+
#
|
|
82
|
+
# @param embed_type [Symbol, WhopSDK::Models::EmbedType, nil] The type of embed for a lesson
|
|
83
|
+
#
|
|
62
84
|
# @param lesson_type [Symbol, WhopSDK::Models::LessonTypes] The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)
|
|
63
85
|
#
|
|
64
86
|
# @param order [Integer] The order of the lesson within its chapter
|
|
65
87
|
#
|
|
88
|
+
# @param thumbnail [WhopSDK::Models::CourseLessonListResponse::Thumbnail, nil] The thumbnail for the lesson
|
|
89
|
+
#
|
|
66
90
|
# @param title [String] The title of the lesson
|
|
67
91
|
#
|
|
68
92
|
# @param visibility [Symbol, WhopSDK::Models::LessonVisibilities] The visibility of the lesson. Determines how / whether this lesson is visible to
|
|
93
|
+
|
|
94
|
+
# @see WhopSDK::Models::CourseLessonListResponse#thumbnail
|
|
95
|
+
class Thumbnail < WhopSDK::Internal::Type::BaseModel
|
|
96
|
+
# @!attribute url
|
|
97
|
+
# This is the URL you use to render optimized attachments on the client. This
|
|
98
|
+
# should be used for apps.
|
|
99
|
+
#
|
|
100
|
+
# @return [String, nil]
|
|
101
|
+
required :url, String, nil?: true
|
|
102
|
+
|
|
103
|
+
# @!method initialize(url:)
|
|
104
|
+
# Some parameter documentations has been truncated, see
|
|
105
|
+
# {WhopSDK::Models::CourseLessonListResponse::Thumbnail} for more details.
|
|
106
|
+
#
|
|
107
|
+
# The thumbnail for the lesson
|
|
108
|
+
#
|
|
109
|
+
# @param url [String, nil] This is the URL you use to render optimized attachments on the client. This shou
|
|
110
|
+
end
|
|
69
111
|
end
|
|
70
112
|
end
|
|
71
113
|
end
|