whop_sdk 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +20 -0
- data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +30 -24
- data/lib/whop_sdk/models/assessment_question_types.rb +18 -0
- data/lib/whop_sdk/models/billing_reasons.rb +20 -0
- data/lib/whop_sdk/models/card_brands.rb +30 -0
- data/lib/whop_sdk/models/checkout_configuration.rb +10 -7
- data/lib/whop_sdk/models/checkout_configuration_create_params.rb +140 -3
- data/lib/whop_sdk/models/checkout_configuration_list_response.rb +10 -7
- data/lib/whop_sdk/models/course.rb +230 -0
- data/lib/whop_sdk/models/course_chapter.rb +72 -0
- data/lib/whop_sdk/models/course_chapter_create_params.rb +30 -0
- data/lib/whop_sdk/models/course_chapter_delete_params.rb +14 -0
- data/lib/whop_sdk/models/course_chapter_delete_response.rb +8 -0
- data/lib/whop_sdk/models/course_chapter_list_params.rb +54 -0
- data/lib/whop_sdk/models/course_chapter_list_response.rb +35 -0
- data/lib/whop_sdk/models/course_chapter_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/course_chapter_update_params.rb +22 -0
- data/lib/whop_sdk/models/course_create_params.rb +82 -0
- data/lib/whop_sdk/models/course_delete_params.rb +14 -0
- data/lib/whop_sdk/models/course_delete_response.rb +8 -0
- data/lib/whop_sdk/models/course_lesson_create_params.rb +54 -0
- data/lib/whop_sdk/models/course_lesson_delete_params.rb +14 -0
- data/lib/whop_sdk/models/course_lesson_delete_response.rb +8 -0
- data/lib/whop_sdk/models/course_lesson_list_params.rb +62 -0
- data/lib/whop_sdk/models/course_lesson_list_response.rb +71 -0
- data/lib/whop_sdk/models/course_lesson_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/course_lesson_update_params.rb +278 -0
- data/lib/whop_sdk/models/course_list_params.rb +62 -0
- data/lib/whop_sdk/models/course_list_response.rb +148 -0
- data/lib/whop_sdk/models/course_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/course_update_params.rb +197 -0
- data/lib/whop_sdk/models/experience_duplicate_params.rb +22 -0
- data/lib/whop_sdk/models/forum_post.rb +17 -1
- data/lib/whop_sdk/models/forum_post_list_response.rb +17 -1
- data/lib/whop_sdk/models/forum_post_update_params.rb +80 -0
- data/lib/whop_sdk/models/invoice.rb +6 -2
- data/lib/whop_sdk/models/invoice_list_item.rb +6 -2
- data/lib/whop_sdk/models/languages.rb +36 -0
- data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +9 -0
- data/lib/whop_sdk/models/lesson.rb +365 -0
- data/lib/whop_sdk/models/lesson_types.rb +20 -0
- data/lib/whop_sdk/models/lesson_visibilities.rb +17 -0
- data/lib/whop_sdk/models/member_list_params.rb +9 -1
- data/lib/whop_sdk/models/membership.rb +31 -1
- data/lib/whop_sdk/models/membership_list_params.rb +16 -8
- data/lib/whop_sdk/models/membership_list_response.rb +31 -1
- data/lib/whop_sdk/models/message_update_params.rb +68 -0
- data/lib/whop_sdk/models/payment.rb +24 -21
- data/lib/whop_sdk/models/payment_list_params.rb +3 -18
- data/lib/whop_sdk/models/payment_list_response.rb +24 -21
- data/lib/whop_sdk/models/payment_method_types.rb +98 -0
- data/lib/whop_sdk/models/plan.rb +25 -1
- data/lib/whop_sdk/models/plan_create_params.rb +37 -3
- data/lib/whop_sdk/models/plan_list_response.rb +25 -1
- data/lib/whop_sdk/models/plan_update_params.rb +35 -1
- data/lib/whop_sdk/models/product.rb +11 -1
- data/lib/whop_sdk/models/product_create_params.rb +1 -45
- data/lib/whop_sdk/models/product_list_item.rb +14 -1
- data/lib/whop_sdk/models/product_update_params.rb +30 -1
- data/lib/whop_sdk/models/promo_code.rb +211 -0
- data/lib/whop_sdk/models/promo_code_create_params.rb +140 -0
- data/lib/whop_sdk/models/promo_code_delete_params.rb +14 -0
- data/lib/whop_sdk/models/promo_code_delete_response.rb +8 -0
- data/lib/whop_sdk/models/promo_code_list_params.rb +78 -0
- data/lib/whop_sdk/models/promo_code_list_response.rb +181 -0
- data/lib/whop_sdk/models/promo_code_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/promo_code_status.rb +17 -0
- data/lib/whop_sdk/models/promo_duration.rb +17 -0
- data/lib/whop_sdk/models/review_list_params.rb +70 -0
- data/lib/whop_sdk/models/review_list_response.rb +183 -0
- data/lib/whop_sdk/models/review_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/review_retrieve_response.rb +251 -0
- data/lib/whop_sdk/models/review_status.rb +17 -0
- data/lib/whop_sdk/models.rb +76 -0
- data/lib/whop_sdk/resources/checkout_configurations.rb +2 -0
- data/lib/whop_sdk/resources/course_chapters.rb +151 -0
- data/lib/whop_sdk/resources/course_lessons.rb +178 -0
- data/lib/whop_sdk/resources/courses.rb +178 -0
- data/lib/whop_sdk/resources/experiences.rb +33 -0
- data/lib/whop_sdk/resources/forum_posts.rb +33 -0
- data/lib/whop_sdk/resources/members.rb +3 -1
- data/lib/whop_sdk/resources/memberships.rb +6 -4
- data/lib/whop_sdk/resources/messages.rb +28 -0
- data/lib/whop_sdk/resources/payments.rb +1 -1
- data/lib/whop_sdk/resources/plans.rb +19 -3
- data/lib/whop_sdk/resources/products.rb +4 -6
- data/lib/whop_sdk/resources/promo_codes.rb +161 -0
- data/lib/whop_sdk/resources/reviews.rb +68 -0
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +53 -0
- data/rbi/whop_sdk/client.rbi +15 -0
- data/rbi/whop_sdk/models/assessment_question_types.rbi +31 -0
- data/rbi/whop_sdk/models/billing_reasons.rbi +27 -0
- data/rbi/whop_sdk/models/card_brands.rbi +35 -0
- data/rbi/whop_sdk/models/checkout_configuration.rbi +4 -2
- data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +183 -2
- data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +4 -2
- data/rbi/whop_sdk/models/course.rbi +313 -0
- data/rbi/whop_sdk/models/course_chapter.rbi +101 -0
- data/rbi/whop_sdk/models/course_chapter_create_params.rbi +51 -0
- data/rbi/whop_sdk/models/course_chapter_delete_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_chapter_delete_response.rbi +8 -0
- data/rbi/whop_sdk/models/course_chapter_list_params.rbi +75 -0
- data/rbi/whop_sdk/models/course_chapter_list_response.rbi +47 -0
- data/rbi/whop_sdk/models/course_chapter_retrieve_params.rbi +30 -0
- data/rbi/whop_sdk/models/course_chapter_update_params.rbi +40 -0
- data/rbi/whop_sdk/models/course_create_params.rbi +131 -0
- data/rbi/whop_sdk/models/course_delete_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_delete_response.rbi +7 -0
- data/rbi/whop_sdk/models/course_lesson_create_params.rbi +75 -0
- data/rbi/whop_sdk/models/course_lesson_delete_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_lesson_delete_response.rbi +8 -0
- data/rbi/whop_sdk/models/course_lesson_list_params.rbi +83 -0
- data/rbi/whop_sdk/models/course_lesson_list_response.rbi +91 -0
- data/rbi/whop_sdk/models/course_lesson_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_lesson_update_params.rbi +465 -0
- data/rbi/whop_sdk/models/course_list_params.rbi +83 -0
- data/rbi/whop_sdk/models/course_list_response.rbi +198 -0
- data/rbi/whop_sdk/models/course_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/course_update_params.rbi +293 -0
- data/rbi/whop_sdk/models/experience_duplicate_params.rbi +40 -0
- data/rbi/whop_sdk/models/forum_post.rbi +16 -0
- data/rbi/whop_sdk/models/forum_post_list_response.rbi +16 -0
- data/rbi/whop_sdk/models/forum_post_update_params.rbi +124 -0
- data/rbi/whop_sdk/models/invoice.rbi +4 -2
- data/rbi/whop_sdk/models/invoice_list_item.rbi +4 -2
- data/rbi/whop_sdk/models/languages.rbi +40 -0
- data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +45 -0
- data/rbi/whop_sdk/models/lesson.rbi +517 -0
- data/rbi/whop_sdk/models/lesson_types.rbi +25 -0
- data/rbi/whop_sdk/models/lesson_visibilities.rbi +23 -0
- data/rbi/whop_sdk/models/member_list_params.rbi +8 -0
- data/rbi/whop_sdk/models/membership.rbi +40 -0
- data/rbi/whop_sdk/models/membership_list_params.rbi +16 -8
- data/rbi/whop_sdk/models/membership_list_response.rbi +47 -0
- data/rbi/whop_sdk/models/message_update_params.rbi +114 -0
- data/rbi/whop_sdk/models/payment.rbi +32 -25
- data/rbi/whop_sdk/models/payment_list_params.rbi +3 -63
- data/rbi/whop_sdk/models/payment_list_response.rbi +32 -25
- data/rbi/whop_sdk/models/payment_method_types.rbi +116 -0
- data/rbi/whop_sdk/models/plan.rbi +24 -0
- data/rbi/whop_sdk/models/plan_create_params.rbi +38 -2
- data/rbi/whop_sdk/models/plan_list_response.rbi +24 -0
- data/rbi/whop_sdk/models/plan_update_params.rbi +36 -0
- data/rbi/whop_sdk/models/product.rbi +12 -0
- data/rbi/whop_sdk/models/product_create_params.rbi +0 -74
- data/rbi/whop_sdk/models/product_list_item.rbi +12 -0
- data/rbi/whop_sdk/models/product_update_params.rbi +59 -0
- data/rbi/whop_sdk/models/promo_code.rbi +248 -0
- data/rbi/whop_sdk/models/promo_code_create_params.rbi +161 -0
- data/rbi/whop_sdk/models/promo_code_delete_params.rbi +27 -0
- data/rbi/whop_sdk/models/promo_code_delete_response.rbi +8 -0
- data/rbi/whop_sdk/models/promo_code_list_params.rbi +99 -0
- data/rbi/whop_sdk/models/promo_code_list_response.rbi +222 -0
- data/rbi/whop_sdk/models/promo_code_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/promo_code_status.rbi +21 -0
- data/rbi/whop_sdk/models/promo_duration.rbi +21 -0
- data/rbi/whop_sdk/models/review_list_params.rbi +91 -0
- data/rbi/whop_sdk/models/review_list_response.rbi +243 -0
- data/rbi/whop_sdk/models/review_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/review_retrieve_response.rbi +354 -0
- data/rbi/whop_sdk/models/review_status.rbi +21 -0
- data/rbi/whop_sdk/models.rbi +76 -0
- data/rbi/whop_sdk/resources/checkout_configurations.rbi +2 -0
- data/rbi/whop_sdk/resources/course_chapters.rbi +115 -0
- data/rbi/whop_sdk/resources/course_lessons.rbi +163 -0
- data/rbi/whop_sdk/resources/courses.rbi +152 -0
- data/rbi/whop_sdk/resources/experiences.rbi +25 -0
- data/rbi/whop_sdk/resources/forum_posts.rbi +29 -0
- data/rbi/whop_sdk/resources/members.rbi +3 -0
- data/rbi/whop_sdk/resources/memberships.rbi +6 -3
- data/rbi/whop_sdk/resources/messages.rbi +25 -0
- data/rbi/whop_sdk/resources/payments.rbi +1 -3
- data/rbi/whop_sdk/resources/plans.rbi +29 -1
- data/rbi/whop_sdk/resources/products.rbi +4 -7
- data/rbi/whop_sdk/resources/promo_codes.rbi +147 -0
- data/rbi/whop_sdk/resources/reviews.rbi +56 -0
- data/sig/whop_sdk/client.rbs +10 -0
- data/sig/whop_sdk/models/assessment_question_types.rbs +17 -0
- data/sig/whop_sdk/models/billing_reasons.rbs +24 -0
- data/sig/whop_sdk/models/card_brands.rbs +44 -0
- data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +87 -0
- data/sig/whop_sdk/models/course.rbs +171 -0
- data/sig/whop_sdk/models/course_chapter.rbs +49 -0
- data/sig/whop_sdk/models/course_chapter_create_params.rbs +28 -0
- data/sig/whop_sdk/models/course_chapter_delete_params.rbs +15 -0
- data/sig/whop_sdk/models/course_chapter_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/course_chapter_list_params.rbs +46 -0
- data/sig/whop_sdk/models/course_chapter_list_response.rbs +18 -0
- data/sig/whop_sdk/models/course_chapter_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/course_chapter_update_params.rbs +23 -0
- data/sig/whop_sdk/models/course_create_params.rbs +58 -0
- data/sig/whop_sdk/models/course_delete_params.rbs +15 -0
- data/sig/whop_sdk/models/course_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/course_lesson_create_params.rbs +46 -0
- data/sig/whop_sdk/models/course_lesson_delete_params.rbs +15 -0
- data/sig/whop_sdk/models/course_lesson_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/course_lesson_list_params.rbs +51 -0
- data/sig/whop_sdk/models/course_lesson_list_response.rbs +50 -0
- data/sig/whop_sdk/models/course_lesson_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/course_lesson_update_params.rbs +162 -0
- data/sig/whop_sdk/models/course_list_params.rbs +51 -0
- data/sig/whop_sdk/models/course_list_response.rbs +102 -0
- data/sig/whop_sdk/models/course_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/course_update_params.rbs +137 -0
- data/sig/whop_sdk/models/experience_duplicate_params.rbs +23 -0
- data/sig/whop_sdk/models/forum_post.rbs +10 -0
- data/sig/whop_sdk/models/forum_post_list_response.rbs +10 -0
- data/sig/whop_sdk/models/forum_post_update_params.rbs +53 -0
- data/sig/whop_sdk/models/languages.rbs +56 -0
- data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +20 -1
- data/sig/whop_sdk/models/lesson.rbs +248 -0
- data/sig/whop_sdk/models/lesson_types.rbs +19 -0
- data/sig/whop_sdk/models/lesson_visibilities.rbs +14 -0
- data/sig/whop_sdk/models/member_list_params.rbs +6 -1
- data/sig/whop_sdk/models/membership.rbs +17 -0
- data/sig/whop_sdk/models/membership_list_params.rbs +11 -6
- data/sig/whop_sdk/models/membership_list_response.rbs +17 -0
- data/sig/whop_sdk/models/message_update_params.rbs +48 -0
- data/sig/whop_sdk/models/payment.rbs +12 -12
- data/sig/whop_sdk/models/payment_list_params.rbs +4 -25
- data/sig/whop_sdk/models/payment_list_response.rbs +12 -12
- data/sig/whop_sdk/models/payment_method_types.rbs +180 -0
- data/sig/whop_sdk/models/plan.rbs +15 -0
- data/sig/whop_sdk/models/plan_create_params.rbs +20 -0
- data/sig/whop_sdk/models/plan_list_response.rbs +15 -0
- data/sig/whop_sdk/models/plan_update_params.rbs +20 -0
- data/sig/whop_sdk/models/product.rbs +5 -0
- data/sig/whop_sdk/models/product_create_params.rbs +0 -22
- data/sig/whop_sdk/models/product_list_item.rbs +5 -0
- data/sig/whop_sdk/models/product_update_params.rbs +17 -0
- data/sig/whop_sdk/models/promo_code.rbs +134 -0
- data/sig/whop_sdk/models/promo_code_create_params.rbs +96 -0
- data/sig/whop_sdk/models/promo_code_delete_params.rbs +15 -0
- data/sig/whop_sdk/models/promo_code_delete_response.rbs +5 -0
- data/sig/whop_sdk/models/promo_code_list_params.rbs +61 -0
- data/sig/whop_sdk/models/promo_code_list_response.rbs +117 -0
- data/sig/whop_sdk/models/promo_code_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/promo_code_status.rbs +15 -0
- data/sig/whop_sdk/models/promo_duration.rbs +15 -0
- data/sig/whop_sdk/models/review_list_params.rbs +56 -0
- data/sig/whop_sdk/models/review_list_response.rbs +116 -0
- data/sig/whop_sdk/models/review_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/review_retrieve_response.rbs +152 -0
- data/sig/whop_sdk/models/review_status.rbs +15 -0
- data/sig/whop_sdk/models.rbs +76 -0
- data/sig/whop_sdk/resources/course_chapters.rbs +35 -0
- data/sig/whop_sdk/resources/course_lessons.rbs +47 -0
- data/sig/whop_sdk/resources/courses.rbs +47 -0
- data/sig/whop_sdk/resources/experiences.rbs +6 -0
- data/sig/whop_sdk/resources/forum_posts.rbs +9 -0
- data/sig/whop_sdk/resources/members.rbs +1 -0
- data/sig/whop_sdk/resources/memberships.rbs +2 -1
- data/sig/whop_sdk/resources/messages.rbs +8 -0
- data/sig/whop_sdk/resources/payments.rbs +1 -1
- data/sig/whop_sdk/resources/plans.rbs +8 -0
- data/sig/whop_sdk/resources/products.rbs +1 -2
- data/sig/whop_sdk/resources/promo_codes.rbs +45 -0
- data/sig/whop_sdk/resources/reviews.rbs +23 -0
- metadata +189 -2
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class PromoCodeListParams < 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::PromoCodeListParams, WhopSDK::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the company to list promo codes for
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :company_id
|
|
17
|
+
|
|
18
|
+
# Returns the elements in the list that come after the specified cursor.
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_accessor :after
|
|
21
|
+
|
|
22
|
+
# Returns the elements in the list that come before the specified cursor.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_accessor :before
|
|
25
|
+
|
|
26
|
+
# Returns the first _n_ elements from the list.
|
|
27
|
+
sig { returns(T.nilable(Integer)) }
|
|
28
|
+
attr_accessor :first
|
|
29
|
+
|
|
30
|
+
# Returns the last _n_ elements from the list.
|
|
31
|
+
sig { returns(T.nilable(Integer)) }
|
|
32
|
+
attr_accessor :last
|
|
33
|
+
|
|
34
|
+
# Filter promo codes by plan ID(s)
|
|
35
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
36
|
+
attr_accessor :plan_ids
|
|
37
|
+
|
|
38
|
+
# Filter promo codes by product ID(s)
|
|
39
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
40
|
+
attr_accessor :product_ids
|
|
41
|
+
|
|
42
|
+
# Statuses for promo codes
|
|
43
|
+
sig { returns(T.nilable(WhopSDK::PromoCodeStatus::OrSymbol)) }
|
|
44
|
+
attr_accessor :status
|
|
45
|
+
|
|
46
|
+
sig do
|
|
47
|
+
params(
|
|
48
|
+
company_id: String,
|
|
49
|
+
after: T.nilable(String),
|
|
50
|
+
before: T.nilable(String),
|
|
51
|
+
first: T.nilable(Integer),
|
|
52
|
+
last: T.nilable(Integer),
|
|
53
|
+
plan_ids: T.nilable(T::Array[String]),
|
|
54
|
+
product_ids: T.nilable(T::Array[String]),
|
|
55
|
+
status: T.nilable(WhopSDK::PromoCodeStatus::OrSymbol),
|
|
56
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
57
|
+
).returns(T.attached_class)
|
|
58
|
+
end
|
|
59
|
+
def self.new(
|
|
60
|
+
# The ID of the company to list promo codes for
|
|
61
|
+
company_id:,
|
|
62
|
+
# Returns the elements in the list that come after the specified cursor.
|
|
63
|
+
after: nil,
|
|
64
|
+
# Returns the elements in the list that come before the specified cursor.
|
|
65
|
+
before: nil,
|
|
66
|
+
# Returns the first _n_ elements from the list.
|
|
67
|
+
first: nil,
|
|
68
|
+
# Returns the last _n_ elements from the list.
|
|
69
|
+
last: nil,
|
|
70
|
+
# Filter promo codes by plan ID(s)
|
|
71
|
+
plan_ids: nil,
|
|
72
|
+
# Filter promo codes by product ID(s)
|
|
73
|
+
product_ids: nil,
|
|
74
|
+
# Statuses for promo codes
|
|
75
|
+
status: nil,
|
|
76
|
+
request_options: {}
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
sig do
|
|
81
|
+
override.returns(
|
|
82
|
+
{
|
|
83
|
+
company_id: String,
|
|
84
|
+
after: T.nilable(String),
|
|
85
|
+
before: T.nilable(String),
|
|
86
|
+
first: T.nilable(Integer),
|
|
87
|
+
last: T.nilable(Integer),
|
|
88
|
+
plan_ids: T.nilable(T::Array[String]),
|
|
89
|
+
product_ids: T.nilable(T::Array[String]),
|
|
90
|
+
status: T.nilable(WhopSDK::PromoCodeStatus::OrSymbol),
|
|
91
|
+
request_options: WhopSDK::RequestOptions
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
def to_hash
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class PromoCodeListResponse < WhopSDK::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
WhopSDK::Models::PromoCodeListResponse,
|
|
10
|
+
WhopSDK::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the promo.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# The amount off (% or flat amount) for the promo.
|
|
19
|
+
sig { returns(Float) }
|
|
20
|
+
attr_accessor :amount_off
|
|
21
|
+
|
|
22
|
+
# Restricts promo use to only users who have churned from the company before.
|
|
23
|
+
sig { returns(T::Boolean) }
|
|
24
|
+
attr_accessor :churned_users_only
|
|
25
|
+
|
|
26
|
+
# The specific code used to apply the promo at checkout.
|
|
27
|
+
sig { returns(T.nilable(String)) }
|
|
28
|
+
attr_accessor :code
|
|
29
|
+
|
|
30
|
+
# The timestamp of when the promo was created.
|
|
31
|
+
sig { returns(Time) }
|
|
32
|
+
attr_accessor :created_at
|
|
33
|
+
|
|
34
|
+
# The monetary currency of the promo code.
|
|
35
|
+
sig { returns(WhopSDK::Currency::TaggedSymbol) }
|
|
36
|
+
attr_accessor :currency
|
|
37
|
+
|
|
38
|
+
# The duration setting for the promo code
|
|
39
|
+
sig { returns(T.nilable(WhopSDK::PromoDuration::TaggedSymbol)) }
|
|
40
|
+
attr_accessor :duration
|
|
41
|
+
|
|
42
|
+
# Restricts promo use to only be applied to already purchased memberships.
|
|
43
|
+
sig { returns(T::Boolean) }
|
|
44
|
+
attr_accessor :existing_memberships_only
|
|
45
|
+
|
|
46
|
+
# The date/time of when the promo expires.
|
|
47
|
+
sig { returns(T.nilable(Time)) }
|
|
48
|
+
attr_accessor :expires_at
|
|
49
|
+
|
|
50
|
+
# Restricts promo use to only users who have never purchased from the company
|
|
51
|
+
# before.
|
|
52
|
+
sig { returns(T::Boolean) }
|
|
53
|
+
attr_accessor :new_users_only
|
|
54
|
+
|
|
55
|
+
# Restricts promo use to only be applied once per customer.
|
|
56
|
+
sig { returns(T::Boolean) }
|
|
57
|
+
attr_accessor :one_per_customer
|
|
58
|
+
|
|
59
|
+
# The access pass associated with the promo code.
|
|
60
|
+
sig do
|
|
61
|
+
returns(T.nilable(WhopSDK::Models::PromoCodeListResponse::Product))
|
|
62
|
+
end
|
|
63
|
+
attr_reader :product
|
|
64
|
+
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
product:
|
|
68
|
+
T.nilable(WhopSDK::Models::PromoCodeListResponse::Product::OrHash)
|
|
69
|
+
).void
|
|
70
|
+
end
|
|
71
|
+
attr_writer :product
|
|
72
|
+
|
|
73
|
+
# The number of months the promo is applied for.
|
|
74
|
+
sig { returns(T.nilable(Integer)) }
|
|
75
|
+
attr_accessor :promo_duration_months
|
|
76
|
+
|
|
77
|
+
# The type (% or flat amount) of the promo.
|
|
78
|
+
sig { returns(WhopSDK::PromoType::TaggedSymbol) }
|
|
79
|
+
attr_accessor :promo_type
|
|
80
|
+
|
|
81
|
+
# Indicates if the promo code is live or disabled.
|
|
82
|
+
sig { returns(WhopSDK::PromoCodeStatus::TaggedSymbol) }
|
|
83
|
+
attr_accessor :status
|
|
84
|
+
|
|
85
|
+
# The quantity limit on the number of uses.
|
|
86
|
+
sig { returns(Integer) }
|
|
87
|
+
attr_accessor :stock
|
|
88
|
+
|
|
89
|
+
# Whether or not the promo code has unlimited stock.
|
|
90
|
+
sig { returns(T::Boolean) }
|
|
91
|
+
attr_accessor :unlimited_stock
|
|
92
|
+
|
|
93
|
+
# The amount of times the promo codes has been used.
|
|
94
|
+
sig { returns(Integer) }
|
|
95
|
+
attr_accessor :uses
|
|
96
|
+
|
|
97
|
+
# An object representing a promo code for a plan.
|
|
98
|
+
sig do
|
|
99
|
+
params(
|
|
100
|
+
id: String,
|
|
101
|
+
amount_off: Float,
|
|
102
|
+
churned_users_only: T::Boolean,
|
|
103
|
+
code: T.nilable(String),
|
|
104
|
+
created_at: Time,
|
|
105
|
+
currency: WhopSDK::Currency::OrSymbol,
|
|
106
|
+
duration: T.nilable(WhopSDK::PromoDuration::OrSymbol),
|
|
107
|
+
existing_memberships_only: T::Boolean,
|
|
108
|
+
expires_at: T.nilable(Time),
|
|
109
|
+
new_users_only: T::Boolean,
|
|
110
|
+
one_per_customer: T::Boolean,
|
|
111
|
+
product:
|
|
112
|
+
T.nilable(WhopSDK::Models::PromoCodeListResponse::Product::OrHash),
|
|
113
|
+
promo_duration_months: T.nilable(Integer),
|
|
114
|
+
promo_type: WhopSDK::PromoType::OrSymbol,
|
|
115
|
+
status: WhopSDK::PromoCodeStatus::OrSymbol,
|
|
116
|
+
stock: Integer,
|
|
117
|
+
unlimited_stock: T::Boolean,
|
|
118
|
+
uses: Integer
|
|
119
|
+
).returns(T.attached_class)
|
|
120
|
+
end
|
|
121
|
+
def self.new(
|
|
122
|
+
# The ID of the promo.
|
|
123
|
+
id:,
|
|
124
|
+
# The amount off (% or flat amount) for the promo.
|
|
125
|
+
amount_off:,
|
|
126
|
+
# Restricts promo use to only users who have churned from the company before.
|
|
127
|
+
churned_users_only:,
|
|
128
|
+
# The specific code used to apply the promo at checkout.
|
|
129
|
+
code:,
|
|
130
|
+
# The timestamp of when the promo was created.
|
|
131
|
+
created_at:,
|
|
132
|
+
# The monetary currency of the promo code.
|
|
133
|
+
currency:,
|
|
134
|
+
# The duration setting for the promo code
|
|
135
|
+
duration:,
|
|
136
|
+
# Restricts promo use to only be applied to already purchased memberships.
|
|
137
|
+
existing_memberships_only:,
|
|
138
|
+
# The date/time of when the promo expires.
|
|
139
|
+
expires_at:,
|
|
140
|
+
# Restricts promo use to only users who have never purchased from the company
|
|
141
|
+
# before.
|
|
142
|
+
new_users_only:,
|
|
143
|
+
# Restricts promo use to only be applied once per customer.
|
|
144
|
+
one_per_customer:,
|
|
145
|
+
# The access pass associated with the promo code.
|
|
146
|
+
product:,
|
|
147
|
+
# The number of months the promo is applied for.
|
|
148
|
+
promo_duration_months:,
|
|
149
|
+
# The type (% or flat amount) of the promo.
|
|
150
|
+
promo_type:,
|
|
151
|
+
# Indicates if the promo code is live or disabled.
|
|
152
|
+
status:,
|
|
153
|
+
# The quantity limit on the number of uses.
|
|
154
|
+
stock:,
|
|
155
|
+
# Whether or not the promo code has unlimited stock.
|
|
156
|
+
unlimited_stock:,
|
|
157
|
+
# The amount of times the promo codes has been used.
|
|
158
|
+
uses:
|
|
159
|
+
)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
sig do
|
|
163
|
+
override.returns(
|
|
164
|
+
{
|
|
165
|
+
id: String,
|
|
166
|
+
amount_off: Float,
|
|
167
|
+
churned_users_only: T::Boolean,
|
|
168
|
+
code: T.nilable(String),
|
|
169
|
+
created_at: Time,
|
|
170
|
+
currency: WhopSDK::Currency::TaggedSymbol,
|
|
171
|
+
duration: T.nilable(WhopSDK::PromoDuration::TaggedSymbol),
|
|
172
|
+
existing_memberships_only: T::Boolean,
|
|
173
|
+
expires_at: T.nilable(Time),
|
|
174
|
+
new_users_only: T::Boolean,
|
|
175
|
+
one_per_customer: T::Boolean,
|
|
176
|
+
product: T.nilable(WhopSDK::Models::PromoCodeListResponse::Product),
|
|
177
|
+
promo_duration_months: T.nilable(Integer),
|
|
178
|
+
promo_type: WhopSDK::PromoType::TaggedSymbol,
|
|
179
|
+
status: WhopSDK::PromoCodeStatus::TaggedSymbol,
|
|
180
|
+
stock: Integer,
|
|
181
|
+
unlimited_stock: T::Boolean,
|
|
182
|
+
uses: Integer
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
def to_hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
class Product < WhopSDK::Internal::Type::BaseModel
|
|
190
|
+
OrHash =
|
|
191
|
+
T.type_alias do
|
|
192
|
+
T.any(
|
|
193
|
+
WhopSDK::Models::PromoCodeListResponse::Product,
|
|
194
|
+
WhopSDK::Internal::AnyHash
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# The internal ID of the public product.
|
|
199
|
+
sig { returns(String) }
|
|
200
|
+
attr_accessor :id
|
|
201
|
+
|
|
202
|
+
# The title of the product. Use for Whop 4.0.
|
|
203
|
+
sig { returns(String) }
|
|
204
|
+
attr_accessor :title
|
|
205
|
+
|
|
206
|
+
# The access pass associated with the promo code.
|
|
207
|
+
sig { params(id: String, title: String).returns(T.attached_class) }
|
|
208
|
+
def self.new(
|
|
209
|
+
# The internal ID of the public product.
|
|
210
|
+
id:,
|
|
211
|
+
# The title of the product. Use for Whop 4.0.
|
|
212
|
+
title:
|
|
213
|
+
)
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
sig { override.returns({ id: String, title: String }) }
|
|
217
|
+
def to_hash
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class PromoCodeRetrieveParams < 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::PromoCodeRetrieveParams, WhopSDK::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
params(request_options: WhopSDK::RequestOptions::OrHash).returns(
|
|
16
|
+
T.attached_class
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
def self.new(request_options: {})
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { override.returns({ request_options: WhopSDK::RequestOptions }) }
|
|
23
|
+
def to_hash
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# Statuses for promo codes
|
|
6
|
+
module PromoCodeStatus
|
|
7
|
+
extend WhopSDK::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::PromoCodeStatus) }
|
|
10
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
11
|
+
|
|
12
|
+
ACTIVE = T.let(:active, WhopSDK::PromoCodeStatus::TaggedSymbol)
|
|
13
|
+
INACTIVE = T.let(:inactive, WhopSDK::PromoCodeStatus::TaggedSymbol)
|
|
14
|
+
ARCHIVED = T.let(:archived, WhopSDK::PromoCodeStatus::TaggedSymbol)
|
|
15
|
+
|
|
16
|
+
sig { override.returns(T::Array[WhopSDK::PromoCodeStatus::TaggedSymbol]) }
|
|
17
|
+
def self.values
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# The duration setting for the promo code
|
|
6
|
+
module PromoDuration
|
|
7
|
+
extend WhopSDK::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::PromoDuration) }
|
|
10
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
11
|
+
|
|
12
|
+
FOREVER = T.let(:forever, WhopSDK::PromoDuration::TaggedSymbol)
|
|
13
|
+
ONCE = T.let(:once, WhopSDK::PromoDuration::TaggedSymbol)
|
|
14
|
+
REPEATING = T.let(:repeating, WhopSDK::PromoDuration::TaggedSymbol)
|
|
15
|
+
|
|
16
|
+
sig { override.returns(T::Array[WhopSDK::PromoDuration::TaggedSymbol]) }
|
|
17
|
+
def self.values
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class ReviewListParams < 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::ReviewListParams, WhopSDK::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the product
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :product_id
|
|
17
|
+
|
|
18
|
+
# Returns the elements in the list that come after the specified cursor.
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_accessor :after
|
|
21
|
+
|
|
22
|
+
# Returns the elements in the list that come before the specified cursor.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_accessor :before
|
|
25
|
+
|
|
26
|
+
# Returns the first _n_ elements from the list.
|
|
27
|
+
sig { returns(T.nilable(Integer)) }
|
|
28
|
+
attr_accessor :first
|
|
29
|
+
|
|
30
|
+
# Returns the last _n_ elements from the list.
|
|
31
|
+
sig { returns(T.nilable(Integer)) }
|
|
32
|
+
attr_accessor :last
|
|
33
|
+
|
|
34
|
+
# The maximum star rating of the review (inclusive)
|
|
35
|
+
sig { returns(T.nilable(Integer)) }
|
|
36
|
+
attr_accessor :max_stars
|
|
37
|
+
|
|
38
|
+
# The minimum star rating of the review (inclusive)
|
|
39
|
+
sig { returns(T.nilable(Integer)) }
|
|
40
|
+
attr_accessor :min_stars
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
product_id: String,
|
|
45
|
+
after: T.nilable(String),
|
|
46
|
+
before: T.nilable(String),
|
|
47
|
+
first: T.nilable(Integer),
|
|
48
|
+
last: T.nilable(Integer),
|
|
49
|
+
max_stars: T.nilable(Integer),
|
|
50
|
+
min_stars: T.nilable(Integer),
|
|
51
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
52
|
+
).returns(T.attached_class)
|
|
53
|
+
end
|
|
54
|
+
def self.new(
|
|
55
|
+
# The ID of the product
|
|
56
|
+
product_id:,
|
|
57
|
+
# Returns the elements in the list that come after the specified cursor.
|
|
58
|
+
after: nil,
|
|
59
|
+
# Returns the elements in the list that come before the specified cursor.
|
|
60
|
+
before: nil,
|
|
61
|
+
# Returns the first _n_ elements from the list.
|
|
62
|
+
first: nil,
|
|
63
|
+
# Returns the last _n_ elements from the list.
|
|
64
|
+
last: nil,
|
|
65
|
+
# The maximum star rating of the review (inclusive)
|
|
66
|
+
max_stars: nil,
|
|
67
|
+
# The minimum star rating of the review (inclusive)
|
|
68
|
+
min_stars: nil,
|
|
69
|
+
request_options: {}
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
sig do
|
|
74
|
+
override.returns(
|
|
75
|
+
{
|
|
76
|
+
product_id: String,
|
|
77
|
+
after: T.nilable(String),
|
|
78
|
+
before: T.nilable(String),
|
|
79
|
+
first: T.nilable(Integer),
|
|
80
|
+
last: T.nilable(Integer),
|
|
81
|
+
max_stars: T.nilable(Integer),
|
|
82
|
+
min_stars: T.nilable(Integer),
|
|
83
|
+
request_options: WhopSDK::RequestOptions
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
def to_hash
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|