whop-sdk 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl
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.
Potentially problematic release.
This version of whop-sdk might be problematic. Click here for more details.
- whop_sdk/_client.py +47 -2
- whop_sdk/_version.py +1 -1
- whop_sdk/resources/__init__.py +70 -0
- whop_sdk/resources/checkout_configurations.py +4 -0
- whop_sdk/resources/course_chapters.py +602 -0
- whop_sdk/resources/course_lessons.py +722 -0
- whop_sdk/resources/courses.py +713 -0
- whop_sdk/resources/experiences.py +107 -0
- whop_sdk/resources/forum_posts.py +123 -1
- whop_sdk/resources/members.py +8 -0
- whop_sdk/resources/memberships.py +16 -8
- whop_sdk/resources/messages.py +113 -1
- whop_sdk/resources/payments.py +3 -26
- whop_sdk/resources/plans.py +74 -2
- whop_sdk/resources/products.py +8 -16
- whop_sdk/resources/promo_codes.py +652 -0
- whop_sdk/resources/reviews.py +315 -0
- whop_sdk/types/__init__.py +39 -0
- whop_sdk/types/assessment_question_types.py +7 -0
- whop_sdk/types/billing_reasons.py +9 -0
- whop_sdk/types/card_brands.py +24 -0
- whop_sdk/types/checkout_configuration_create_params.py +65 -2
- whop_sdk/types/checkout_configuration_list_response.py +4 -1
- whop_sdk/types/course.py +109 -0
- whop_sdk/types/course_chapter.py +32 -0
- whop_sdk/types/course_chapter_create_params.py +16 -0
- whop_sdk/types/course_chapter_delete_response.py +7 -0
- whop_sdk/types/course_chapter_list_params.py +25 -0
- whop_sdk/types/course_chapter_list_response.py +16 -0
- whop_sdk/types/course_chapter_update_params.py +12 -0
- whop_sdk/types/course_create_params.py +41 -0
- whop_sdk/types/course_delete_response.py +7 -0
- whop_sdk/types/course_lesson_create_params.py +27 -0
- whop_sdk/types/course_lesson_delete_response.py +7 -0
- whop_sdk/types/course_lesson_list_params.py +28 -0
- whop_sdk/types/course_lesson_list_response.py +35 -0
- whop_sdk/types/course_lesson_update_params.py +144 -0
- whop_sdk/types/course_list_params.py +28 -0
- whop_sdk/types/course_list_response.py +77 -0
- whop_sdk/types/course_update_params.py +89 -0
- whop_sdk/types/experience_duplicate_params.py +13 -0
- whop_sdk/types/forum_post_list_response.py +7 -0
- whop_sdk/types/forum_post_update_params.py +41 -0
- whop_sdk/types/languages.py +30 -0
- whop_sdk/types/ledger_account_retrieve_response.py +15 -1
- whop_sdk/types/lesson.py +159 -0
- whop_sdk/types/lesson_types.py +7 -0
- whop_sdk/types/lesson_visibilities.py +7 -0
- whop_sdk/types/member_list_params.py +3 -0
- whop_sdk/types/membership_list_params.py +7 -4
- whop_sdk/types/membership_list_response.py +12 -1
- whop_sdk/types/message_update_params.py +35 -0
- whop_sdk/types/payment_list_params.py +2 -7
- whop_sdk/types/payment_list_response.py +23 -13
- whop_sdk/types/payment_method_types.py +92 -0
- whop_sdk/types/plan_create_params.py +19 -1
- whop_sdk/types/plan_list_response.py +9 -0
- whop_sdk/types/plan_update_params.py +18 -0
- whop_sdk/types/product_create_params.py +1 -24
- whop_sdk/types/product_update_params.py +12 -1
- whop_sdk/types/promo_code.py +90 -0
- whop_sdk/types/promo_code_create_params.py +70 -0
- whop_sdk/types/promo_code_delete_response.py +7 -0
- whop_sdk/types/promo_code_list_params.py +37 -0
- whop_sdk/types/promo_code_list_response.py +79 -0
- whop_sdk/types/promo_code_status.py +7 -0
- whop_sdk/types/promo_duration.py +7 -0
- whop_sdk/types/review_list_params.py +31 -0
- whop_sdk/types/review_list_response.py +78 -0
- whop_sdk/types/review_retrieve_response.py +103 -0
- whop_sdk/types/review_status.py +7 -0
- whop_sdk/types/shared/checkout_configuration.py +4 -1
- whop_sdk/types/shared/forum_post.py +7 -0
- whop_sdk/types/shared/invoice.py +4 -1
- whop_sdk/types/shared/invoice_list_item.py +4 -1
- whop_sdk/types/shared/membership.py +12 -1
- whop_sdk/types/shared/payment.py +23 -13
- whop_sdk/types/shared/plan.py +9 -0
- whop_sdk/types/shared/product.py +8 -0
- whop_sdk/types/shared/product_list_item.py +8 -0
- whop_sdk/types/shared_params/__init__.py +1 -0
- whop_sdk/types/shared_params/promo_type.py +9 -0
- {whop_sdk-0.0.2.dist-info → whop_sdk-0.0.3.dist-info}/METADATA +1 -1
- {whop_sdk-0.0.2.dist-info → whop_sdk-0.0.3.dist-info}/RECORD +86 -41
- {whop_sdk-0.0.2.dist-info → whop_sdk-0.0.3.dist-info}/WHEEL +0 -0
- {whop_sdk-0.0.2.dist-info → whop_sdk-0.0.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing_extensions import Literal, TypeAlias
|
|
4
|
+
|
|
5
|
+
__all__ = ["PaymentMethodTypes"]
|
|
6
|
+
|
|
7
|
+
PaymentMethodTypes: TypeAlias = Literal[
|
|
8
|
+
"acss_debit",
|
|
9
|
+
"affirm",
|
|
10
|
+
"afterpay_clearpay",
|
|
11
|
+
"alipay",
|
|
12
|
+
"alma",
|
|
13
|
+
"amazon_pay",
|
|
14
|
+
"apple_pay",
|
|
15
|
+
"au_becs_debit",
|
|
16
|
+
"bacs_debit",
|
|
17
|
+
"bancontact",
|
|
18
|
+
"billie",
|
|
19
|
+
"blik",
|
|
20
|
+
"boleto",
|
|
21
|
+
"card",
|
|
22
|
+
"cashapp",
|
|
23
|
+
"crypto",
|
|
24
|
+
"eps",
|
|
25
|
+
"fpx",
|
|
26
|
+
"giropay",
|
|
27
|
+
"google_pay",
|
|
28
|
+
"grabpay",
|
|
29
|
+
"ideal",
|
|
30
|
+
"kakao_pay",
|
|
31
|
+
"klarna",
|
|
32
|
+
"konbini",
|
|
33
|
+
"kr_card",
|
|
34
|
+
"link",
|
|
35
|
+
"mobilepay",
|
|
36
|
+
"multibanco",
|
|
37
|
+
"naver_pay",
|
|
38
|
+
"nz_bank_account",
|
|
39
|
+
"oxxo",
|
|
40
|
+
"p24",
|
|
41
|
+
"pay_by_bank",
|
|
42
|
+
"payco",
|
|
43
|
+
"paynow",
|
|
44
|
+
"pix",
|
|
45
|
+
"promptpay",
|
|
46
|
+
"revolut_pay",
|
|
47
|
+
"samsung_pay",
|
|
48
|
+
"satispay",
|
|
49
|
+
"sepa_debit",
|
|
50
|
+
"sofort",
|
|
51
|
+
"swish",
|
|
52
|
+
"twint",
|
|
53
|
+
"us_bank_account",
|
|
54
|
+
"wechat_pay",
|
|
55
|
+
"zip",
|
|
56
|
+
"bizum",
|
|
57
|
+
"capchase_pay",
|
|
58
|
+
"kriya",
|
|
59
|
+
"mondu",
|
|
60
|
+
"ng_wallet",
|
|
61
|
+
"paypay",
|
|
62
|
+
"sequra",
|
|
63
|
+
"scalapay",
|
|
64
|
+
"vipps",
|
|
65
|
+
"custom",
|
|
66
|
+
"customer_balance",
|
|
67
|
+
"gopay",
|
|
68
|
+
"mb_way",
|
|
69
|
+
"ng_bank",
|
|
70
|
+
"ng_bank_transfer",
|
|
71
|
+
"ng_card",
|
|
72
|
+
"ng_market",
|
|
73
|
+
"ng_ussd",
|
|
74
|
+
"paypal",
|
|
75
|
+
"payto",
|
|
76
|
+
"qris",
|
|
77
|
+
"rechnung",
|
|
78
|
+
"south_korea_market",
|
|
79
|
+
"kr_market",
|
|
80
|
+
"shopeepay",
|
|
81
|
+
"upi",
|
|
82
|
+
"sunbit",
|
|
83
|
+
"netbanking",
|
|
84
|
+
"id_bank_transfer",
|
|
85
|
+
"demo_pay",
|
|
86
|
+
"shop_pay",
|
|
87
|
+
"apple",
|
|
88
|
+
"sezzle",
|
|
89
|
+
"coinbase",
|
|
90
|
+
"splitit",
|
|
91
|
+
"unknown",
|
|
92
|
+
]
|
|
@@ -22,7 +22,7 @@ class PlanCreateParams(TypedDict, total=False):
|
|
|
22
22
|
"""The product the plan is related to."""
|
|
23
23
|
|
|
24
24
|
billing_period: Optional[int]
|
|
25
|
-
"""The interval at which the plan charges (renewal plans)."""
|
|
25
|
+
"""The interval in days at which the plan charges (renewal plans)."""
|
|
26
26
|
|
|
27
27
|
currency: Optional[Currency]
|
|
28
28
|
"""The available currencies on the platform"""
|
|
@@ -68,12 +68,30 @@ class PlanCreateParams(TypedDict, total=False):
|
|
|
68
68
|
$10.43
|
|
69
69
|
"""
|
|
70
70
|
|
|
71
|
+
stock: Optional[int]
|
|
72
|
+
"""The number of units available for purchase."""
|
|
73
|
+
|
|
74
|
+
strike_through_initial_price: Optional[float]
|
|
75
|
+
"""The price to display with a strikethrough for the initial price.
|
|
76
|
+
|
|
77
|
+
Provided as a number in dollars. Eg: 19.99 for $19.99
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
strike_through_renewal_price: Optional[float]
|
|
81
|
+
"""The price to display with a strikethrough for the renewal price.
|
|
82
|
+
|
|
83
|
+
Provided as a number in dollars. Eg: 19.99 for $19.99
|
|
84
|
+
"""
|
|
85
|
+
|
|
71
86
|
title: Optional[str]
|
|
72
87
|
"""The title of the plan. This will be visible on the product page to customers."""
|
|
73
88
|
|
|
74
89
|
trial_period_days: Optional[int]
|
|
75
90
|
"""The number of free trial days added before a renewal plan."""
|
|
76
91
|
|
|
92
|
+
unlimited_stock: Optional[bool]
|
|
93
|
+
"""Limits/doesn't limit the number of units available for purchase."""
|
|
94
|
+
|
|
77
95
|
visibility: Optional[Visibility]
|
|
78
96
|
"""Visibility of a resource"""
|
|
79
97
|
|
|
@@ -82,9 +82,18 @@ class PlanListResponse(BaseModel):
|
|
|
82
82
|
renewal_price: float
|
|
83
83
|
"""The price a person has to pay for a plan on the renewal purchase."""
|
|
84
84
|
|
|
85
|
+
stock: Optional[int] = None
|
|
86
|
+
"""The number of units available for purchase. Only displayed to authorized actors"""
|
|
87
|
+
|
|
88
|
+
title: Optional[str] = None
|
|
89
|
+
"""The title of the plan. This will be visible on the product page to customers."""
|
|
90
|
+
|
|
85
91
|
trial_period_days: Optional[int] = None
|
|
86
92
|
"""The number of free trial days added before a renewal plan."""
|
|
87
93
|
|
|
94
|
+
unlimited_stock: bool
|
|
95
|
+
"""Limits/doesn't limit the number of units available for purchase."""
|
|
96
|
+
|
|
88
97
|
updated_at: datetime
|
|
89
98
|
"""When the plan was last updated."""
|
|
90
99
|
|
|
@@ -49,12 +49,30 @@ class PlanUpdateParams(TypedDict, total=False):
|
|
|
49
49
|
renewal_price: Optional[float]
|
|
50
50
|
"""The amount the customer is charged every billing period."""
|
|
51
51
|
|
|
52
|
+
stock: Optional[int]
|
|
53
|
+
"""The number of units available for purchase."""
|
|
54
|
+
|
|
55
|
+
strike_through_initial_price: Optional[float]
|
|
56
|
+
"""The price to display with a strikethrough for the initial price.
|
|
57
|
+
|
|
58
|
+
Provided as a number in dollars. Eg: 19.99 for $19.99
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
strike_through_renewal_price: Optional[float]
|
|
62
|
+
"""The price to display with a strikethrough for the renewal price.
|
|
63
|
+
|
|
64
|
+
Provided as a number in dollars. Eg: 19.99 for $19.99
|
|
65
|
+
"""
|
|
66
|
+
|
|
52
67
|
title: Optional[str]
|
|
53
68
|
"""The title of the plan. This will be visible on the product page to customers."""
|
|
54
69
|
|
|
55
70
|
trial_period_days: Optional[int]
|
|
56
71
|
"""The number of free trial days added before a renewal plan."""
|
|
57
72
|
|
|
73
|
+
unlimited_stock: Optional[bool]
|
|
74
|
+
"""Limits/doesn't limit the number of units available for purchase."""
|
|
75
|
+
|
|
58
76
|
visibility: Optional[Visibility]
|
|
59
77
|
"""Visibility of a resource"""
|
|
60
78
|
|
|
@@ -13,10 +13,9 @@ from .shared.visibility import Visibility
|
|
|
13
13
|
from .shared.business_types import BusinessTypes
|
|
14
14
|
from .shared.industry_types import IndustryTypes
|
|
15
15
|
from .shared.release_method import ReleaseMethod
|
|
16
|
-
from .shared.access_pass_type import AccessPassType
|
|
17
16
|
from .shared.global_affiliate_status import GlobalAffiliateStatus
|
|
18
17
|
|
|
19
|
-
__all__ = ["ProductCreateParams", "
|
|
18
|
+
__all__ = ["ProductCreateParams", "PlanOptions", "PlanOptionsCustomField", "ProductHighlight"]
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
class ProductCreateParams(TypedDict, total=False):
|
|
@@ -26,12 +25,6 @@ class ProductCreateParams(TypedDict, total=False):
|
|
|
26
25
|
title: Required[str]
|
|
27
26
|
"""The title of the product."""
|
|
28
27
|
|
|
29
|
-
access_pass_type: Optional[AccessPassType]
|
|
30
|
-
"""The different types an access pass can be."""
|
|
31
|
-
|
|
32
|
-
banner_image: Optional[BannerImage]
|
|
33
|
-
"""A banner image for the product in png, jpeg format"""
|
|
34
|
-
|
|
35
28
|
business_type: Optional[BusinessTypes]
|
|
36
29
|
"""The different business types a company can be."""
|
|
37
30
|
|
|
@@ -94,22 +87,6 @@ class ProductCreateParams(TypedDict, total=False):
|
|
|
94
87
|
"""Visibility of a resource"""
|
|
95
88
|
|
|
96
89
|
|
|
97
|
-
class BannerImage(TypedDict, total=False):
|
|
98
|
-
id: Optional[str]
|
|
99
|
-
"""The ID of an existing attachment object.
|
|
100
|
-
|
|
101
|
-
Use this when updating a resource and keeping a subset of the attachments. Don't
|
|
102
|
-
use this unless you know what you're doing.
|
|
103
|
-
"""
|
|
104
|
-
|
|
105
|
-
direct_upload_id: Optional[str]
|
|
106
|
-
"""This ID should be used the first time you upload an attachment.
|
|
107
|
-
|
|
108
|
-
It is the ID of the direct upload that was created when uploading the file to S3
|
|
109
|
-
via the mediaDirectUpload mutation.
|
|
110
|
-
"""
|
|
111
|
-
|
|
112
|
-
|
|
113
90
|
class PlanOptionsCustomField(TypedDict, total=False):
|
|
114
91
|
field_type: Required[Literal["text"]]
|
|
115
92
|
"""The type of the custom field."""
|
|
@@ -11,7 +11,7 @@ from .shared.business_types import BusinessTypes
|
|
|
11
11
|
from .shared.industry_types import IndustryTypes
|
|
12
12
|
from .shared.global_affiliate_status import GlobalAffiliateStatus
|
|
13
13
|
|
|
14
|
-
__all__ = ["ProductUpdateParams", "BannerImage"]
|
|
14
|
+
__all__ = ["ProductUpdateParams", "BannerImage", "StorePageConfig"]
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class ProductUpdateParams(TypedDict, total=False):
|
|
@@ -67,6 +67,9 @@ class ProductUpdateParams(TypedDict, total=False):
|
|
|
67
67
|
route: Optional[str]
|
|
68
68
|
"""The route of the product."""
|
|
69
69
|
|
|
70
|
+
store_page_config: Optional[StorePageConfig]
|
|
71
|
+
"""Configuration for a product on the company's store page."""
|
|
72
|
+
|
|
70
73
|
title: Optional[str]
|
|
71
74
|
"""The title of the product."""
|
|
72
75
|
|
|
@@ -88,3 +91,11 @@ class BannerImage(TypedDict, total=False):
|
|
|
88
91
|
It is the ID of the direct upload that was created when uploading the file to S3
|
|
89
92
|
via the mediaDirectUpload mutation.
|
|
90
93
|
"""
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class StorePageConfig(TypedDict, total=False):
|
|
97
|
+
custom_cta: Optional[str]
|
|
98
|
+
"""Custom call-to-action text for the product's store page."""
|
|
99
|
+
|
|
100
|
+
show_price: Optional[bool]
|
|
101
|
+
"""Whether or not to show the price on the product's store page."""
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .promo_duration import PromoDuration
|
|
8
|
+
from .shared.currency import Currency
|
|
9
|
+
from .promo_code_status import PromoCodeStatus
|
|
10
|
+
from .shared.promo_type import PromoType
|
|
11
|
+
|
|
12
|
+
__all__ = ["PromoCode", "Company", "Product"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Company(BaseModel):
|
|
16
|
+
id: str
|
|
17
|
+
"""The ID of the company"""
|
|
18
|
+
|
|
19
|
+
title: str
|
|
20
|
+
"""The written name of the company."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Product(BaseModel):
|
|
24
|
+
id: str
|
|
25
|
+
"""The internal ID of the public product."""
|
|
26
|
+
|
|
27
|
+
title: str
|
|
28
|
+
"""The title of the product. Use for Whop 4.0."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class PromoCode(BaseModel):
|
|
32
|
+
id: str
|
|
33
|
+
"""The ID of the promo."""
|
|
34
|
+
|
|
35
|
+
amount_off: float
|
|
36
|
+
"""The amount off (% or flat amount) for the promo."""
|
|
37
|
+
|
|
38
|
+
churned_users_only: bool
|
|
39
|
+
"""Restricts promo use to only users who have churned from the company before."""
|
|
40
|
+
|
|
41
|
+
code: Optional[str] = None
|
|
42
|
+
"""The specific code used to apply the promo at checkout."""
|
|
43
|
+
|
|
44
|
+
company: Company
|
|
45
|
+
"""The company for the promo code."""
|
|
46
|
+
|
|
47
|
+
created_at: datetime
|
|
48
|
+
"""The timestamp of when the promo was created."""
|
|
49
|
+
|
|
50
|
+
currency: Currency
|
|
51
|
+
"""The monetary currency of the promo code."""
|
|
52
|
+
|
|
53
|
+
duration: Optional[PromoDuration] = None
|
|
54
|
+
"""The duration setting for the promo code"""
|
|
55
|
+
|
|
56
|
+
existing_memberships_only: bool
|
|
57
|
+
"""Restricts promo use to only be applied to already purchased memberships."""
|
|
58
|
+
|
|
59
|
+
expires_at: Optional[datetime] = None
|
|
60
|
+
"""The date/time of when the promo expires."""
|
|
61
|
+
|
|
62
|
+
new_users_only: bool
|
|
63
|
+
"""
|
|
64
|
+
Restricts promo use to only users who have never purchased from the company
|
|
65
|
+
before.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
one_per_customer: bool
|
|
69
|
+
"""Restricts promo use to only be applied once per customer."""
|
|
70
|
+
|
|
71
|
+
product: Optional[Product] = None
|
|
72
|
+
"""The access pass associated with the promo code."""
|
|
73
|
+
|
|
74
|
+
promo_duration_months: Optional[int] = None
|
|
75
|
+
"""The number of months the promo is applied for."""
|
|
76
|
+
|
|
77
|
+
promo_type: PromoType
|
|
78
|
+
"""The type (% or flat amount) of the promo."""
|
|
79
|
+
|
|
80
|
+
status: PromoCodeStatus
|
|
81
|
+
"""Indicates if the promo code is live or disabled."""
|
|
82
|
+
|
|
83
|
+
stock: int
|
|
84
|
+
"""The quantity limit on the number of uses."""
|
|
85
|
+
|
|
86
|
+
unlimited_stock: bool
|
|
87
|
+
"""Whether or not the promo code has unlimited stock."""
|
|
88
|
+
|
|
89
|
+
uses: int
|
|
90
|
+
"""The amount of times the promo codes has been used."""
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Union, Optional
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
8
|
+
|
|
9
|
+
from .._types import SequenceNotStr
|
|
10
|
+
from .._utils import PropertyInfo
|
|
11
|
+
from .shared.currency import Currency
|
|
12
|
+
from .shared.promo_type import PromoType
|
|
13
|
+
|
|
14
|
+
__all__ = ["PromoCodeCreateParams"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class PromoCodeCreateParams(TypedDict, total=False):
|
|
18
|
+
amount_off: Required[float]
|
|
19
|
+
"""The amount off (% or flat amount) for the promo."""
|
|
20
|
+
|
|
21
|
+
base_currency: Required[Currency]
|
|
22
|
+
"""The monetary currency of the promo code."""
|
|
23
|
+
|
|
24
|
+
code: Required[str]
|
|
25
|
+
"""The specific code used to apply the promo at checkout."""
|
|
26
|
+
|
|
27
|
+
company_id: Required[str]
|
|
28
|
+
"""The id of the company to create the promo code for."""
|
|
29
|
+
|
|
30
|
+
new_users_only: Required[bool]
|
|
31
|
+
"""
|
|
32
|
+
Restricts promo use to only users who have never purchased from the company
|
|
33
|
+
before.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
promo_duration_months: Required[int]
|
|
37
|
+
"""The number of months this promo code is applied and valid for."""
|
|
38
|
+
|
|
39
|
+
promo_type: Required[PromoType]
|
|
40
|
+
"""The type (% or flat amount) of the promo."""
|
|
41
|
+
|
|
42
|
+
churned_users_only: Optional[bool]
|
|
43
|
+
"""Restricts promo use to only users who have churned from the company before."""
|
|
44
|
+
|
|
45
|
+
existing_memberships_only: Optional[bool]
|
|
46
|
+
"""Whether this promo code is for existing memberships only (cancelations)"""
|
|
47
|
+
|
|
48
|
+
expires_at: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
|
|
49
|
+
"""The date/time of when the promo expires."""
|
|
50
|
+
|
|
51
|
+
one_per_customer: Optional[bool]
|
|
52
|
+
"""Restricts promo use to only be applied once per customer."""
|
|
53
|
+
|
|
54
|
+
plan_ids: Optional[SequenceNotStr[str]]
|
|
55
|
+
"""The IDs of the plans that the promo code applies to.
|
|
56
|
+
|
|
57
|
+
If product_id is provided, it will only apply to plans attached to that product
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
product_id: Optional[str]
|
|
61
|
+
"""The product to lock the promo code to, if any.
|
|
62
|
+
|
|
63
|
+
If provided will filter out any plan ids not attached to this product
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
stock: Optional[int]
|
|
67
|
+
"""The quantity limit on the number of uses."""
|
|
68
|
+
|
|
69
|
+
unlimited_stock: Optional[bool]
|
|
70
|
+
"""Whether or not the promo code should have unlimited stock."""
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .promo_code_status import PromoCodeStatus
|
|
10
|
+
|
|
11
|
+
__all__ = ["PromoCodeListParams"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PromoCodeListParams(TypedDict, total=False):
|
|
15
|
+
company_id: Required[str]
|
|
16
|
+
"""The ID of the company to list promo codes for"""
|
|
17
|
+
|
|
18
|
+
after: Optional[str]
|
|
19
|
+
"""Returns the elements in the list that come after the specified cursor."""
|
|
20
|
+
|
|
21
|
+
before: Optional[str]
|
|
22
|
+
"""Returns the elements in the list that come before the specified cursor."""
|
|
23
|
+
|
|
24
|
+
first: Optional[int]
|
|
25
|
+
"""Returns the first _n_ elements from the list."""
|
|
26
|
+
|
|
27
|
+
last: Optional[int]
|
|
28
|
+
"""Returns the last _n_ elements from the list."""
|
|
29
|
+
|
|
30
|
+
plan_ids: Optional[SequenceNotStr[str]]
|
|
31
|
+
"""Filter promo codes by plan ID(s)"""
|
|
32
|
+
|
|
33
|
+
product_ids: Optional[SequenceNotStr[str]]
|
|
34
|
+
"""Filter promo codes by product ID(s)"""
|
|
35
|
+
|
|
36
|
+
status: Optional[PromoCodeStatus]
|
|
37
|
+
"""Statuses for promo codes"""
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .promo_duration import PromoDuration
|
|
8
|
+
from .shared.currency import Currency
|
|
9
|
+
from .promo_code_status import PromoCodeStatus
|
|
10
|
+
from .shared.promo_type import PromoType
|
|
11
|
+
|
|
12
|
+
__all__ = ["PromoCodeListResponse", "Product"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Product(BaseModel):
|
|
16
|
+
id: str
|
|
17
|
+
"""The internal ID of the public product."""
|
|
18
|
+
|
|
19
|
+
title: str
|
|
20
|
+
"""The title of the product. Use for Whop 4.0."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PromoCodeListResponse(BaseModel):
|
|
24
|
+
id: str
|
|
25
|
+
"""The ID of the promo."""
|
|
26
|
+
|
|
27
|
+
amount_off: float
|
|
28
|
+
"""The amount off (% or flat amount) for the promo."""
|
|
29
|
+
|
|
30
|
+
churned_users_only: bool
|
|
31
|
+
"""Restricts promo use to only users who have churned from the company before."""
|
|
32
|
+
|
|
33
|
+
code: Optional[str] = None
|
|
34
|
+
"""The specific code used to apply the promo at checkout."""
|
|
35
|
+
|
|
36
|
+
created_at: datetime
|
|
37
|
+
"""The timestamp of when the promo was created."""
|
|
38
|
+
|
|
39
|
+
currency: Currency
|
|
40
|
+
"""The monetary currency of the promo code."""
|
|
41
|
+
|
|
42
|
+
duration: Optional[PromoDuration] = None
|
|
43
|
+
"""The duration setting for the promo code"""
|
|
44
|
+
|
|
45
|
+
existing_memberships_only: bool
|
|
46
|
+
"""Restricts promo use to only be applied to already purchased memberships."""
|
|
47
|
+
|
|
48
|
+
expires_at: Optional[datetime] = None
|
|
49
|
+
"""The date/time of when the promo expires."""
|
|
50
|
+
|
|
51
|
+
new_users_only: bool
|
|
52
|
+
"""
|
|
53
|
+
Restricts promo use to only users who have never purchased from the company
|
|
54
|
+
before.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
one_per_customer: bool
|
|
58
|
+
"""Restricts promo use to only be applied once per customer."""
|
|
59
|
+
|
|
60
|
+
product: Optional[Product] = None
|
|
61
|
+
"""The access pass associated with the promo code."""
|
|
62
|
+
|
|
63
|
+
promo_duration_months: Optional[int] = None
|
|
64
|
+
"""The number of months the promo is applied for."""
|
|
65
|
+
|
|
66
|
+
promo_type: PromoType
|
|
67
|
+
"""The type (% or flat amount) of the promo."""
|
|
68
|
+
|
|
69
|
+
status: PromoCodeStatus
|
|
70
|
+
"""Indicates if the promo code is live or disabled."""
|
|
71
|
+
|
|
72
|
+
stock: int
|
|
73
|
+
"""The quantity limit on the number of uses."""
|
|
74
|
+
|
|
75
|
+
unlimited_stock: bool
|
|
76
|
+
"""Whether or not the promo code has unlimited stock."""
|
|
77
|
+
|
|
78
|
+
uses: int
|
|
79
|
+
"""The amount of times the promo codes has been used."""
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import Required, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["ReviewListParams"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ReviewListParams(TypedDict, total=False):
|
|
12
|
+
product_id: Required[str]
|
|
13
|
+
"""The ID of the product"""
|
|
14
|
+
|
|
15
|
+
after: Optional[str]
|
|
16
|
+
"""Returns the elements in the list that come after the specified cursor."""
|
|
17
|
+
|
|
18
|
+
before: Optional[str]
|
|
19
|
+
"""Returns the elements in the list that come before the specified cursor."""
|
|
20
|
+
|
|
21
|
+
first: Optional[int]
|
|
22
|
+
"""Returns the first _n_ elements from the list."""
|
|
23
|
+
|
|
24
|
+
last: Optional[int]
|
|
25
|
+
"""Returns the last _n_ elements from the list."""
|
|
26
|
+
|
|
27
|
+
max_stars: Optional[int]
|
|
28
|
+
"""The maximum star rating of the review (inclusive)"""
|
|
29
|
+
|
|
30
|
+
min_stars: Optional[int]
|
|
31
|
+
"""The minimum star rating of the review (inclusive)"""
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .review_status import ReviewStatus
|
|
8
|
+
|
|
9
|
+
__all__ = ["ReviewListResponse", "Attachment", "User"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Attachment(BaseModel):
|
|
13
|
+
id: str
|
|
14
|
+
"""The ID of the attachment"""
|
|
15
|
+
|
|
16
|
+
content_type: Optional[str] = None
|
|
17
|
+
"""The attachment's content type (e.g., image/jpg, video/mp4)"""
|
|
18
|
+
|
|
19
|
+
filename: Optional[str] = None
|
|
20
|
+
"""The name of the file"""
|
|
21
|
+
|
|
22
|
+
url: Optional[str] = None
|
|
23
|
+
"""This is the URL you use to render optimized attachments on the client.
|
|
24
|
+
|
|
25
|
+
This should be used for apps.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class User(BaseModel):
|
|
30
|
+
id: str
|
|
31
|
+
"""The internal ID of the user."""
|
|
32
|
+
|
|
33
|
+
name: Optional[str] = None
|
|
34
|
+
"""The name of the user from their Whop account."""
|
|
35
|
+
|
|
36
|
+
username: str
|
|
37
|
+
"""The username of the user from their Whop account."""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class ReviewListResponse(BaseModel):
|
|
41
|
+
id: str
|
|
42
|
+
"""The internal ID of the review."""
|
|
43
|
+
|
|
44
|
+
attachments: List[Attachment]
|
|
45
|
+
"""The attachments attached to the review."""
|
|
46
|
+
|
|
47
|
+
created_at: datetime
|
|
48
|
+
"""The timestamp of when the review was created."""
|
|
49
|
+
|
|
50
|
+
description: Optional[str] = None
|
|
51
|
+
"""The description of the review."""
|
|
52
|
+
|
|
53
|
+
joined_at: Optional[datetime] = None
|
|
54
|
+
"""The timestamp of when the user joined the product."""
|
|
55
|
+
|
|
56
|
+
paid_for_product: Optional[bool] = None
|
|
57
|
+
"""Whether or not the user paid for the product.
|
|
58
|
+
|
|
59
|
+
If null, the payment status is unknown.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
published_at: Optional[datetime] = None
|
|
63
|
+
"""The timestamp of when the review was published."""
|
|
64
|
+
|
|
65
|
+
stars: int
|
|
66
|
+
"""The number of stars the user gave the product."""
|
|
67
|
+
|
|
68
|
+
status: ReviewStatus
|
|
69
|
+
"""The status of the review."""
|
|
70
|
+
|
|
71
|
+
title: Optional[str] = None
|
|
72
|
+
"""The title of the review."""
|
|
73
|
+
|
|
74
|
+
updated_at: datetime
|
|
75
|
+
"""The timestamp of when the review was last updated."""
|
|
76
|
+
|
|
77
|
+
user: User
|
|
78
|
+
"""The user account that performed the action."""
|