whop_sdk 0.0.4 → 0.0.5
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 +25 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +4 -0
- 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/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/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/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.rb +6 -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/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/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/version.rb +1 -1
- data/lib/whop_sdk.rb +6 -0
- data/manifest.yaml +1 -0
- data/rbi/whop_sdk/client.rbi +3 -0
- 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/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/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/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.rbi +6 -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/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/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/sig/whop_sdk/client.rbs +2 -0
- 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/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/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.rbs +6 -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/invoices.rbs +3 -1
- data/sig/whop_sdk/resources/members.rbs +1 -1
- data/sig/whop_sdk/resources/memberships.rbs +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47dbcf6d251bc786986b0862e0ed904004a5ed20ba919298f7c3405f0cb3b508
|
|
4
|
+
data.tar.gz: a32801e2c4cb776d9d140b96dfe7ddfed67276a505836ab747e753e1b2ea1ae9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0a9770a71da93ee3e6bf5e6d19936c53bd534e546809a4e9d9dfa56dbff804ead817e512a4e815bb71c983c088260422a729ab2dd3003d8bf69bf6180bcdc7b2
|
|
7
|
+
data.tar.gz: 4a3ec25658c045e9cd3789a0d9bfde24993dd1f4092dc46dd3808d04b244b4af954bf1b4a3e54688f796ba865cc13151ebba8693fb18808f82fbf889c8971e80
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.5 (2025-11-08)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.0.4...v0.0.5](https://github.com/whopio/whopsdk-ruby/compare/v0.0.4...v0.0.5)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([004569d](https://github.com/whopio/whopsdk-ruby/commit/004569d4a072e5601649fa95ac7ef94e2899ff27))
|
|
10
|
+
* **api:** api update ([9d6bd6c](https://github.com/whopio/whopsdk-ruby/commit/9d6bd6cc2175d40a88de394eab0c46d419b959a3))
|
|
11
|
+
* **api:** api update ([b3c2d9f](https://github.com/whopio/whopsdk-ruby/commit/b3c2d9fc0e1e4a3bf25dc220d347bd44e07e5583))
|
|
12
|
+
* **api:** api update ([d7313ca](https://github.com/whopio/whopsdk-ruby/commit/d7313cac52bdc1dcc76d1154418c97c24b84d381))
|
|
13
|
+
* **api:** api update ([02d0ec1](https://github.com/whopio/whopsdk-ruby/commit/02d0ec11a555f7d5a16827c4b6d9c4010ef14bd2))
|
|
14
|
+
* **api:** api update ([9995686](https://github.com/whopio/whopsdk-ruby/commit/9995686b5552d60a39f8523d7c0052cf5b1acfd5))
|
|
15
|
+
* **api:** api update ([53eb5c1](https://github.com/whopio/whopsdk-ruby/commit/53eb5c18cb24f630d6353fa7c1281fc97d7c5292))
|
|
16
|
+
* **api:** manual updates ([55961b2](https://github.com/whopio/whopsdk-ruby/commit/55961b26868a3df976aa07393fff947df5fdebe7))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* better thread safety via early initializing SSL store during HTTP client creation ([80ee4a2](https://github.com/whopio/whopsdk-ruby/commit/80ee4a25aac1e217cfdfac3443280f23391a5afa))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Chores
|
|
25
|
+
|
|
26
|
+
* bump dependency version and update sorbet types ([70e8094](https://github.com/whopio/whopsdk-ruby/commit/70e8094874d1701d0162b92d1a788abcb3ea4335))
|
|
27
|
+
|
|
3
28
|
## 0.0.4 (2025-11-02)
|
|
4
29
|
|
|
5
30
|
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
data/lib/whop_sdk/client.rb
CHANGED
|
@@ -115,6 +115,9 @@ module WhopSDK
|
|
|
115
115
|
# @return [WhopSDK::Resources::CourseStudents]
|
|
116
116
|
attr_reader :course_students
|
|
117
117
|
|
|
118
|
+
# @return [WhopSDK::Resources::AccessTokens]
|
|
119
|
+
attr_reader :access_tokens
|
|
120
|
+
|
|
118
121
|
# @api private
|
|
119
122
|
#
|
|
120
123
|
# @return [Hash{String=>String}]
|
|
@@ -205,6 +208,7 @@ module WhopSDK
|
|
|
205
208
|
@course_lessons = WhopSDK::Resources::CourseLessons.new(client: self)
|
|
206
209
|
@reviews = WhopSDK::Resources::Reviews.new(client: self)
|
|
207
210
|
@course_students = WhopSDK::Resources::CourseStudents.new(client: self)
|
|
211
|
+
@access_tokens = WhopSDK::Resources::AccessTokens.new(client: self)
|
|
208
212
|
end
|
|
209
213
|
|
|
210
214
|
# Verifies a Whop user token
|
|
@@ -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
|