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
|
@@ -43,7 +43,8 @@ module WhopSDK
|
|
|
43
43
|
#
|
|
44
44
|
# @overload retrieve(id, request_options: {})
|
|
45
45
|
#
|
|
46
|
-
# @param id [String]
|
|
46
|
+
# @param id [String] The ID of the shipment
|
|
47
|
+
#
|
|
47
48
|
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
48
49
|
#
|
|
49
50
|
# @return [WhopSDK::Models::Shipment]
|
|
@@ -40,7 +40,8 @@ module WhopSDK
|
|
|
40
40
|
#
|
|
41
41
|
# @overload retrieve(id, request_options: {})
|
|
42
42
|
#
|
|
43
|
-
# @param id [String]
|
|
43
|
+
# @param id [String] The ID of the support channel to fetch
|
|
44
|
+
#
|
|
44
45
|
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
45
46
|
#
|
|
46
47
|
# @return [WhopSDK::Models::SupportChannel]
|
|
@@ -52,7 +52,8 @@ module WhopSDK
|
|
|
52
52
|
#
|
|
53
53
|
# @overload retrieve(id, request_options: {})
|
|
54
54
|
#
|
|
55
|
-
# @param id [String]
|
|
55
|
+
# @param id [String] The ID of the transfer
|
|
56
|
+
#
|
|
56
57
|
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
57
58
|
#
|
|
58
59
|
# @return [WhopSDK::Models::Transfer]
|
|
@@ -7,7 +7,8 @@ module WhopSDK
|
|
|
7
7
|
#
|
|
8
8
|
# @overload retrieve(id, request_options: {})
|
|
9
9
|
#
|
|
10
|
-
# @param id [String]
|
|
10
|
+
# @param id [String] The ID (user_xxx) or username of the user
|
|
11
|
+
#
|
|
11
12
|
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
12
13
|
#
|
|
13
14
|
# @return [WhopSDK::Models::UserRetrieveResponse]
|
|
@@ -22,12 +23,17 @@ module WhopSDK
|
|
|
22
23
|
)
|
|
23
24
|
end
|
|
24
25
|
|
|
26
|
+
# Some parameter documentations has been truncated, see
|
|
27
|
+
# {WhopSDK::Models::UserCheckAccessParams} for more details.
|
|
28
|
+
#
|
|
25
29
|
# Check if a user has access (and their access level) to a resource
|
|
26
30
|
#
|
|
27
31
|
# @overload check_access(resource_id, id:, request_options: {})
|
|
28
32
|
#
|
|
29
|
-
# @param resource_id [String]
|
|
30
|
-
#
|
|
33
|
+
# @param resource_id [String] The ID of the resource. Can be a company (biz_xxx), product (prod_xxx), or exper
|
|
34
|
+
#
|
|
35
|
+
# @param id [String] The ID (user_xxx) or username of the user
|
|
36
|
+
#
|
|
31
37
|
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
32
38
|
#
|
|
33
39
|
# @return [WhopSDK::Models::UserCheckAccessResponse]
|
data/lib/whop_sdk/version.rb
CHANGED
data/lib/whop_sdk.rb
CHANGED
|
@@ -9,6 +9,7 @@ require "erb"
|
|
|
9
9
|
require "etc"
|
|
10
10
|
require "json"
|
|
11
11
|
require "net/http"
|
|
12
|
+
require "openssl"
|
|
12
13
|
require "pathname"
|
|
13
14
|
require "rbconfig"
|
|
14
15
|
require "securerandom"
|
|
@@ -53,6 +54,8 @@ require_relative "whop_sdk/client"
|
|
|
53
54
|
require_relative "whop_sdk/internal/cursor_page"
|
|
54
55
|
require_relative "whop_sdk/models/access_level"
|
|
55
56
|
require_relative "whop_sdk/models/access_pass_type"
|
|
57
|
+
require_relative "whop_sdk/models/access_token_create_params"
|
|
58
|
+
require_relative "whop_sdk/models/access_token_create_response"
|
|
56
59
|
require_relative "whop_sdk/models/app"
|
|
57
60
|
require_relative "whop_sdk/models/app_build"
|
|
58
61
|
require_relative "whop_sdk/models/app_build_create_params"
|
|
@@ -126,11 +129,13 @@ require_relative "whop_sdk/models/course_student_list_response"
|
|
|
126
129
|
require_relative "whop_sdk/models/course_student_retrieve_params"
|
|
127
130
|
require_relative "whop_sdk/models/course_student_retrieve_response"
|
|
128
131
|
require_relative "whop_sdk/models/course_update_params"
|
|
132
|
+
require_relative "whop_sdk/models/course_visibilities"
|
|
129
133
|
require_relative "whop_sdk/models/currency"
|
|
130
134
|
require_relative "whop_sdk/models/custom_cta"
|
|
131
135
|
require_relative "whop_sdk/models/direction"
|
|
132
136
|
require_relative "whop_sdk/models/dms_post_types"
|
|
133
137
|
require_relative "whop_sdk/models/email_notification_preferences"
|
|
138
|
+
require_relative "whop_sdk/models/embed_type"
|
|
134
139
|
require_relative "whop_sdk/models/entry"
|
|
135
140
|
require_relative "whop_sdk/models/entry_approved_webhook_event"
|
|
136
141
|
require_relative "whop_sdk/models/entry_approve_params"
|
|
@@ -292,6 +297,7 @@ require_relative "whop_sdk/models/who_can_post"
|
|
|
292
297
|
require_relative "whop_sdk/models/who_can_post_types"
|
|
293
298
|
require_relative "whop_sdk/models/who_can_react"
|
|
294
299
|
require_relative "whop_sdk/models"
|
|
300
|
+
require_relative "whop_sdk/resources/access_tokens"
|
|
295
301
|
require_relative "whop_sdk/resources/app_builds"
|
|
296
302
|
require_relative "whop_sdk/resources/apps"
|
|
297
303
|
require_relative "whop_sdk/resources/authorized_users"
|
data/manifest.yaml
CHANGED
data/rbi/whop_sdk/client.rbi
CHANGED
|
@@ -110,6 +110,9 @@ module WhopSDK
|
|
|
110
110
|
sig { returns(WhopSDK::Resources::CourseStudents) }
|
|
111
111
|
attr_reader :course_students
|
|
112
112
|
|
|
113
|
+
sig { returns(WhopSDK::Resources::AccessTokens) }
|
|
114
|
+
attr_reader :access_tokens
|
|
115
|
+
|
|
113
116
|
# @api private
|
|
114
117
|
sig { override.returns(T::Hash[String, String]) }
|
|
115
118
|
private def auth_headers
|
|
@@ -26,8 +26,12 @@ module WhopSDK
|
|
|
26
26
|
|
|
27
27
|
class << self
|
|
28
28
|
# @api private
|
|
29
|
-
sig
|
|
30
|
-
|
|
29
|
+
sig do
|
|
30
|
+
params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
|
|
31
|
+
Net::HTTP
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def connect(cert_store:, url:)
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
# @api private
|
|
@@ -31,7 +31,7 @@ module WhopSDK
|
|
|
31
31
|
#
|
|
32
32
|
# Assumes superclass fields are totally defined before fields are accessed /
|
|
33
33
|
# defined on subclasses.
|
|
34
|
-
sig { params(child:
|
|
34
|
+
sig { params(child: WhopSDK::Internal::Type::BaseModel).void }
|
|
35
35
|
def inherited(child)
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -274,9 +274,13 @@ module WhopSDK
|
|
|
274
274
|
|
|
275
275
|
# Create a new instance of a model.
|
|
276
276
|
sig do
|
|
277
|
-
params(
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
params(
|
|
278
|
+
data:
|
|
279
|
+
T.any(
|
|
280
|
+
T::Hash[Symbol, T.anything],
|
|
281
|
+
WhopSDK::Internal::Type::BaseModel
|
|
282
|
+
)
|
|
283
|
+
).returns(T.attached_class)
|
|
280
284
|
end
|
|
281
285
|
def self.new(data = {})
|
|
282
286
|
end
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class AccessTokenCreateParams < WhopSDK::Internal::Type::BaseModel
|
|
6
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(WhopSDK::AccessTokenCreateParams, WhopSDK::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Array of desired scoped actions for the access token. This list must be a subset
|
|
15
|
+
# of the API keys's existing permissions. Otherwise, an error will be raised.
|
|
16
|
+
sig { returns(T::Array[String]) }
|
|
17
|
+
attr_accessor :scoped_actions
|
|
18
|
+
|
|
19
|
+
# The ID of the target resource (Company, User, etc.) for which the access token
|
|
20
|
+
# is being created.
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :target_resource_id
|
|
23
|
+
|
|
24
|
+
# The type of the target resource (company, user, product, experience, etc.).
|
|
25
|
+
sig do
|
|
26
|
+
returns(WhopSDK::AccessTokenCreateParams::TargetResourceType::OrSymbol)
|
|
27
|
+
end
|
|
28
|
+
attr_accessor :target_resource_type
|
|
29
|
+
|
|
30
|
+
# The expiration timestamp for the access token. If not provided, a default
|
|
31
|
+
# expiration time of 1 hour will be used. The expiration can be set to a maximum
|
|
32
|
+
# of 3 hours from the current time.
|
|
33
|
+
sig { returns(T.nilable(Time)) }
|
|
34
|
+
attr_accessor :expires_at
|
|
35
|
+
|
|
36
|
+
sig do
|
|
37
|
+
params(
|
|
38
|
+
scoped_actions: T::Array[String],
|
|
39
|
+
target_resource_id: String,
|
|
40
|
+
target_resource_type:
|
|
41
|
+
WhopSDK::AccessTokenCreateParams::TargetResourceType::OrSymbol,
|
|
42
|
+
expires_at: T.nilable(Time),
|
|
43
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
44
|
+
).returns(T.attached_class)
|
|
45
|
+
end
|
|
46
|
+
def self.new(
|
|
47
|
+
# Array of desired scoped actions for the access token. This list must be a subset
|
|
48
|
+
# of the API keys's existing permissions. Otherwise, an error will be raised.
|
|
49
|
+
scoped_actions:,
|
|
50
|
+
# The ID of the target resource (Company, User, etc.) for which the access token
|
|
51
|
+
# is being created.
|
|
52
|
+
target_resource_id:,
|
|
53
|
+
# The type of the target resource (company, user, product, experience, etc.).
|
|
54
|
+
target_resource_type:,
|
|
55
|
+
# The expiration timestamp for the access token. If not provided, a default
|
|
56
|
+
# expiration time of 1 hour will be used. The expiration can be set to a maximum
|
|
57
|
+
# of 3 hours from the current time.
|
|
58
|
+
expires_at: nil,
|
|
59
|
+
request_options: {}
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
sig do
|
|
64
|
+
override.returns(
|
|
65
|
+
{
|
|
66
|
+
scoped_actions: T::Array[String],
|
|
67
|
+
target_resource_id: String,
|
|
68
|
+
target_resource_type:
|
|
69
|
+
WhopSDK::AccessTokenCreateParams::TargetResourceType::OrSymbol,
|
|
70
|
+
expires_at: T.nilable(Time),
|
|
71
|
+
request_options: WhopSDK::RequestOptions
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
def to_hash
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# The type of the target resource (company, user, product, experience, etc.).
|
|
79
|
+
module TargetResourceType
|
|
80
|
+
extend WhopSDK::Internal::Type::Enum
|
|
81
|
+
|
|
82
|
+
TaggedSymbol =
|
|
83
|
+
T.type_alias do
|
|
84
|
+
T.all(Symbol, WhopSDK::AccessTokenCreateParams::TargetResourceType)
|
|
85
|
+
end
|
|
86
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
87
|
+
|
|
88
|
+
COMPANY =
|
|
89
|
+
T.let(
|
|
90
|
+
:company,
|
|
91
|
+
WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
|
|
92
|
+
)
|
|
93
|
+
PRODUCT =
|
|
94
|
+
T.let(
|
|
95
|
+
:product,
|
|
96
|
+
WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
|
|
97
|
+
)
|
|
98
|
+
EXPERIENCE =
|
|
99
|
+
T.let(
|
|
100
|
+
:experience,
|
|
101
|
+
WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
|
|
102
|
+
)
|
|
103
|
+
APP =
|
|
104
|
+
T.let(
|
|
105
|
+
:app,
|
|
106
|
+
WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
|
|
107
|
+
)
|
|
108
|
+
USER =
|
|
109
|
+
T.let(
|
|
110
|
+
:user,
|
|
111
|
+
WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
sig do
|
|
115
|
+
override.returns(
|
|
116
|
+
T::Array[
|
|
117
|
+
WhopSDK::AccessTokenCreateParams::TargetResourceType::TaggedSymbol
|
|
118
|
+
]
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
def self.values
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class AccessTokenCreateResponse < WhopSDK::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
WhopSDK::Models::AccessTokenCreateResponse,
|
|
10
|
+
WhopSDK::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The JWT access token string.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :token
|
|
17
|
+
|
|
18
|
+
# The expiration timestamp of the access token.
|
|
19
|
+
sig { returns(Time) }
|
|
20
|
+
attr_accessor :expires_at
|
|
21
|
+
|
|
22
|
+
# An object representing an access token used for authenticating API requests.
|
|
23
|
+
sig { params(token: String, expires_at: Time).returns(T.attached_class) }
|
|
24
|
+
def self.new(
|
|
25
|
+
# The JWT access token string.
|
|
26
|
+
token:,
|
|
27
|
+
# The expiration timestamp of the access token.
|
|
28
|
+
expires_at:
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
sig { override.returns({ token: String, expires_at: Time }) }
|
|
33
|
+
def to_hash
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -174,7 +174,7 @@ module WhopSDK
|
|
|
174
174
|
end
|
|
175
175
|
attr_writer :payment_method_configuration
|
|
176
176
|
|
|
177
|
-
# The type of plan that can be attached to
|
|
177
|
+
# The type of plan that can be attached to a product
|
|
178
178
|
sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) }
|
|
179
179
|
attr_accessor :plan_type
|
|
180
180
|
|
|
@@ -291,7 +291,7 @@ module WhopSDK
|
|
|
291
291
|
# The explicit payment method configuration for the plan. If not provided, the
|
|
292
292
|
# platform or company's defaults will apply.
|
|
293
293
|
payment_method_configuration: nil,
|
|
294
|
-
# The type of plan that can be attached to
|
|
294
|
+
# The type of plan that can be attached to a product
|
|
295
295
|
plan_type: nil,
|
|
296
296
|
# Pass this object to create a new product for this plan. We will use the product
|
|
297
297
|
# external identifier to find or create an existing product.
|
|
@@ -621,7 +621,7 @@ module WhopSDK
|
|
|
621
621
|
sig { returns(T.nilable(Float)) }
|
|
622
622
|
attr_accessor :global_affiliate_percentage
|
|
623
623
|
|
|
624
|
-
# The different statuses of the global affiliate program for
|
|
624
|
+
# The different statuses of the global affiliate program for a product.
|
|
625
625
|
sig { returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) }
|
|
626
626
|
attr_accessor :global_affiliate_status
|
|
627
627
|
|
|
@@ -689,7 +689,7 @@ module WhopSDK
|
|
|
689
689
|
description: nil,
|
|
690
690
|
# The percentage of the revenue that goes to the global affiliate program.
|
|
691
691
|
global_affiliate_percentage: nil,
|
|
692
|
-
# The different statuses of the global affiliate program for
|
|
692
|
+
# The different statuses of the global affiliate program for a product.
|
|
693
693
|
global_affiliate_status: nil,
|
|
694
694
|
# The headline of the product.
|
|
695
695
|
headline: nil,
|
|
@@ -32,6 +32,10 @@ module WhopSDK
|
|
|
32
32
|
sig { returns(WhopSDK::Languages::TaggedSymbol) }
|
|
33
33
|
attr_accessor :language
|
|
34
34
|
|
|
35
|
+
# The order of the course within its experience
|
|
36
|
+
sig { returns(String) }
|
|
37
|
+
attr_accessor :order
|
|
38
|
+
|
|
35
39
|
# Whether the course requires students to complete the previous lesson before
|
|
36
40
|
# moving on to the next one
|
|
37
41
|
sig { returns(T::Boolean) }
|
|
@@ -58,6 +62,11 @@ module WhopSDK
|
|
|
58
62
|
sig { returns(Time) }
|
|
59
63
|
attr_accessor :updated_at
|
|
60
64
|
|
|
65
|
+
# The visibility of the course. Determines how / whether this course is visible to
|
|
66
|
+
# users.
|
|
67
|
+
sig { returns(WhopSDK::CourseVisibilities::TaggedSymbol) }
|
|
68
|
+
attr_accessor :visibility
|
|
69
|
+
|
|
61
70
|
# A course from the courses app
|
|
62
71
|
sig do
|
|
63
72
|
params(
|
|
@@ -67,11 +76,13 @@ module WhopSDK
|
|
|
67
76
|
created_at: Time,
|
|
68
77
|
description: T.nilable(String),
|
|
69
78
|
language: WhopSDK::Languages::OrSymbol,
|
|
79
|
+
order: String,
|
|
70
80
|
require_completing_lessons_in_order: T::Boolean,
|
|
71
81
|
tagline: T.nilable(String),
|
|
72
82
|
thumbnail: T.nilable(WhopSDK::Course::Thumbnail::OrHash),
|
|
73
83
|
title: T.nilable(String),
|
|
74
|
-
updated_at: Time
|
|
84
|
+
updated_at: Time,
|
|
85
|
+
visibility: WhopSDK::CourseVisibilities::OrSymbol
|
|
75
86
|
).returns(T.attached_class)
|
|
76
87
|
end
|
|
77
88
|
def self.new(
|
|
@@ -89,6 +100,8 @@ module WhopSDK
|
|
|
89
100
|
# The language spoken in the video content of the course, used to generate closed
|
|
90
101
|
# captions in the right language
|
|
91
102
|
language:,
|
|
103
|
+
# The order of the course within its experience
|
|
104
|
+
order:,
|
|
92
105
|
# Whether the course requires students to complete the previous lesson before
|
|
93
106
|
# moving on to the next one
|
|
94
107
|
require_completing_lessons_in_order:,
|
|
@@ -99,7 +112,10 @@ module WhopSDK
|
|
|
99
112
|
# The title of the course
|
|
100
113
|
title:,
|
|
101
114
|
# The timestamp of when the course was last updated
|
|
102
|
-
updated_at
|
|
115
|
+
updated_at:,
|
|
116
|
+
# The visibility of the course. Determines how / whether this course is visible to
|
|
117
|
+
# users.
|
|
118
|
+
visibility:
|
|
103
119
|
)
|
|
104
120
|
end
|
|
105
121
|
|
|
@@ -112,11 +128,13 @@ module WhopSDK
|
|
|
112
128
|
created_at: Time,
|
|
113
129
|
description: T.nilable(String),
|
|
114
130
|
language: WhopSDK::Languages::TaggedSymbol,
|
|
131
|
+
order: String,
|
|
115
132
|
require_completing_lessons_in_order: T::Boolean,
|
|
116
133
|
tagline: T.nilable(String),
|
|
117
134
|
thumbnail: T.nilable(WhopSDK::Course::Thumbnail),
|
|
118
135
|
title: T.nilable(String),
|
|
119
|
-
updated_at: Time
|
|
136
|
+
updated_at: Time,
|
|
137
|
+
visibility: WhopSDK::CourseVisibilities::TaggedSymbol
|
|
120
138
|
}
|
|
121
139
|
)
|
|
122
140
|
end
|
|
@@ -28,6 +28,12 @@ module WhopSDK
|
|
|
28
28
|
sig { returns(T.nilable(String)) }
|
|
29
29
|
attr_accessor :cover_image
|
|
30
30
|
|
|
31
|
+
# The decimal order position of the course within its experience. If not provided,
|
|
32
|
+
# it will be set to the next sequential order. Use fractional values (e.g., 1.5)
|
|
33
|
+
# to place between existing courses.
|
|
34
|
+
sig { returns(T.nilable(String)) }
|
|
35
|
+
attr_accessor :order
|
|
36
|
+
|
|
31
37
|
# Whether the course requires students to complete the previous lesson before
|
|
32
38
|
# moving on to the next one
|
|
33
39
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -50,12 +56,18 @@ module WhopSDK
|
|
|
50
56
|
end
|
|
51
57
|
attr_accessor :thumbnail
|
|
52
58
|
|
|
59
|
+
# The available visibilities for a course. Determines how / whether a course is
|
|
60
|
+
# visible to users.
|
|
61
|
+
sig { returns(T.nilable(WhopSDK::CourseVisibilities::OrSymbol)) }
|
|
62
|
+
attr_accessor :visibility
|
|
63
|
+
|
|
53
64
|
sig do
|
|
54
65
|
params(
|
|
55
66
|
experience_id: String,
|
|
56
67
|
title: String,
|
|
57
68
|
certificate_after_completion_enabled: T.nilable(T::Boolean),
|
|
58
69
|
cover_image: T.nilable(String),
|
|
70
|
+
order: T.nilable(String),
|
|
59
71
|
require_completing_lessons_in_order: T.nilable(T::Boolean),
|
|
60
72
|
tagline: T.nilable(String),
|
|
61
73
|
thumbnail:
|
|
@@ -65,6 +77,7 @@ module WhopSDK
|
|
|
65
77
|
WhopSDK::CourseCreateParams::Thumbnail::AttachmentInputWithID::OrHash
|
|
66
78
|
)
|
|
67
79
|
),
|
|
80
|
+
visibility: T.nilable(WhopSDK::CourseVisibilities::OrSymbol),
|
|
68
81
|
request_options: WhopSDK::RequestOptions::OrHash
|
|
69
82
|
).returns(T.attached_class)
|
|
70
83
|
end
|
|
@@ -78,6 +91,10 @@ module WhopSDK
|
|
|
78
91
|
certificate_after_completion_enabled: nil,
|
|
79
92
|
# The cover image URL of the course
|
|
80
93
|
cover_image: nil,
|
|
94
|
+
# The decimal order position of the course within its experience. If not provided,
|
|
95
|
+
# it will be set to the next sequential order. Use fractional values (e.g., 1.5)
|
|
96
|
+
# to place between existing courses.
|
|
97
|
+
order: nil,
|
|
81
98
|
# Whether the course requires students to complete the previous lesson before
|
|
82
99
|
# moving on to the next one
|
|
83
100
|
require_completing_lessons_in_order: nil,
|
|
@@ -85,6 +102,9 @@ module WhopSDK
|
|
|
85
102
|
tagline: nil,
|
|
86
103
|
# The thumbnail for the course in png, jpeg, or gif format
|
|
87
104
|
thumbnail: nil,
|
|
105
|
+
# The available visibilities for a course. Determines how / whether a course is
|
|
106
|
+
# visible to users.
|
|
107
|
+
visibility: nil,
|
|
88
108
|
request_options: {}
|
|
89
109
|
)
|
|
90
110
|
end
|
|
@@ -96,6 +116,7 @@ module WhopSDK
|
|
|
96
116
|
title: String,
|
|
97
117
|
certificate_after_completion_enabled: T.nilable(T::Boolean),
|
|
98
118
|
cover_image: T.nilable(String),
|
|
119
|
+
order: T.nilable(String),
|
|
99
120
|
require_completing_lessons_in_order: T.nilable(T::Boolean),
|
|
100
121
|
tagline: T.nilable(String),
|
|
101
122
|
thumbnail:
|
|
@@ -105,6 +126,7 @@ module WhopSDK
|
|
|
105
126
|
WhopSDK::CourseCreateParams::Thumbnail::AttachmentInputWithID
|
|
106
127
|
)
|
|
107
128
|
),
|
|
129
|
+
visibility: T.nilable(WhopSDK::CourseVisibilities::OrSymbol),
|
|
108
130
|
request_options: WhopSDK::RequestOptions
|
|
109
131
|
}
|
|
110
132
|
)
|