whop-sdk 0.0.1__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.

Files changed (126) hide show
  1. whop_sdk/_client.py +65 -2
  2. whop_sdk/_version.py +1 -1
  3. whop_sdk/resources/__init__.py +98 -0
  4. whop_sdk/resources/checkout_configurations.py +16 -12
  5. whop_sdk/resources/course_chapters.py +602 -0
  6. whop_sdk/resources/course_lessons.py +722 -0
  7. whop_sdk/resources/courses.py +713 -0
  8. whop_sdk/resources/experiences.py +107 -0
  9. whop_sdk/resources/forum_posts.py +123 -1
  10. whop_sdk/resources/forums.py +446 -0
  11. whop_sdk/resources/members.py +429 -0
  12. whop_sdk/resources/memberships.py +16 -8
  13. whop_sdk/resources/messages.py +113 -1
  14. whop_sdk/resources/payments.py +3 -26
  15. whop_sdk/resources/plans.py +84 -6
  16. whop_sdk/resources/products.py +8 -16
  17. whop_sdk/resources/promo_codes.py +652 -0
  18. whop_sdk/resources/reviews.py +315 -0
  19. whop_sdk/types/__init__.py +64 -0
  20. whop_sdk/types/app_list_response.py +16 -1
  21. whop_sdk/types/assessment_question_types.py +7 -0
  22. whop_sdk/types/billing_reasons.py +9 -0
  23. whop_sdk/types/card_brands.py +24 -0
  24. whop_sdk/types/checkout_configuration_create_params.py +70 -7
  25. whop_sdk/types/checkout_configuration_list_response.py +12 -9
  26. whop_sdk/types/course.py +109 -0
  27. whop_sdk/types/course_chapter.py +32 -0
  28. whop_sdk/types/course_chapter_create_params.py +16 -0
  29. whop_sdk/types/course_chapter_delete_response.py +7 -0
  30. whop_sdk/types/course_chapter_list_params.py +25 -0
  31. whop_sdk/types/course_chapter_list_response.py +16 -0
  32. whop_sdk/types/course_chapter_update_params.py +12 -0
  33. whop_sdk/types/course_create_params.py +41 -0
  34. whop_sdk/types/course_delete_response.py +7 -0
  35. whop_sdk/types/course_lesson_create_params.py +27 -0
  36. whop_sdk/types/course_lesson_delete_response.py +7 -0
  37. whop_sdk/types/course_lesson_interaction_completed_webhook_event.py +26 -0
  38. whop_sdk/types/course_lesson_list_params.py +28 -0
  39. whop_sdk/types/course_lesson_list_response.py +35 -0
  40. whop_sdk/types/course_lesson_update_params.py +144 -0
  41. whop_sdk/types/course_list_params.py +28 -0
  42. whop_sdk/types/course_list_response.py +77 -0
  43. whop_sdk/types/course_update_params.py +89 -0
  44. whop_sdk/types/entry_approved_webhook_event.py +26 -0
  45. whop_sdk/types/entry_created_webhook_event.py +26 -0
  46. whop_sdk/types/entry_deleted_webhook_event.py +26 -0
  47. whop_sdk/types/entry_denied_webhook_event.py +26 -0
  48. whop_sdk/types/experience_duplicate_params.py +13 -0
  49. whop_sdk/types/experience_list_response.py +27 -1
  50. whop_sdk/types/forum_list_params.py +28 -0
  51. whop_sdk/types/forum_list_response.py +33 -0
  52. whop_sdk/types/forum_post_list_response.py +7 -0
  53. whop_sdk/types/forum_post_update_params.py +41 -0
  54. whop_sdk/types/forum_update_params.py +23 -0
  55. whop_sdk/types/invoice_create_params.py +10 -2
  56. whop_sdk/types/languages.py +30 -0
  57. whop_sdk/types/ledger_account_retrieve_response.py +15 -1
  58. whop_sdk/types/lesson.py +159 -0
  59. whop_sdk/types/lesson_types.py +7 -0
  60. whop_sdk/types/lesson_visibilities.py +7 -0
  61. whop_sdk/types/member_list_params.py +73 -0
  62. whop_sdk/types/member_list_response.py +65 -0
  63. whop_sdk/types/member_retrieve_response.py +79 -0
  64. whop_sdk/types/membership_activated_webhook_event.py +29 -0
  65. whop_sdk/types/membership_deactivated_webhook_event.py +29 -0
  66. whop_sdk/types/membership_list_params.py +7 -4
  67. whop_sdk/types/membership_list_response.py +12 -1
  68. whop_sdk/types/message_update_params.py +35 -0
  69. whop_sdk/types/payment_failed_webhook_event.py +26 -0
  70. whop_sdk/types/payment_list_params.py +2 -7
  71. whop_sdk/types/payment_list_response.py +23 -13
  72. whop_sdk/types/payment_method_types.py +92 -0
  73. whop_sdk/types/payment_pending_webhook_event.py +26 -0
  74. whop_sdk/types/payment_succeeded_webhook_event.py +26 -0
  75. whop_sdk/types/plan_create_params.py +29 -3
  76. whop_sdk/types/plan_list_response.py +9 -0
  77. whop_sdk/types/plan_update_params.py +18 -0
  78. whop_sdk/types/product_create_params.py +1 -24
  79. whop_sdk/types/product_update_params.py +12 -1
  80. whop_sdk/types/promo_code.py +90 -0
  81. whop_sdk/types/promo_code_create_params.py +70 -0
  82. whop_sdk/types/promo_code_delete_response.py +7 -0
  83. whop_sdk/types/promo_code_list_params.py +37 -0
  84. whop_sdk/types/promo_code_list_response.py +79 -0
  85. whop_sdk/types/promo_code_status.py +7 -0
  86. whop_sdk/types/promo_duration.py +7 -0
  87. whop_sdk/types/review_list_params.py +31 -0
  88. whop_sdk/types/review_list_response.py +78 -0
  89. whop_sdk/types/review_retrieve_response.py +103 -0
  90. whop_sdk/types/review_status.py +7 -0
  91. whop_sdk/types/shared/__init__.py +7 -0
  92. whop_sdk/types/shared/access_level.py +7 -0
  93. whop_sdk/types/shared/app.py +25 -1
  94. whop_sdk/types/shared/checkout_configuration.py +12 -9
  95. whop_sdk/types/shared/company.py +15 -1
  96. whop_sdk/types/shared/course_lesson_interaction.py +20 -1
  97. whop_sdk/types/shared/email_notification_preferences.py +7 -0
  98. whop_sdk/types/shared/experience.py +27 -1
  99. whop_sdk/types/shared/forum.py +33 -0
  100. whop_sdk/types/shared/forum_post.py +7 -0
  101. whop_sdk/types/shared/invoice.py +4 -1
  102. whop_sdk/types/shared/invoice_list_item.py +4 -1
  103. whop_sdk/types/shared/member_most_recent_actions.py +22 -0
  104. whop_sdk/types/shared/member_statuses.py +7 -0
  105. whop_sdk/types/shared/membership.py +12 -1
  106. whop_sdk/types/shared/payment.py +23 -13
  107. whop_sdk/types/shared/plan.py +9 -0
  108. whop_sdk/types/shared/product.py +8 -0
  109. whop_sdk/types/shared/product_list_item.py +8 -0
  110. whop_sdk/types/shared/who_can_comment_types.py +7 -0
  111. whop_sdk/types/shared/who_can_post_types.py +7 -0
  112. whop_sdk/types/shared_params/__init__.py +7 -0
  113. whop_sdk/types/shared_params/access_level.py +9 -0
  114. whop_sdk/types/shared_params/email_notification_preferences.py +9 -0
  115. whop_sdk/types/shared_params/member_most_recent_actions.py +24 -0
  116. whop_sdk/types/shared_params/member_statuses.py +9 -0
  117. whop_sdk/types/shared_params/promo_type.py +9 -0
  118. whop_sdk/types/shared_params/who_can_comment_types.py +9 -0
  119. whop_sdk/types/shared_params/who_can_post_types.py +9 -0
  120. whop_sdk/types/unwrap_webhook_event.py +24 -1
  121. whop_sdk/types/user_check_access_response.py +2 -3
  122. whop_sdk/types/user_retrieve_response.py +12 -1
  123. {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.3.dist-info}/METADATA +2 -2
  124. {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.3.dist-info}/RECORD +126 -50
  125. {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.3.dist-info}/WHEEL +0 -0
  126. {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.3.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,159 @@
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 .lesson_types import LessonTypes
8
+ from .lesson_visibilities import LessonVisibilities
9
+ from .assessment_question_types import AssessmentQuestionTypes
10
+
11
+ __all__ = [
12
+ "Lesson",
13
+ "AssessmentQuestion",
14
+ "AssessmentQuestionImage",
15
+ "AssessmentQuestionOption",
16
+ "Attachment",
17
+ "MainPdf",
18
+ "VideoAsset",
19
+ ]
20
+
21
+
22
+ class AssessmentQuestionImage(BaseModel):
23
+ id: str
24
+ """The ID of the attachment"""
25
+
26
+ content_type: Optional[str] = None
27
+ """The attachment's content type (e.g., image/jpg, video/mp4)"""
28
+
29
+ filename: Optional[str] = None
30
+ """The name of the file"""
31
+
32
+ url: Optional[str] = None
33
+ """This is the URL you use to render optimized attachments on the client.
34
+
35
+ This should be used for apps.
36
+ """
37
+
38
+
39
+ class AssessmentQuestionOption(BaseModel):
40
+ id: str
41
+ """The ID of the assessment question option"""
42
+
43
+ is_correct: bool
44
+ """Whether this option is a correct answer"""
45
+
46
+ option_text: str
47
+ """The text of the answer option"""
48
+
49
+ order: int
50
+ """The order of this option within the question"""
51
+
52
+
53
+ class AssessmentQuestion(BaseModel):
54
+ id: str
55
+ """The ID of the assessment question"""
56
+
57
+ correct_answer: str
58
+ """The correct answer for the question. Used for short answer questions"""
59
+
60
+ created_at: datetime
61
+ """When the question was created"""
62
+
63
+ image: Optional[AssessmentQuestionImage] = None
64
+ """Optional image attachment for the question"""
65
+
66
+ options: List[AssessmentQuestionOption]
67
+ """The answer options for multiple choice/select questions"""
68
+
69
+ order: int
70
+ """The order of the question within its lesson"""
71
+
72
+ question_text: str
73
+ """The text of the question"""
74
+
75
+ question_type: AssessmentQuestionTypes
76
+ """The type of the question"""
77
+
78
+
79
+ class Attachment(BaseModel):
80
+ id: str
81
+ """The ID of the attachment"""
82
+
83
+ content_type: Optional[str] = None
84
+ """The attachment's content type (e.g., image/jpg, video/mp4)"""
85
+
86
+ filename: Optional[str] = None
87
+ """The name of the file"""
88
+
89
+ url: Optional[str] = None
90
+ """This is the URL you use to render optimized attachments on the client.
91
+
92
+ This should be used for apps.
93
+ """
94
+
95
+
96
+ class MainPdf(BaseModel):
97
+ id: str
98
+ """The ID of the attachment"""
99
+
100
+ content_type: Optional[str] = None
101
+ """The attachment's content type (e.g., image/jpg, video/mp4)"""
102
+
103
+ filename: Optional[str] = None
104
+ """The name of the file"""
105
+
106
+ url: Optional[str] = None
107
+ """This is the URL you use to render optimized attachments on the client.
108
+
109
+ This should be used for apps.
110
+ """
111
+
112
+
113
+ class VideoAsset(BaseModel):
114
+ id: str
115
+ """The ID of the Mux asset"""
116
+
117
+ asset_id: Optional[str] = None
118
+ """The Mux-provided ID of the asset"""
119
+
120
+ playback_id: Optional[str] = None
121
+ """The public playback ID of the Mux asset"""
122
+
123
+
124
+ class Lesson(BaseModel):
125
+ id: str
126
+ """The ID of the lesson"""
127
+
128
+ assessment_questions: List[AssessmentQuestion]
129
+ """Assessment questions for quiz/knowledge check lessons"""
130
+
131
+ attachments: List[Attachment]
132
+ """The attached files in this lesson as a flat array"""
133
+
134
+ content: Optional[str] = None
135
+ """The content of the lesson"""
136
+
137
+ days_from_course_start_until_unlock: Optional[int] = None
138
+ """Number of days from course start until the lesson is unlocked"""
139
+
140
+ lesson_type: LessonTypes
141
+ """The type of the lesson (text, video, pdf, multi, quiz, knowledge_check)"""
142
+
143
+ main_pdf: Optional[MainPdf] = None
144
+ """The main PDF file for this lesson"""
145
+
146
+ order: int
147
+ """The order of the lesson within its chapter"""
148
+
149
+ title: str
150
+ """The title of the lesson"""
151
+
152
+ video_asset: Optional[VideoAsset] = None
153
+ """The associated Mux asset for video lessons"""
154
+
155
+ visibility: LessonVisibilities
156
+ """The visibility of the lesson.
157
+
158
+ Determines how / whether this lesson is visible to users.
159
+ """
@@ -0,0 +1,7 @@
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__ = ["LessonTypes"]
6
+
7
+ LessonTypes: TypeAlias = Literal["text", "video", "pdf", "multi", "quiz", "knowledge_check"]
@@ -0,0 +1,7 @@
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__ = ["LessonVisibilities"]
6
+
7
+ LessonVisibilities: TypeAlias = Literal["visible", "hidden"]
@@ -0,0 +1,73 @@
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 List, Union, Optional
6
+ from datetime import datetime
7
+ from typing_extensions import Literal, Required, Annotated, TypedDict
8
+
9
+ from .._types import SequenceNotStr
10
+ from .._utils import PropertyInfo
11
+ from .shared.direction import Direction
12
+ from .shared.access_level import AccessLevel
13
+ from .shared.member_statuses import MemberStatuses
14
+ from .shared.member_most_recent_actions import MemberMostRecentActions
15
+
16
+ __all__ = ["MemberListParams"]
17
+
18
+
19
+ class MemberListParams(TypedDict, total=False):
20
+ company_id: Required[str]
21
+ """The ID of the company to list members for"""
22
+
23
+ access_level: Optional[AccessLevel]
24
+ """The access level a given user (or company) has to an access pass or company."""
25
+
26
+ access_pass_ids: Optional[SequenceNotStr[str]]
27
+ """The access pass IDs to filter the members by"""
28
+
29
+ after: Optional[str]
30
+ """Returns the elements in the list that come after the specified cursor."""
31
+
32
+ before: Optional[str]
33
+ """Returns the elements in the list that come before the specified cursor."""
34
+
35
+ created_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
36
+ """The minimum creation date to filter by"""
37
+
38
+ created_before: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
39
+ """The maximum creation date to filter by"""
40
+
41
+ direction: Optional[Direction]
42
+ """The direction of the sort."""
43
+
44
+ first: Optional[int]
45
+ """Returns the first _n_ elements from the list."""
46
+
47
+ last: Optional[int]
48
+ """Returns the last _n_ elements from the list."""
49
+
50
+ most_recent_actions: Optional[List[MemberMostRecentActions]]
51
+ """The most recent actions to filter the members by"""
52
+
53
+ order: Optional[Literal["id", "usd_total_spent", "created_at", "joined_at", "most_recent_action"]]
54
+ """Which columns can be used to sort."""
55
+
56
+ plan_ids: Optional[SequenceNotStr[str]]
57
+ """The plan IDs to filter the members by"""
58
+
59
+ promo_code_ids: Optional[SequenceNotStr[str]]
60
+ """The promo code IDs to filter the members by"""
61
+
62
+ query: Optional[str]
63
+ """The name, username, or email to filter the members by.
64
+
65
+ The email filter will only apply if the current actor has the
66
+ `member:email:read` permission.
67
+ """
68
+
69
+ statuses: Optional[List[MemberStatuses]]
70
+ """The statuses to filter the members by"""
71
+
72
+ user_ids: Optional[SequenceNotStr[str]]
73
+ """The user IDs to filter the members by"""
@@ -0,0 +1,65 @@
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 .shared.access_level import AccessLevel
8
+ from .shared.member_statuses import MemberStatuses
9
+ from .shared.member_most_recent_actions import MemberMostRecentActions
10
+
11
+ __all__ = ["MemberListResponse", "User"]
12
+
13
+
14
+ class User(BaseModel):
15
+ id: str
16
+ """The internal ID of the user account."""
17
+
18
+ email: Optional[str] = None
19
+ """The digital mailing address of the user."""
20
+
21
+ name: Optional[str] = None
22
+ """The user's full name."""
23
+
24
+ username: str
25
+ """The whop username."""
26
+
27
+
28
+ class MemberListResponse(BaseModel):
29
+ id: str
30
+ """The ID of the member"""
31
+
32
+ access_level: AccessLevel
33
+ """The access level of the product member.
34
+
35
+ If its admin, the member is an authorized user of the access pass. If its
36
+ customer, the member has a valid membership to the access pass. If its
37
+ no_access, the member does not have access to the access pass.
38
+ """
39
+
40
+ created_at: datetime
41
+ """When the member was created"""
42
+
43
+ joined_at: datetime
44
+ """When the member joined the company"""
45
+
46
+ most_recent_action: Optional[MemberMostRecentActions] = None
47
+ """The different most recent actions a member can have."""
48
+
49
+ most_recent_action_at: Optional[datetime] = None
50
+ """The time for the most recent action, if applicable."""
51
+
52
+ phone: Optional[str] = None
53
+ """The phone number for the member, if available."""
54
+
55
+ status: MemberStatuses
56
+ """The status of the member"""
57
+
58
+ updated_at: datetime
59
+ """The timestamp of when this member was last updated"""
60
+
61
+ usd_total_spent: float
62
+ """How much money this customer has spent on the company's products and plans"""
63
+
64
+ user: Optional[User] = None
65
+ """The user for this member, if any."""
@@ -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 .shared.access_level import AccessLevel
8
+ from .shared.member_statuses import MemberStatuses
9
+ from .shared.member_most_recent_actions import MemberMostRecentActions
10
+
11
+ __all__ = ["MemberRetrieveResponse", "Company", "User"]
12
+
13
+
14
+ class Company(BaseModel):
15
+ id: str
16
+ """The ID of the company"""
17
+
18
+ route: str
19
+ """The slug/route of the company on the Whop site."""
20
+
21
+ title: str
22
+ """The written name of the company."""
23
+
24
+
25
+ class User(BaseModel):
26
+ id: str
27
+ """The internal ID of the user account."""
28
+
29
+ email: Optional[str] = None
30
+ """The digital mailing address of the user."""
31
+
32
+ name: Optional[str] = None
33
+ """The user's full name."""
34
+
35
+ username: str
36
+ """The whop username."""
37
+
38
+
39
+ class MemberRetrieveResponse(BaseModel):
40
+ id: str
41
+ """The ID of the member"""
42
+
43
+ access_level: AccessLevel
44
+ """The access level of the product member.
45
+
46
+ If its admin, the member is an authorized user of the access pass. If its
47
+ customer, the member has a valid membership to the access pass. If its
48
+ no_access, the member does not have access to the access pass.
49
+ """
50
+
51
+ company: Company
52
+ """The company for the member."""
53
+
54
+ created_at: datetime
55
+ """When the member was created"""
56
+
57
+ joined_at: datetime
58
+ """When the member joined the company"""
59
+
60
+ most_recent_action: Optional[MemberMostRecentActions] = None
61
+ """The different most recent actions a member can have."""
62
+
63
+ most_recent_action_at: Optional[datetime] = None
64
+ """The time for the most recent action, if applicable."""
65
+
66
+ phone: Optional[str] = None
67
+ """The phone number for the member, if available."""
68
+
69
+ status: MemberStatuses
70
+ """The status of the member"""
71
+
72
+ updated_at: datetime
73
+ """The timestamp of when this member was last updated"""
74
+
75
+ usd_total_spent: float
76
+ """How much money this customer has spent on the company's products and plans"""
77
+
78
+ user: Optional[User] = None
79
+ """The user for this member, if any."""
@@ -0,0 +1,29 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .shared.membership import Membership
8
+
9
+ __all__ = ["MembershipActivatedWebhookEvent"]
10
+
11
+
12
+ class MembershipActivatedWebhookEvent(BaseModel):
13
+ id: str
14
+ """A unique ID for every single webhook request"""
15
+
16
+ api_version: Literal["v1"]
17
+ """The API version for this webhook"""
18
+
19
+ data: Membership
20
+ """
21
+ A membership represents a purchase between a User and a Company for a specific
22
+ Product.
23
+ """
24
+
25
+ timestamp: datetime
26
+ """The timestamp in ISO 8601 format that the webhook was sent at on the server"""
27
+
28
+ type: Literal["membership.activated"]
29
+ """The webhook event type"""
@@ -0,0 +1,29 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .shared.membership import Membership
8
+
9
+ __all__ = ["MembershipDeactivatedWebhookEvent"]
10
+
11
+
12
+ class MembershipDeactivatedWebhookEvent(BaseModel):
13
+ id: str
14
+ """A unique ID for every single webhook request"""
15
+
16
+ api_version: Literal["v1"]
17
+ """The API version for this webhook"""
18
+
19
+ data: Membership
20
+ """
21
+ A membership represents a purchase between a User and a Company for a specific
22
+ Product.
23
+ """
24
+
25
+ timestamp: datetime
26
+ """The timestamp in ISO 8601 format that the webhook was sent at on the server"""
27
+
28
+ type: Literal["membership.deactivated"]
29
+ """The webhook event type"""
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  from typing import List, Union, Optional
6
6
  from datetime import datetime
7
- from typing_extensions import Literal, Required, Annotated, TypedDict
7
+ from typing_extensions import Literal, Annotated, TypedDict
8
8
 
9
9
  from .._types import SequenceNotStr
10
10
  from .._utils import PropertyInfo
@@ -15,9 +15,6 @@ __all__ = ["MembershipListParams"]
15
15
 
16
16
 
17
17
  class MembershipListParams(TypedDict, total=False):
18
- company_id: Required[str]
19
- """The ID of the company to list memberships for"""
20
-
21
18
  access_pass_ids: Optional[SequenceNotStr[str]]
22
19
  """The access pass IDs to filter the memberships by"""
23
20
 
@@ -42,6 +39,9 @@ class MembershipListParams(TypedDict, total=False):
42
39
  ]
43
40
  """The cancel options to filter the memberships by"""
44
41
 
42
+ company_id: Optional[str]
43
+ """The ID of the company to list memberships for"""
44
+
45
45
  created_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
46
46
  """The minimum creation date to filter by"""
47
47
 
@@ -68,3 +68,6 @@ class MembershipListParams(TypedDict, total=False):
68
68
 
69
69
  statuses: Optional[List[MembershipStatus]]
70
70
  """The membership status to filter the memberships by"""
71
+
72
+ user_ids: Optional[SequenceNotStr[str]]
73
+ """Only return memberships from these whop user ids"""
@@ -7,7 +7,7 @@ from .._models import BaseModel
7
7
  from .shared.currency import Currency
8
8
  from .shared.membership_status import MembershipStatus
9
9
 
10
- __all__ = ["MembershipListResponse", "Company", "Member", "Plan", "PromoCode", "User"]
10
+ __all__ = ["MembershipListResponse", "Company", "Member", "Plan", "Product", "PromoCode", "User"]
11
11
 
12
12
 
13
13
  class Company(BaseModel):
@@ -28,6 +28,14 @@ class Plan(BaseModel):
28
28
  """The internal ID of the plan."""
29
29
 
30
30
 
31
+ class Product(BaseModel):
32
+ id: str
33
+ """The internal ID of the public product."""
34
+
35
+ title: str
36
+ """The title of the product. Use for Whop 4.0."""
37
+
38
+
31
39
  class PromoCode(BaseModel):
32
40
  id: str
33
41
  """The ID of the promo."""
@@ -92,6 +100,9 @@ class MembershipListResponse(BaseModel):
92
100
  plan: Plan
93
101
  """The Plan this Membership is for."""
94
102
 
103
+ product: Product
104
+ """The Product this Membership grants access to."""
105
+
95
106
  promo_code: Optional[PromoCode] = None
96
107
  """The Promo Code that is currently applied to this Membership."""
97
108
 
@@ -0,0 +1,35 @@
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 Iterable, Optional
6
+ from typing_extensions import TypedDict
7
+
8
+ __all__ = ["MessageUpdateParams", "Attachment"]
9
+
10
+
11
+ class MessageUpdateParams(TypedDict, total=False):
12
+ attachments: Optional[Iterable[Attachment]]
13
+ """The attachments for this message"""
14
+
15
+ content: Optional[str]
16
+ """The content of the message in Markdown format"""
17
+
18
+ is_pinned: Optional[bool]
19
+ """Whether this message is pinned"""
20
+
21
+
22
+ class Attachment(TypedDict, total=False):
23
+ id: Optional[str]
24
+ """The ID of an existing attachment object.
25
+
26
+ Use this when updating a resource and keeping a subset of the attachments. Don't
27
+ use this unless you know what you're doing.
28
+ """
29
+
30
+ direct_upload_id: Optional[str]
31
+ """This ID should be used the first time you upload an attachment.
32
+
33
+ It is the ID of the direct upload that was created when uploading the file to S3
34
+ via the mediaDirectUpload mutation.
35
+ """
@@ -0,0 +1,26 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from datetime import datetime
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .shared.payment import Payment
8
+
9
+ __all__ = ["PaymentFailedWebhookEvent"]
10
+
11
+
12
+ class PaymentFailedWebhookEvent(BaseModel):
13
+ id: str
14
+ """A unique ID for every single webhook request"""
15
+
16
+ api_version: Literal["v1"]
17
+ """The API version for this webhook"""
18
+
19
+ data: Payment
20
+ """An object representing a receipt for a membership."""
21
+
22
+ timestamp: datetime
23
+ """The timestamp in ISO 8601 format that the webhook was sent at on the server"""
24
+
25
+ type: Literal["payment.failed"]
26
+ """The webhook event type"""
@@ -8,6 +8,7 @@ from typing_extensions import Literal, Required, Annotated, TypedDict
8
8
 
9
9
  from .._types import SequenceNotStr
10
10
  from .._utils import PropertyInfo
11
+ from .billing_reasons import BillingReasons
11
12
  from .shared.currency import Currency
12
13
  from .shared.direction import Direction
13
14
  from .shared.receipt_status import ReceiptStatus
@@ -26,13 +27,7 @@ class PaymentListParams(TypedDict, total=False):
26
27
  before: Optional[str]
27
28
  """Returns the elements in the list that come before the specified cursor."""
28
29
 
29
- billing_reasons: Optional[
30
- List[
31
- Literal[
32
- "subscription_create", "subscription_cycle", "subscription_update", "one_time", "manual", "subscription"
33
- ]
34
- ]
35
- ]
30
+ billing_reasons: Optional[List[BillingReasons]]
36
31
  """The billing reason for the payment"""
37
32
 
38
33
  created_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]