whop-sdk 0.0.1__py3-none-any.whl → 0.0.2__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 +18 -0
- whop_sdk/_version.py +1 -1
- whop_sdk/resources/__init__.py +28 -0
- whop_sdk/resources/checkout_configurations.py +12 -12
- whop_sdk/resources/forums.py +446 -0
- whop_sdk/resources/members.py +421 -0
- whop_sdk/resources/plans.py +10 -4
- whop_sdk/types/__init__.py +25 -0
- whop_sdk/types/app_list_response.py +16 -1
- whop_sdk/types/checkout_configuration_create_params.py +5 -5
- whop_sdk/types/checkout_configuration_list_response.py +9 -9
- whop_sdk/types/course_lesson_interaction_completed_webhook_event.py +26 -0
- whop_sdk/types/entry_approved_webhook_event.py +26 -0
- whop_sdk/types/entry_created_webhook_event.py +26 -0
- whop_sdk/types/entry_deleted_webhook_event.py +26 -0
- whop_sdk/types/entry_denied_webhook_event.py +26 -0
- whop_sdk/types/experience_list_response.py +27 -1
- whop_sdk/types/forum_list_params.py +28 -0
- whop_sdk/types/forum_list_response.py +33 -0
- whop_sdk/types/forum_update_params.py +23 -0
- whop_sdk/types/invoice_create_params.py +10 -2
- whop_sdk/types/member_list_params.py +70 -0
- whop_sdk/types/member_list_response.py +65 -0
- whop_sdk/types/member_retrieve_response.py +79 -0
- whop_sdk/types/membership_activated_webhook_event.py +29 -0
- whop_sdk/types/membership_deactivated_webhook_event.py +29 -0
- whop_sdk/types/payment_failed_webhook_event.py +26 -0
- whop_sdk/types/payment_pending_webhook_event.py +26 -0
- whop_sdk/types/payment_succeeded_webhook_event.py +26 -0
- whop_sdk/types/plan_create_params.py +10 -2
- whop_sdk/types/shared/__init__.py +7 -0
- whop_sdk/types/shared/access_level.py +7 -0
- whop_sdk/types/shared/app.py +25 -1
- whop_sdk/types/shared/checkout_configuration.py +9 -9
- whop_sdk/types/shared/company.py +15 -1
- whop_sdk/types/shared/course_lesson_interaction.py +20 -1
- whop_sdk/types/shared/email_notification_preferences.py +7 -0
- whop_sdk/types/shared/experience.py +27 -1
- whop_sdk/types/shared/forum.py +33 -0
- whop_sdk/types/shared/member_most_recent_actions.py +22 -0
- whop_sdk/types/shared/member_statuses.py +7 -0
- whop_sdk/types/shared/who_can_comment_types.py +7 -0
- whop_sdk/types/shared/who_can_post_types.py +7 -0
- whop_sdk/types/shared_params/__init__.py +6 -0
- whop_sdk/types/shared_params/access_level.py +9 -0
- whop_sdk/types/shared_params/email_notification_preferences.py +9 -0
- whop_sdk/types/shared_params/member_most_recent_actions.py +24 -0
- whop_sdk/types/shared_params/member_statuses.py +9 -0
- whop_sdk/types/shared_params/who_can_comment_types.py +9 -0
- whop_sdk/types/shared_params/who_can_post_types.py +9 -0
- whop_sdk/types/unwrap_webhook_event.py +24 -1
- whop_sdk/types/user_check_access_response.py +2 -3
- whop_sdk/types/user_retrieve_response.py +12 -1
- {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.2.dist-info}/METADATA +2 -2
- {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.2.dist-info}/RECORD +57 -26
- {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.2.dist-info}/WHEEL +0 -0
- {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,421 @@
|
|
|
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
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from ..types import member_list_params
|
|
12
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
13
|
+
from .._utils import maybe_transform
|
|
14
|
+
from .._compat import cached_property
|
|
15
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
16
|
+
from .._response import (
|
|
17
|
+
to_raw_response_wrapper,
|
|
18
|
+
to_streamed_response_wrapper,
|
|
19
|
+
async_to_raw_response_wrapper,
|
|
20
|
+
async_to_streamed_response_wrapper,
|
|
21
|
+
)
|
|
22
|
+
from ..pagination import SyncCursorPage, AsyncCursorPage
|
|
23
|
+
from .._base_client import AsyncPaginator, make_request_options
|
|
24
|
+
from ..types.shared.direction import Direction
|
|
25
|
+
from ..types.shared.access_level import AccessLevel
|
|
26
|
+
from ..types.member_list_response import MemberListResponse
|
|
27
|
+
from ..types.shared.member_statuses import MemberStatuses
|
|
28
|
+
from ..types.member_retrieve_response import MemberRetrieveResponse
|
|
29
|
+
from ..types.shared.member_most_recent_actions import MemberMostRecentActions
|
|
30
|
+
|
|
31
|
+
__all__ = ["MembersResource", "AsyncMembersResource"]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class MembersResource(SyncAPIResource):
|
|
35
|
+
@cached_property
|
|
36
|
+
def with_raw_response(self) -> MembersResourceWithRawResponse:
|
|
37
|
+
"""
|
|
38
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
39
|
+
the raw response object instead of the parsed content.
|
|
40
|
+
|
|
41
|
+
For more information, see https://www.github.com/whopio/whopsdk-python#accessing-raw-response-data-eg-headers
|
|
42
|
+
"""
|
|
43
|
+
return MembersResourceWithRawResponse(self)
|
|
44
|
+
|
|
45
|
+
@cached_property
|
|
46
|
+
def with_streaming_response(self) -> MembersResourceWithStreamingResponse:
|
|
47
|
+
"""
|
|
48
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
49
|
+
|
|
50
|
+
For more information, see https://www.github.com/whopio/whopsdk-python#with_streaming_response
|
|
51
|
+
"""
|
|
52
|
+
return MembersResourceWithStreamingResponse(self)
|
|
53
|
+
|
|
54
|
+
def retrieve(
|
|
55
|
+
self,
|
|
56
|
+
id: str,
|
|
57
|
+
*,
|
|
58
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
59
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
60
|
+
extra_headers: Headers | None = None,
|
|
61
|
+
extra_query: Query | None = None,
|
|
62
|
+
extra_body: Body | None = None,
|
|
63
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
|
+
) -> MemberRetrieveResponse:
|
|
65
|
+
"""
|
|
66
|
+
Retrieves a member of a company by ID
|
|
67
|
+
|
|
68
|
+
Required permissions:
|
|
69
|
+
|
|
70
|
+
- `member:basic:read`
|
|
71
|
+
- `member:email:read`
|
|
72
|
+
- `member:phone:read`
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
extra_headers: Send extra headers
|
|
76
|
+
|
|
77
|
+
extra_query: Add additional query parameters to the request
|
|
78
|
+
|
|
79
|
+
extra_body: Add additional JSON properties to the request
|
|
80
|
+
|
|
81
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
82
|
+
"""
|
|
83
|
+
if not id:
|
|
84
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
85
|
+
return self._get(
|
|
86
|
+
f"/members/{id}",
|
|
87
|
+
options=make_request_options(
|
|
88
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
89
|
+
),
|
|
90
|
+
cast_to=MemberRetrieveResponse,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
def list(
|
|
94
|
+
self,
|
|
95
|
+
*,
|
|
96
|
+
company_id: str,
|
|
97
|
+
access_level: Optional[AccessLevel] | Omit = omit,
|
|
98
|
+
access_pass_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
99
|
+
after: Optional[str] | Omit = omit,
|
|
100
|
+
before: Optional[str] | Omit = omit,
|
|
101
|
+
created_after: Union[str, datetime, None] | Omit = omit,
|
|
102
|
+
created_before: Union[str, datetime, None] | Omit = omit,
|
|
103
|
+
direction: Optional[Direction] | Omit = omit,
|
|
104
|
+
first: Optional[int] | Omit = omit,
|
|
105
|
+
last: Optional[int] | Omit = omit,
|
|
106
|
+
most_recent_actions: Optional[List[MemberMostRecentActions]] | Omit = omit,
|
|
107
|
+
order: Optional[Literal["id", "usd_total_spent", "created_at", "joined_at", "most_recent_action"]]
|
|
108
|
+
| Omit = omit,
|
|
109
|
+
plan_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
110
|
+
promo_code_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
111
|
+
query: Optional[str] | Omit = omit,
|
|
112
|
+
statuses: Optional[List[MemberStatuses]] | Omit = omit,
|
|
113
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
114
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
115
|
+
extra_headers: Headers | None = None,
|
|
116
|
+
extra_query: Query | None = None,
|
|
117
|
+
extra_body: Body | None = None,
|
|
118
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
119
|
+
) -> SyncCursorPage[MemberListResponse]:
|
|
120
|
+
"""
|
|
121
|
+
List the members of a company
|
|
122
|
+
|
|
123
|
+
Required permissions:
|
|
124
|
+
|
|
125
|
+
- `member:basic:read`
|
|
126
|
+
- `member:email:read`
|
|
127
|
+
- `member:phone:read`
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
company_id: The ID of the company to list members for
|
|
131
|
+
|
|
132
|
+
access_level: The access level a given user (or company) has to an access pass or company.
|
|
133
|
+
|
|
134
|
+
access_pass_ids: The access pass IDs to filter the members by
|
|
135
|
+
|
|
136
|
+
after: Returns the elements in the list that come after the specified cursor.
|
|
137
|
+
|
|
138
|
+
before: Returns the elements in the list that come before the specified cursor.
|
|
139
|
+
|
|
140
|
+
created_after: The minimum creation date to filter by
|
|
141
|
+
|
|
142
|
+
created_before: The maximum creation date to filter by
|
|
143
|
+
|
|
144
|
+
direction: The direction of the sort.
|
|
145
|
+
|
|
146
|
+
first: Returns the first _n_ elements from the list.
|
|
147
|
+
|
|
148
|
+
last: Returns the last _n_ elements from the list.
|
|
149
|
+
|
|
150
|
+
most_recent_actions: The most recent actions to filter the members by
|
|
151
|
+
|
|
152
|
+
order: Which columns can be used to sort.
|
|
153
|
+
|
|
154
|
+
plan_ids: The plan IDs to filter the members by
|
|
155
|
+
|
|
156
|
+
promo_code_ids: The promo code IDs to filter the members by
|
|
157
|
+
|
|
158
|
+
query: The name, username, or email to filter the members by. The email filter will
|
|
159
|
+
only apply if the current actor has the `member:email:read` permission.
|
|
160
|
+
|
|
161
|
+
statuses: The statuses to filter the members by
|
|
162
|
+
|
|
163
|
+
extra_headers: Send extra headers
|
|
164
|
+
|
|
165
|
+
extra_query: Add additional query parameters to the request
|
|
166
|
+
|
|
167
|
+
extra_body: Add additional JSON properties to the request
|
|
168
|
+
|
|
169
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
170
|
+
"""
|
|
171
|
+
return self._get_api_list(
|
|
172
|
+
"/members",
|
|
173
|
+
page=SyncCursorPage[MemberListResponse],
|
|
174
|
+
options=make_request_options(
|
|
175
|
+
extra_headers=extra_headers,
|
|
176
|
+
extra_query=extra_query,
|
|
177
|
+
extra_body=extra_body,
|
|
178
|
+
timeout=timeout,
|
|
179
|
+
query=maybe_transform(
|
|
180
|
+
{
|
|
181
|
+
"company_id": company_id,
|
|
182
|
+
"access_level": access_level,
|
|
183
|
+
"access_pass_ids": access_pass_ids,
|
|
184
|
+
"after": after,
|
|
185
|
+
"before": before,
|
|
186
|
+
"created_after": created_after,
|
|
187
|
+
"created_before": created_before,
|
|
188
|
+
"direction": direction,
|
|
189
|
+
"first": first,
|
|
190
|
+
"last": last,
|
|
191
|
+
"most_recent_actions": most_recent_actions,
|
|
192
|
+
"order": order,
|
|
193
|
+
"plan_ids": plan_ids,
|
|
194
|
+
"promo_code_ids": promo_code_ids,
|
|
195
|
+
"query": query,
|
|
196
|
+
"statuses": statuses,
|
|
197
|
+
},
|
|
198
|
+
member_list_params.MemberListParams,
|
|
199
|
+
),
|
|
200
|
+
),
|
|
201
|
+
model=MemberListResponse,
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class AsyncMembersResource(AsyncAPIResource):
|
|
206
|
+
@cached_property
|
|
207
|
+
def with_raw_response(self) -> AsyncMembersResourceWithRawResponse:
|
|
208
|
+
"""
|
|
209
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
210
|
+
the raw response object instead of the parsed content.
|
|
211
|
+
|
|
212
|
+
For more information, see https://www.github.com/whopio/whopsdk-python#accessing-raw-response-data-eg-headers
|
|
213
|
+
"""
|
|
214
|
+
return AsyncMembersResourceWithRawResponse(self)
|
|
215
|
+
|
|
216
|
+
@cached_property
|
|
217
|
+
def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse:
|
|
218
|
+
"""
|
|
219
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
220
|
+
|
|
221
|
+
For more information, see https://www.github.com/whopio/whopsdk-python#with_streaming_response
|
|
222
|
+
"""
|
|
223
|
+
return AsyncMembersResourceWithStreamingResponse(self)
|
|
224
|
+
|
|
225
|
+
async def retrieve(
|
|
226
|
+
self,
|
|
227
|
+
id: str,
|
|
228
|
+
*,
|
|
229
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
230
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
231
|
+
extra_headers: Headers | None = None,
|
|
232
|
+
extra_query: Query | None = None,
|
|
233
|
+
extra_body: Body | None = None,
|
|
234
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
235
|
+
) -> MemberRetrieveResponse:
|
|
236
|
+
"""
|
|
237
|
+
Retrieves a member of a company by ID
|
|
238
|
+
|
|
239
|
+
Required permissions:
|
|
240
|
+
|
|
241
|
+
- `member:basic:read`
|
|
242
|
+
- `member:email:read`
|
|
243
|
+
- `member:phone:read`
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
extra_headers: Send extra headers
|
|
247
|
+
|
|
248
|
+
extra_query: Add additional query parameters to the request
|
|
249
|
+
|
|
250
|
+
extra_body: Add additional JSON properties to the request
|
|
251
|
+
|
|
252
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
253
|
+
"""
|
|
254
|
+
if not id:
|
|
255
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
256
|
+
return await self._get(
|
|
257
|
+
f"/members/{id}",
|
|
258
|
+
options=make_request_options(
|
|
259
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
260
|
+
),
|
|
261
|
+
cast_to=MemberRetrieveResponse,
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
def list(
|
|
265
|
+
self,
|
|
266
|
+
*,
|
|
267
|
+
company_id: str,
|
|
268
|
+
access_level: Optional[AccessLevel] | Omit = omit,
|
|
269
|
+
access_pass_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
270
|
+
after: Optional[str] | Omit = omit,
|
|
271
|
+
before: Optional[str] | Omit = omit,
|
|
272
|
+
created_after: Union[str, datetime, None] | Omit = omit,
|
|
273
|
+
created_before: Union[str, datetime, None] | Omit = omit,
|
|
274
|
+
direction: Optional[Direction] | Omit = omit,
|
|
275
|
+
first: Optional[int] | Omit = omit,
|
|
276
|
+
last: Optional[int] | Omit = omit,
|
|
277
|
+
most_recent_actions: Optional[List[MemberMostRecentActions]] | Omit = omit,
|
|
278
|
+
order: Optional[Literal["id", "usd_total_spent", "created_at", "joined_at", "most_recent_action"]]
|
|
279
|
+
| Omit = omit,
|
|
280
|
+
plan_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
281
|
+
promo_code_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
282
|
+
query: Optional[str] | Omit = omit,
|
|
283
|
+
statuses: Optional[List[MemberStatuses]] | Omit = omit,
|
|
284
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
285
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
286
|
+
extra_headers: Headers | None = None,
|
|
287
|
+
extra_query: Query | None = None,
|
|
288
|
+
extra_body: Body | None = None,
|
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
290
|
+
) -> AsyncPaginator[MemberListResponse, AsyncCursorPage[MemberListResponse]]:
|
|
291
|
+
"""
|
|
292
|
+
List the members of a company
|
|
293
|
+
|
|
294
|
+
Required permissions:
|
|
295
|
+
|
|
296
|
+
- `member:basic:read`
|
|
297
|
+
- `member:email:read`
|
|
298
|
+
- `member:phone:read`
|
|
299
|
+
|
|
300
|
+
Args:
|
|
301
|
+
company_id: The ID of the company to list members for
|
|
302
|
+
|
|
303
|
+
access_level: The access level a given user (or company) has to an access pass or company.
|
|
304
|
+
|
|
305
|
+
access_pass_ids: The access pass IDs to filter the members by
|
|
306
|
+
|
|
307
|
+
after: Returns the elements in the list that come after the specified cursor.
|
|
308
|
+
|
|
309
|
+
before: Returns the elements in the list that come before the specified cursor.
|
|
310
|
+
|
|
311
|
+
created_after: The minimum creation date to filter by
|
|
312
|
+
|
|
313
|
+
created_before: The maximum creation date to filter by
|
|
314
|
+
|
|
315
|
+
direction: The direction of the sort.
|
|
316
|
+
|
|
317
|
+
first: Returns the first _n_ elements from the list.
|
|
318
|
+
|
|
319
|
+
last: Returns the last _n_ elements from the list.
|
|
320
|
+
|
|
321
|
+
most_recent_actions: The most recent actions to filter the members by
|
|
322
|
+
|
|
323
|
+
order: Which columns can be used to sort.
|
|
324
|
+
|
|
325
|
+
plan_ids: The plan IDs to filter the members by
|
|
326
|
+
|
|
327
|
+
promo_code_ids: The promo code IDs to filter the members by
|
|
328
|
+
|
|
329
|
+
query: The name, username, or email to filter the members by. The email filter will
|
|
330
|
+
only apply if the current actor has the `member:email:read` permission.
|
|
331
|
+
|
|
332
|
+
statuses: The statuses to filter the members by
|
|
333
|
+
|
|
334
|
+
extra_headers: Send extra headers
|
|
335
|
+
|
|
336
|
+
extra_query: Add additional query parameters to the request
|
|
337
|
+
|
|
338
|
+
extra_body: Add additional JSON properties to the request
|
|
339
|
+
|
|
340
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
341
|
+
"""
|
|
342
|
+
return self._get_api_list(
|
|
343
|
+
"/members",
|
|
344
|
+
page=AsyncCursorPage[MemberListResponse],
|
|
345
|
+
options=make_request_options(
|
|
346
|
+
extra_headers=extra_headers,
|
|
347
|
+
extra_query=extra_query,
|
|
348
|
+
extra_body=extra_body,
|
|
349
|
+
timeout=timeout,
|
|
350
|
+
query=maybe_transform(
|
|
351
|
+
{
|
|
352
|
+
"company_id": company_id,
|
|
353
|
+
"access_level": access_level,
|
|
354
|
+
"access_pass_ids": access_pass_ids,
|
|
355
|
+
"after": after,
|
|
356
|
+
"before": before,
|
|
357
|
+
"created_after": created_after,
|
|
358
|
+
"created_before": created_before,
|
|
359
|
+
"direction": direction,
|
|
360
|
+
"first": first,
|
|
361
|
+
"last": last,
|
|
362
|
+
"most_recent_actions": most_recent_actions,
|
|
363
|
+
"order": order,
|
|
364
|
+
"plan_ids": plan_ids,
|
|
365
|
+
"promo_code_ids": promo_code_ids,
|
|
366
|
+
"query": query,
|
|
367
|
+
"statuses": statuses,
|
|
368
|
+
},
|
|
369
|
+
member_list_params.MemberListParams,
|
|
370
|
+
),
|
|
371
|
+
),
|
|
372
|
+
model=MemberListResponse,
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
class MembersResourceWithRawResponse:
|
|
377
|
+
def __init__(self, members: MembersResource) -> None:
|
|
378
|
+
self._members = members
|
|
379
|
+
|
|
380
|
+
self.retrieve = to_raw_response_wrapper(
|
|
381
|
+
members.retrieve,
|
|
382
|
+
)
|
|
383
|
+
self.list = to_raw_response_wrapper(
|
|
384
|
+
members.list,
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
class AsyncMembersResourceWithRawResponse:
|
|
389
|
+
def __init__(self, members: AsyncMembersResource) -> None:
|
|
390
|
+
self._members = members
|
|
391
|
+
|
|
392
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
393
|
+
members.retrieve,
|
|
394
|
+
)
|
|
395
|
+
self.list = async_to_raw_response_wrapper(
|
|
396
|
+
members.list,
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
class MembersResourceWithStreamingResponse:
|
|
401
|
+
def __init__(self, members: MembersResource) -> None:
|
|
402
|
+
self._members = members
|
|
403
|
+
|
|
404
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
405
|
+
members.retrieve,
|
|
406
|
+
)
|
|
407
|
+
self.list = to_streamed_response_wrapper(
|
|
408
|
+
members.list,
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
class AsyncMembersResourceWithStreamingResponse:
|
|
413
|
+
def __init__(self, members: AsyncMembersResource) -> None:
|
|
414
|
+
self._members = members
|
|
415
|
+
|
|
416
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
417
|
+
members.retrieve,
|
|
418
|
+
)
|
|
419
|
+
self.list = async_to_streamed_response_wrapper(
|
|
420
|
+
members.list,
|
|
421
|
+
)
|
whop_sdk/resources/plans.py
CHANGED
|
@@ -107,7 +107,9 @@ class PlansResource(SyncAPIResource):
|
|
|
107
107
|
|
|
108
108
|
image: An image for the plan. This will be visible on the product page to customers.
|
|
109
109
|
|
|
110
|
-
initial_price: An additional amount charged upon first purchase.
|
|
110
|
+
initial_price: An additional amount charged upon first purchase. Use only if a one time payment
|
|
111
|
+
OR you want to charge an additional amount on top of the renewal price. Provided
|
|
112
|
+
as a number in dollars. Eg: 10.43 for $10.43
|
|
111
113
|
|
|
112
114
|
internal_notes: A personal description or notes section for the business.
|
|
113
115
|
|
|
@@ -118,7 +120,8 @@ class PlansResource(SyncAPIResource):
|
|
|
118
120
|
|
|
119
121
|
release_method: The methods of how a plan can be released.
|
|
120
122
|
|
|
121
|
-
renewal_price: The amount the customer is charged every billing period.
|
|
123
|
+
renewal_price: The amount the customer is charged every billing period. Use only if a recurring
|
|
124
|
+
payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
122
125
|
|
|
123
126
|
title: The title of the plan. This will be visible on the product page to customers.
|
|
124
127
|
|
|
@@ -501,7 +504,9 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
501
504
|
|
|
502
505
|
image: An image for the plan. This will be visible on the product page to customers.
|
|
503
506
|
|
|
504
|
-
initial_price: An additional amount charged upon first purchase.
|
|
507
|
+
initial_price: An additional amount charged upon first purchase. Use only if a one time payment
|
|
508
|
+
OR you want to charge an additional amount on top of the renewal price. Provided
|
|
509
|
+
as a number in dollars. Eg: 10.43 for $10.43
|
|
505
510
|
|
|
506
511
|
internal_notes: A personal description or notes section for the business.
|
|
507
512
|
|
|
@@ -512,7 +517,8 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
512
517
|
|
|
513
518
|
release_method: The methods of how a plan can be released.
|
|
514
519
|
|
|
515
|
-
renewal_price: The amount the customer is charged every billing period.
|
|
520
|
+
renewal_price: The amount the customer is charged every billing period. Use only if a recurring
|
|
521
|
+
payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
516
522
|
|
|
517
523
|
title: The title of the plan. This will be visible on the product page to customers.
|
|
518
524
|
|
whop_sdk/types/__init__.py
CHANGED
|
@@ -6,6 +6,7 @@ from .shared import (
|
|
|
6
6
|
App as App,
|
|
7
7
|
Plan as Plan,
|
|
8
8
|
Entry as Entry,
|
|
9
|
+
Forum as Forum,
|
|
9
10
|
Company as Company,
|
|
10
11
|
Invoice as Invoice,
|
|
11
12
|
Message as Message,
|
|
@@ -27,6 +28,7 @@ from .shared import (
|
|
|
27
28
|
Membership as Membership,
|
|
28
29
|
Visibility as Visibility,
|
|
29
30
|
WhoCanPost as WhoCanPost,
|
|
31
|
+
AccessLevel as AccessLevel,
|
|
30
32
|
AppStatuses as AppStatuses,
|
|
31
33
|
AppViewType as AppViewType,
|
|
32
34
|
ChatChannel as ChatChannel,
|
|
@@ -39,22 +41,27 @@ from .shared import (
|
|
|
39
41
|
ReceiptStatus as ReceiptStatus,
|
|
40
42
|
ReleaseMethod as ReleaseMethod,
|
|
41
43
|
AccessPassType as AccessPassType,
|
|
44
|
+
MemberStatuses as MemberStatuses,
|
|
42
45
|
ShipmentStatus as ShipmentStatus,
|
|
43
46
|
SupportChannel as SupportChannel,
|
|
44
47
|
InvoiceListItem as InvoiceListItem,
|
|
45
48
|
ProductListItem as ProductListItem,
|
|
46
49
|
ShipmentCarrier as ShipmentCarrier,
|
|
50
|
+
WhoCanPostTypes as WhoCanPostTypes,
|
|
47
51
|
AppBuildStatuses as AppBuildStatuses,
|
|
48
52
|
CollectionMethod as CollectionMethod,
|
|
49
53
|
MembershipStatus as MembershipStatus,
|
|
50
54
|
VisibilityFilter as VisibilityFilter,
|
|
51
55
|
AppBuildPlatforms as AppBuildPlatforms,
|
|
52
56
|
ShipmentSubstatus as ShipmentSubstatus,
|
|
57
|
+
WhoCanCommentTypes as WhoCanCommentTypes,
|
|
53
58
|
AuthorizedUserRoles as AuthorizedUserRoles,
|
|
54
59
|
CheckoutConfiguration as CheckoutConfiguration,
|
|
55
60
|
FriendlyReceiptStatus as FriendlyReceiptStatus,
|
|
56
61
|
GlobalAffiliateStatus as GlobalAffiliateStatus,
|
|
57
62
|
CourseLessonInteraction as CourseLessonInteraction,
|
|
63
|
+
MemberMostRecentActions as MemberMostRecentActions,
|
|
64
|
+
EmailNotificationPreferences as EmailNotificationPreferences,
|
|
58
65
|
CourseLessonInteractionListItem as CourseLessonInteractionListItem,
|
|
59
66
|
)
|
|
60
67
|
from .app_list_params import AppListParams as AppListParams
|
|
@@ -63,14 +70,19 @@ from .app_create_params import AppCreateParams as AppCreateParams
|
|
|
63
70
|
from .app_list_response import AppListResponse as AppListResponse
|
|
64
71
|
from .app_update_params import AppUpdateParams as AppUpdateParams
|
|
65
72
|
from .entry_list_params import EntryListParams as EntryListParams
|
|
73
|
+
from .forum_list_params import ForumListParams as ForumListParams
|
|
74
|
+
from .member_list_params import MemberListParams as MemberListParams
|
|
66
75
|
from .plan_create_params import PlanCreateParams as PlanCreateParams
|
|
67
76
|
from .plan_list_response import PlanListResponse as PlanListResponse
|
|
68
77
|
from .plan_update_params import PlanUpdateParams as PlanUpdateParams
|
|
69
78
|
from .entry_list_response import EntryListResponse as EntryListResponse
|
|
79
|
+
from .forum_list_response import ForumListResponse as ForumListResponse
|
|
80
|
+
from .forum_update_params import ForumUpdateParams as ForumUpdateParams
|
|
70
81
|
from .invoice_list_params import InvoiceListParams as InvoiceListParams
|
|
71
82
|
from .message_list_params import MessageListParams as MessageListParams
|
|
72
83
|
from .payment_list_params import PaymentListParams as PaymentListParams
|
|
73
84
|
from .product_list_params import ProductListParams as ProductListParams
|
|
85
|
+
from .member_list_response import MemberListResponse as MemberListResponse
|
|
74
86
|
from .plan_delete_response import PlanDeleteResponse as PlanDeleteResponse
|
|
75
87
|
from .reaction_list_params import ReactionListParams as ReactionListParams
|
|
76
88
|
from .shipment_list_params import ShipmentListParams as ShipmentListParams
|
|
@@ -109,27 +121,40 @@ from .experience_list_response import ExperienceListResponse as ExperienceListRe
|
|
|
109
121
|
from .experience_update_params import ExperienceUpdateParams as ExperienceUpdateParams
|
|
110
122
|
from .forum_post_create_params import ForumPostCreateParams as ForumPostCreateParams
|
|
111
123
|
from .forum_post_list_response import ForumPostListResponse as ForumPostListResponse
|
|
124
|
+
from .member_retrieve_response import MemberRetrieveResponse as MemberRetrieveResponse
|
|
112
125
|
from .membership_cancel_params import MembershipCancelParams as MembershipCancelParams
|
|
113
126
|
from .membership_list_response import MembershipListResponse as MembershipListResponse
|
|
114
127
|
from .membership_update_params import MembershipUpdateParams as MembershipUpdateParams
|
|
115
128
|
from .chat_channel_list_response import ChatChannelListResponse as ChatChannelListResponse
|
|
116
129
|
from .chat_channel_update_params import ChatChannelUpdateParams as ChatChannelUpdateParams
|
|
130
|
+
from .entry_denied_webhook_event import EntryDeniedWebhookEvent as EntryDeniedWebhookEvent
|
|
117
131
|
from .experience_delete_response import ExperienceDeleteResponse as ExperienceDeleteResponse
|
|
118
132
|
from .invoice_paid_webhook_event import InvoicePaidWebhookEvent as InvoicePaidWebhookEvent
|
|
119
133
|
from .user_check_access_response import UserCheckAccessResponse as UserCheckAccessResponse
|
|
120
134
|
from .authorized_user_list_params import AuthorizedUserListParams as AuthorizedUserListParams
|
|
135
|
+
from .entry_created_webhook_event import EntryCreatedWebhookEvent as EntryCreatedWebhookEvent
|
|
136
|
+
from .entry_deleted_webhook_event import EntryDeletedWebhookEvent as EntryDeletedWebhookEvent
|
|
121
137
|
from .support_channel_list_params import SupportChannelListParams as SupportChannelListParams
|
|
138
|
+
from .entry_approved_webhook_event import EntryApprovedWebhookEvent as EntryApprovedWebhookEvent
|
|
122
139
|
from .invoice_voided_webhook_event import InvoiceVoidedWebhookEvent as InvoiceVoidedWebhookEvent
|
|
140
|
+
from .payment_failed_webhook_event import PaymentFailedWebhookEvent as PaymentFailedWebhookEvent
|
|
123
141
|
from .authorized_user_list_response import AuthorizedUserListResponse as AuthorizedUserListResponse
|
|
124
142
|
from .invoice_created_webhook_event import InvoiceCreatedWebhookEvent as InvoiceCreatedWebhookEvent
|
|
143
|
+
from .payment_pending_webhook_event import PaymentPendingWebhookEvent as PaymentPendingWebhookEvent
|
|
125
144
|
from .support_channel_create_params import SupportChannelCreateParams as SupportChannelCreateParams
|
|
126
145
|
from .support_channel_list_response import SupportChannelListResponse as SupportChannelListResponse
|
|
127
146
|
from .invoice_past_due_webhook_event import InvoicePastDueWebhookEvent as InvoicePastDueWebhookEvent
|
|
147
|
+
from .payment_succeeded_webhook_event import PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent
|
|
128
148
|
from .ledger_account_retrieve_response import LedgerAccountRetrieveResponse as LedgerAccountRetrieveResponse
|
|
129
149
|
from .authorized_user_retrieve_response import AuthorizedUserRetrieveResponse as AuthorizedUserRetrieveResponse
|
|
130
150
|
from .checkout_configuration_list_params import CheckoutConfigurationListParams as CheckoutConfigurationListParams
|
|
151
|
+
from .membership_activated_webhook_event import MembershipActivatedWebhookEvent as MembershipActivatedWebhookEvent
|
|
131
152
|
from .checkout_configuration_create_params import CheckoutConfigurationCreateParams as CheckoutConfigurationCreateParams
|
|
132
153
|
from .checkout_configuration_list_response import CheckoutConfigurationListResponse as CheckoutConfigurationListResponse
|
|
154
|
+
from .membership_deactivated_webhook_event import MembershipDeactivatedWebhookEvent as MembershipDeactivatedWebhookEvent
|
|
133
155
|
from .course_lesson_interaction_list_params import (
|
|
134
156
|
CourseLessonInteractionListParams as CourseLessonInteractionListParams,
|
|
135
157
|
)
|
|
158
|
+
from .course_lesson_interaction_completed_webhook_event import (
|
|
159
|
+
CourseLessonInteractionCompletedWebhookEvent as CourseLessonInteractionCompletedWebhookEvent,
|
|
160
|
+
)
|
|
@@ -5,7 +5,7 @@ from typing import Optional
|
|
|
5
5
|
from .._models import BaseModel
|
|
6
6
|
from .shared.app_statuses import AppStatuses
|
|
7
7
|
|
|
8
|
-
__all__ = ["AppListResponse", "Company", "Creator"]
|
|
8
|
+
__all__ = ["AppListResponse", "Company", "Creator", "Icon"]
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Company(BaseModel):
|
|
@@ -27,6 +27,14 @@ class Creator(BaseModel):
|
|
|
27
27
|
"""The username of the user from their Whop account."""
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
class Icon(BaseModel):
|
|
31
|
+
url: Optional[str] = None
|
|
32
|
+
"""This is the URL you use to render optimized attachments on the client.
|
|
33
|
+
|
|
34
|
+
This should be used for apps.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
|
|
30
38
|
class AppListResponse(BaseModel):
|
|
31
39
|
id: str
|
|
32
40
|
"""The ID of the app"""
|
|
@@ -71,6 +79,13 @@ class AppListResponse(BaseModel):
|
|
|
71
79
|
/experiences/[experienceId]
|
|
72
80
|
"""
|
|
73
81
|
|
|
82
|
+
icon: Optional[Icon] = None
|
|
83
|
+
"""The icon for the app.
|
|
84
|
+
|
|
85
|
+
This icon is shown on discovery, on the product page, on checkout, and as a
|
|
86
|
+
default icon for the experiences.
|
|
87
|
+
"""
|
|
88
|
+
|
|
74
89
|
name: str
|
|
75
90
|
"""The name of the app"""
|
|
76
91
|
|
|
@@ -16,19 +16,19 @@ __all__ = ["CheckoutConfigurationCreateParams", "Plan", "PlanCustomField", "Plan
|
|
|
16
16
|
|
|
17
17
|
class CheckoutConfigurationCreateParams(TypedDict, total=False):
|
|
18
18
|
affiliate_code: Optional[str]
|
|
19
|
-
"""The affiliate code to use for the checkout
|
|
19
|
+
"""The affiliate code to use for the checkout configuration"""
|
|
20
20
|
|
|
21
21
|
metadata: Optional[Dict[str, object]]
|
|
22
|
-
"""The metadata to use for the checkout
|
|
22
|
+
"""The metadata to use for the checkout configuration"""
|
|
23
23
|
|
|
24
24
|
plan: Optional[Plan]
|
|
25
|
-
"""Pass this object to create a new plan for this checkout
|
|
25
|
+
"""Pass this object to create a new plan for this checkout configuration"""
|
|
26
26
|
|
|
27
27
|
plan_id: Optional[str]
|
|
28
|
-
"""The ID of the plan to use for the checkout
|
|
28
|
+
"""The ID of the plan to use for the checkout configuration"""
|
|
29
29
|
|
|
30
30
|
redirect_url: Optional[str]
|
|
31
|
-
"""The URL to redirect the user to after the checkout
|
|
31
|
+
"""The URL to redirect the user to after the checkout configuration is created"""
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
class PlanCustomField(TypedDict, total=False):
|
|
@@ -45,22 +45,22 @@ class Plan(BaseModel):
|
|
|
45
45
|
|
|
46
46
|
class CheckoutConfigurationListResponse(BaseModel):
|
|
47
47
|
id: str
|
|
48
|
-
"""The ID of the checkout
|
|
48
|
+
"""The ID of the checkout configuration"""
|
|
49
49
|
|
|
50
|
-
affiliate_code: str
|
|
51
|
-
"""The affiliate code to use for the checkout
|
|
50
|
+
affiliate_code: Optional[str] = None
|
|
51
|
+
"""The affiliate code to use for the checkout configuration"""
|
|
52
52
|
|
|
53
53
|
company_id: str
|
|
54
|
-
"""The ID of the company to use for the checkout
|
|
54
|
+
"""The ID of the company to use for the checkout configuration"""
|
|
55
55
|
|
|
56
56
|
metadata: Dict[str, object]
|
|
57
|
-
"""The metadata to use for the checkout
|
|
57
|
+
"""The metadata to use for the checkout configuration"""
|
|
58
58
|
|
|
59
59
|
plan: Plan
|
|
60
|
-
"""The plan to use for the checkout
|
|
60
|
+
"""The plan to use for the checkout configuration"""
|
|
61
61
|
|
|
62
62
|
purchase_url: str
|
|
63
|
-
"""The URL to redirect the user to after the checkout
|
|
63
|
+
"""The URL to redirect the user to after the checkout configuration is created"""
|
|
64
64
|
|
|
65
|
-
redirect_url: str
|
|
66
|
-
"""The URL to redirect the user to after the checkout
|
|
65
|
+
redirect_url: Optional[str] = None
|
|
66
|
+
"""The URL to redirect the user to after the checkout configuration is created"""
|