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
|
@@ -13,6 +13,7 @@ from ..types import (
|
|
|
13
13
|
experience_create_params,
|
|
14
14
|
experience_detach_params,
|
|
15
15
|
experience_update_params,
|
|
16
|
+
experience_duplicate_params,
|
|
16
17
|
)
|
|
17
18
|
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
18
19
|
from .._utils import maybe_transform, async_maybe_transform
|
|
@@ -389,6 +390,53 @@ class ExperiencesResource(SyncAPIResource):
|
|
|
389
390
|
cast_to=Experience,
|
|
390
391
|
)
|
|
391
392
|
|
|
393
|
+
def duplicate(
|
|
394
|
+
self,
|
|
395
|
+
id: str,
|
|
396
|
+
*,
|
|
397
|
+
name: Optional[str] | Omit = omit,
|
|
398
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
399
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
400
|
+
extra_headers: Headers | None = None,
|
|
401
|
+
extra_query: Query | None = None,
|
|
402
|
+
extra_body: Body | None = None,
|
|
403
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
404
|
+
) -> Experience:
|
|
405
|
+
"""Duplicates an existing experience.
|
|
406
|
+
|
|
407
|
+
The name will be copied, unless provided. The
|
|
408
|
+
new experience will be attached to the same products as the original experience.
|
|
409
|
+
If duplicating a Forum or Chat experience, the new experience will have the same
|
|
410
|
+
settings as the original experience, e.g. who can post, who can comment, etc. No
|
|
411
|
+
content, e.g. posts, messages, lessons from within the original experience will
|
|
412
|
+
be copied.
|
|
413
|
+
|
|
414
|
+
Required permissions:
|
|
415
|
+
|
|
416
|
+
- `experience:create`
|
|
417
|
+
|
|
418
|
+
Args:
|
|
419
|
+
name: The name of the new experience
|
|
420
|
+
|
|
421
|
+
extra_headers: Send extra headers
|
|
422
|
+
|
|
423
|
+
extra_query: Add additional query parameters to the request
|
|
424
|
+
|
|
425
|
+
extra_body: Add additional JSON properties to the request
|
|
426
|
+
|
|
427
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
428
|
+
"""
|
|
429
|
+
if not id:
|
|
430
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
431
|
+
return self._post(
|
|
432
|
+
f"/experiences/{id}/duplicate",
|
|
433
|
+
body=maybe_transform({"name": name}, experience_duplicate_params.ExperienceDuplicateParams),
|
|
434
|
+
options=make_request_options(
|
|
435
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
436
|
+
),
|
|
437
|
+
cast_to=Experience,
|
|
438
|
+
)
|
|
439
|
+
|
|
392
440
|
|
|
393
441
|
class AsyncExperiencesResource(AsyncAPIResource):
|
|
394
442
|
@cached_property
|
|
@@ -750,6 +798,53 @@ class AsyncExperiencesResource(AsyncAPIResource):
|
|
|
750
798
|
cast_to=Experience,
|
|
751
799
|
)
|
|
752
800
|
|
|
801
|
+
async def duplicate(
|
|
802
|
+
self,
|
|
803
|
+
id: str,
|
|
804
|
+
*,
|
|
805
|
+
name: Optional[str] | Omit = omit,
|
|
806
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
807
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
808
|
+
extra_headers: Headers | None = None,
|
|
809
|
+
extra_query: Query | None = None,
|
|
810
|
+
extra_body: Body | None = None,
|
|
811
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
812
|
+
) -> Experience:
|
|
813
|
+
"""Duplicates an existing experience.
|
|
814
|
+
|
|
815
|
+
The name will be copied, unless provided. The
|
|
816
|
+
new experience will be attached to the same products as the original experience.
|
|
817
|
+
If duplicating a Forum or Chat experience, the new experience will have the same
|
|
818
|
+
settings as the original experience, e.g. who can post, who can comment, etc. No
|
|
819
|
+
content, e.g. posts, messages, lessons from within the original experience will
|
|
820
|
+
be copied.
|
|
821
|
+
|
|
822
|
+
Required permissions:
|
|
823
|
+
|
|
824
|
+
- `experience:create`
|
|
825
|
+
|
|
826
|
+
Args:
|
|
827
|
+
name: The name of the new experience
|
|
828
|
+
|
|
829
|
+
extra_headers: Send extra headers
|
|
830
|
+
|
|
831
|
+
extra_query: Add additional query parameters to the request
|
|
832
|
+
|
|
833
|
+
extra_body: Add additional JSON properties to the request
|
|
834
|
+
|
|
835
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
836
|
+
"""
|
|
837
|
+
if not id:
|
|
838
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
839
|
+
return await self._post(
|
|
840
|
+
f"/experiences/{id}/duplicate",
|
|
841
|
+
body=await async_maybe_transform({"name": name}, experience_duplicate_params.ExperienceDuplicateParams),
|
|
842
|
+
options=make_request_options(
|
|
843
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
844
|
+
),
|
|
845
|
+
cast_to=Experience,
|
|
846
|
+
)
|
|
847
|
+
|
|
753
848
|
|
|
754
849
|
class ExperiencesResourceWithRawResponse:
|
|
755
850
|
def __init__(self, experiences: ExperiencesResource) -> None:
|
|
@@ -776,6 +871,9 @@ class ExperiencesResourceWithRawResponse:
|
|
|
776
871
|
self.detach = to_raw_response_wrapper(
|
|
777
872
|
experiences.detach,
|
|
778
873
|
)
|
|
874
|
+
self.duplicate = to_raw_response_wrapper(
|
|
875
|
+
experiences.duplicate,
|
|
876
|
+
)
|
|
779
877
|
|
|
780
878
|
|
|
781
879
|
class AsyncExperiencesResourceWithRawResponse:
|
|
@@ -803,6 +901,9 @@ class AsyncExperiencesResourceWithRawResponse:
|
|
|
803
901
|
self.detach = async_to_raw_response_wrapper(
|
|
804
902
|
experiences.detach,
|
|
805
903
|
)
|
|
904
|
+
self.duplicate = async_to_raw_response_wrapper(
|
|
905
|
+
experiences.duplicate,
|
|
906
|
+
)
|
|
806
907
|
|
|
807
908
|
|
|
808
909
|
class ExperiencesResourceWithStreamingResponse:
|
|
@@ -830,6 +931,9 @@ class ExperiencesResourceWithStreamingResponse:
|
|
|
830
931
|
self.detach = to_streamed_response_wrapper(
|
|
831
932
|
experiences.detach,
|
|
832
933
|
)
|
|
934
|
+
self.duplicate = to_streamed_response_wrapper(
|
|
935
|
+
experiences.duplicate,
|
|
936
|
+
)
|
|
833
937
|
|
|
834
938
|
|
|
835
939
|
class AsyncExperiencesResourceWithStreamingResponse:
|
|
@@ -857,3 +961,6 @@ class AsyncExperiencesResourceWithStreamingResponse:
|
|
|
857
961
|
self.detach = async_to_streamed_response_wrapper(
|
|
858
962
|
experiences.detach,
|
|
859
963
|
)
|
|
964
|
+
self.duplicate = async_to_streamed_response_wrapper(
|
|
965
|
+
experiences.duplicate,
|
|
966
|
+
)
|
|
@@ -6,7 +6,7 @@ from typing import Iterable, Optional
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ..types import forum_post_list_params, forum_post_create_params
|
|
9
|
+
from ..types import forum_post_list_params, forum_post_create_params, forum_post_update_params
|
|
10
10
|
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
11
|
from .._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from .._compat import cached_property
|
|
@@ -167,6 +167,61 @@ class ForumPostsResource(SyncAPIResource):
|
|
|
167
167
|
cast_to=ForumPost,
|
|
168
168
|
)
|
|
169
169
|
|
|
170
|
+
def update(
|
|
171
|
+
self,
|
|
172
|
+
id: str,
|
|
173
|
+
*,
|
|
174
|
+
attachments: Optional[Iterable[forum_post_update_params.Attachment]] | Omit = omit,
|
|
175
|
+
content: Optional[str] | Omit = omit,
|
|
176
|
+
is_pinned: Optional[bool] | Omit = omit,
|
|
177
|
+
title: Optional[str] | Omit = omit,
|
|
178
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
179
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
180
|
+
extra_headers: Headers | None = None,
|
|
181
|
+
extra_query: Query | None = None,
|
|
182
|
+
extra_body: Body | None = None,
|
|
183
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
184
|
+
) -> ForumPost:
|
|
185
|
+
"""
|
|
186
|
+
Update an existing forum post
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
attachments: The attachments for this post
|
|
190
|
+
|
|
191
|
+
content: This is the main body of the post in Markdown format. Hidden if paywalled and
|
|
192
|
+
user hasn't purchased access to it.
|
|
193
|
+
|
|
194
|
+
is_pinned: Whether the post is pinned. You can only pin a top level posts (not comments).
|
|
195
|
+
|
|
196
|
+
title: The title of the post. Only visible if paywalled.
|
|
197
|
+
|
|
198
|
+
extra_headers: Send extra headers
|
|
199
|
+
|
|
200
|
+
extra_query: Add additional query parameters to the request
|
|
201
|
+
|
|
202
|
+
extra_body: Add additional JSON properties to the request
|
|
203
|
+
|
|
204
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
205
|
+
"""
|
|
206
|
+
if not id:
|
|
207
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
208
|
+
return self._patch(
|
|
209
|
+
f"/forum_posts/{id}",
|
|
210
|
+
body=maybe_transform(
|
|
211
|
+
{
|
|
212
|
+
"attachments": attachments,
|
|
213
|
+
"content": content,
|
|
214
|
+
"is_pinned": is_pinned,
|
|
215
|
+
"title": title,
|
|
216
|
+
},
|
|
217
|
+
forum_post_update_params.ForumPostUpdateParams,
|
|
218
|
+
),
|
|
219
|
+
options=make_request_options(
|
|
220
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
221
|
+
),
|
|
222
|
+
cast_to=ForumPost,
|
|
223
|
+
)
|
|
224
|
+
|
|
170
225
|
def list(
|
|
171
226
|
self,
|
|
172
227
|
*,
|
|
@@ -380,6 +435,61 @@ class AsyncForumPostsResource(AsyncAPIResource):
|
|
|
380
435
|
cast_to=ForumPost,
|
|
381
436
|
)
|
|
382
437
|
|
|
438
|
+
async def update(
|
|
439
|
+
self,
|
|
440
|
+
id: str,
|
|
441
|
+
*,
|
|
442
|
+
attachments: Optional[Iterable[forum_post_update_params.Attachment]] | Omit = omit,
|
|
443
|
+
content: Optional[str] | Omit = omit,
|
|
444
|
+
is_pinned: Optional[bool] | Omit = omit,
|
|
445
|
+
title: Optional[str] | Omit = omit,
|
|
446
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
447
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
448
|
+
extra_headers: Headers | None = None,
|
|
449
|
+
extra_query: Query | None = None,
|
|
450
|
+
extra_body: Body | None = None,
|
|
451
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
452
|
+
) -> ForumPost:
|
|
453
|
+
"""
|
|
454
|
+
Update an existing forum post
|
|
455
|
+
|
|
456
|
+
Args:
|
|
457
|
+
attachments: The attachments for this post
|
|
458
|
+
|
|
459
|
+
content: This is the main body of the post in Markdown format. Hidden if paywalled and
|
|
460
|
+
user hasn't purchased access to it.
|
|
461
|
+
|
|
462
|
+
is_pinned: Whether the post is pinned. You can only pin a top level posts (not comments).
|
|
463
|
+
|
|
464
|
+
title: The title of the post. Only visible if paywalled.
|
|
465
|
+
|
|
466
|
+
extra_headers: Send extra headers
|
|
467
|
+
|
|
468
|
+
extra_query: Add additional query parameters to the request
|
|
469
|
+
|
|
470
|
+
extra_body: Add additional JSON properties to the request
|
|
471
|
+
|
|
472
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
473
|
+
"""
|
|
474
|
+
if not id:
|
|
475
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
476
|
+
return await self._patch(
|
|
477
|
+
f"/forum_posts/{id}",
|
|
478
|
+
body=await async_maybe_transform(
|
|
479
|
+
{
|
|
480
|
+
"attachments": attachments,
|
|
481
|
+
"content": content,
|
|
482
|
+
"is_pinned": is_pinned,
|
|
483
|
+
"title": title,
|
|
484
|
+
},
|
|
485
|
+
forum_post_update_params.ForumPostUpdateParams,
|
|
486
|
+
),
|
|
487
|
+
options=make_request_options(
|
|
488
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
489
|
+
),
|
|
490
|
+
cast_to=ForumPost,
|
|
491
|
+
)
|
|
492
|
+
|
|
383
493
|
def list(
|
|
384
494
|
self,
|
|
385
495
|
*,
|
|
@@ -462,6 +572,9 @@ class ForumPostsResourceWithRawResponse:
|
|
|
462
572
|
self.retrieve = to_raw_response_wrapper(
|
|
463
573
|
forum_posts.retrieve,
|
|
464
574
|
)
|
|
575
|
+
self.update = to_raw_response_wrapper(
|
|
576
|
+
forum_posts.update,
|
|
577
|
+
)
|
|
465
578
|
self.list = to_raw_response_wrapper(
|
|
466
579
|
forum_posts.list,
|
|
467
580
|
)
|
|
@@ -477,6 +590,9 @@ class AsyncForumPostsResourceWithRawResponse:
|
|
|
477
590
|
self.retrieve = async_to_raw_response_wrapper(
|
|
478
591
|
forum_posts.retrieve,
|
|
479
592
|
)
|
|
593
|
+
self.update = async_to_raw_response_wrapper(
|
|
594
|
+
forum_posts.update,
|
|
595
|
+
)
|
|
480
596
|
self.list = async_to_raw_response_wrapper(
|
|
481
597
|
forum_posts.list,
|
|
482
598
|
)
|
|
@@ -492,6 +608,9 @@ class ForumPostsResourceWithStreamingResponse:
|
|
|
492
608
|
self.retrieve = to_streamed_response_wrapper(
|
|
493
609
|
forum_posts.retrieve,
|
|
494
610
|
)
|
|
611
|
+
self.update = to_streamed_response_wrapper(
|
|
612
|
+
forum_posts.update,
|
|
613
|
+
)
|
|
495
614
|
self.list = to_streamed_response_wrapper(
|
|
496
615
|
forum_posts.list,
|
|
497
616
|
)
|
|
@@ -507,6 +626,9 @@ class AsyncForumPostsResourceWithStreamingResponse:
|
|
|
507
626
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
508
627
|
forum_posts.retrieve,
|
|
509
628
|
)
|
|
629
|
+
self.update = async_to_streamed_response_wrapper(
|
|
630
|
+
forum_posts.update,
|
|
631
|
+
)
|
|
510
632
|
self.list = async_to_streamed_response_wrapper(
|
|
511
633
|
forum_posts.list,
|
|
512
634
|
)
|
whop_sdk/resources/members.py
CHANGED
|
@@ -110,6 +110,7 @@ class MembersResource(SyncAPIResource):
|
|
|
110
110
|
promo_code_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
111
111
|
query: Optional[str] | Omit = omit,
|
|
112
112
|
statuses: Optional[List[MemberStatuses]] | Omit = omit,
|
|
113
|
+
user_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
113
114
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
114
115
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
115
116
|
extra_headers: Headers | None = None,
|
|
@@ -160,6 +161,8 @@ class MembersResource(SyncAPIResource):
|
|
|
160
161
|
|
|
161
162
|
statuses: The statuses to filter the members by
|
|
162
163
|
|
|
164
|
+
user_ids: The user IDs to filter the members by
|
|
165
|
+
|
|
163
166
|
extra_headers: Send extra headers
|
|
164
167
|
|
|
165
168
|
extra_query: Add additional query parameters to the request
|
|
@@ -194,6 +197,7 @@ class MembersResource(SyncAPIResource):
|
|
|
194
197
|
"promo_code_ids": promo_code_ids,
|
|
195
198
|
"query": query,
|
|
196
199
|
"statuses": statuses,
|
|
200
|
+
"user_ids": user_ids,
|
|
197
201
|
},
|
|
198
202
|
member_list_params.MemberListParams,
|
|
199
203
|
),
|
|
@@ -281,6 +285,7 @@ class AsyncMembersResource(AsyncAPIResource):
|
|
|
281
285
|
promo_code_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
282
286
|
query: Optional[str] | Omit = omit,
|
|
283
287
|
statuses: Optional[List[MemberStatuses]] | Omit = omit,
|
|
288
|
+
user_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
284
289
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
285
290
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
286
291
|
extra_headers: Headers | None = None,
|
|
@@ -331,6 +336,8 @@ class AsyncMembersResource(AsyncAPIResource):
|
|
|
331
336
|
|
|
332
337
|
statuses: The statuses to filter the members by
|
|
333
338
|
|
|
339
|
+
user_ids: The user IDs to filter the members by
|
|
340
|
+
|
|
334
341
|
extra_headers: Send extra headers
|
|
335
342
|
|
|
336
343
|
extra_query: Add additional query parameters to the request
|
|
@@ -365,6 +372,7 @@ class AsyncMembersResource(AsyncAPIResource):
|
|
|
365
372
|
"promo_code_ids": promo_code_ids,
|
|
366
373
|
"query": query,
|
|
367
374
|
"statuses": statuses,
|
|
375
|
+
"user_ids": user_ids,
|
|
368
376
|
},
|
|
369
377
|
member_list_params.MemberListParams,
|
|
370
378
|
),
|
|
@@ -136,7 +136,6 @@ class MembershipsResource(SyncAPIResource):
|
|
|
136
136
|
def list(
|
|
137
137
|
self,
|
|
138
138
|
*,
|
|
139
|
-
company_id: str,
|
|
140
139
|
access_pass_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
141
140
|
after: Optional[str] | Omit = omit,
|
|
142
141
|
before: Optional[str] | Omit = omit,
|
|
@@ -154,6 +153,7 @@ class MembershipsResource(SyncAPIResource):
|
|
|
154
153
|
]
|
|
155
154
|
]
|
|
156
155
|
| Omit = omit,
|
|
156
|
+
company_id: Optional[str] | Omit = omit,
|
|
157
157
|
created_after: Union[str, datetime, None] | Omit = omit,
|
|
158
158
|
created_before: Union[str, datetime, None] | Omit = omit,
|
|
159
159
|
direction: Optional[Direction] | Omit = omit,
|
|
@@ -164,6 +164,7 @@ class MembershipsResource(SyncAPIResource):
|
|
|
164
164
|
plan_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
165
165
|
promo_code_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
166
166
|
statuses: Optional[List[MembershipStatus]] | Omit = omit,
|
|
167
|
+
user_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
167
168
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
168
169
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
169
170
|
extra_headers: Headers | None = None,
|
|
@@ -179,8 +180,6 @@ class MembershipsResource(SyncAPIResource):
|
|
|
179
180
|
- `member:basic:read`
|
|
180
181
|
|
|
181
182
|
Args:
|
|
182
|
-
company_id: The ID of the company to list memberships for
|
|
183
|
-
|
|
184
183
|
access_pass_ids: The access pass IDs to filter the memberships by
|
|
185
184
|
|
|
186
185
|
after: Returns the elements in the list that come after the specified cursor.
|
|
@@ -189,6 +188,8 @@ class MembershipsResource(SyncAPIResource):
|
|
|
189
188
|
|
|
190
189
|
cancel_options: The cancel options to filter the memberships by
|
|
191
190
|
|
|
191
|
+
company_id: The ID of the company to list memberships for
|
|
192
|
+
|
|
192
193
|
created_after: The minimum creation date to filter by
|
|
193
194
|
|
|
194
195
|
created_before: The maximum creation date to filter by
|
|
@@ -207,6 +208,8 @@ class MembershipsResource(SyncAPIResource):
|
|
|
207
208
|
|
|
208
209
|
statuses: The membership status to filter the memberships by
|
|
209
210
|
|
|
211
|
+
user_ids: Only return memberships from these whop user ids
|
|
212
|
+
|
|
210
213
|
extra_headers: Send extra headers
|
|
211
214
|
|
|
212
215
|
extra_query: Add additional query parameters to the request
|
|
@@ -225,11 +228,11 @@ class MembershipsResource(SyncAPIResource):
|
|
|
225
228
|
timeout=timeout,
|
|
226
229
|
query=maybe_transform(
|
|
227
230
|
{
|
|
228
|
-
"company_id": company_id,
|
|
229
231
|
"access_pass_ids": access_pass_ids,
|
|
230
232
|
"after": after,
|
|
231
233
|
"before": before,
|
|
232
234
|
"cancel_options": cancel_options,
|
|
235
|
+
"company_id": company_id,
|
|
233
236
|
"created_after": created_after,
|
|
234
237
|
"created_before": created_before,
|
|
235
238
|
"direction": direction,
|
|
@@ -239,6 +242,7 @@ class MembershipsResource(SyncAPIResource):
|
|
|
239
242
|
"plan_ids": plan_ids,
|
|
240
243
|
"promo_code_ids": promo_code_ids,
|
|
241
244
|
"statuses": statuses,
|
|
245
|
+
"user_ids": user_ids,
|
|
242
246
|
},
|
|
243
247
|
membership_list_params.MembershipListParams,
|
|
244
248
|
),
|
|
@@ -475,7 +479,6 @@ class AsyncMembershipsResource(AsyncAPIResource):
|
|
|
475
479
|
def list(
|
|
476
480
|
self,
|
|
477
481
|
*,
|
|
478
|
-
company_id: str,
|
|
479
482
|
access_pass_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
480
483
|
after: Optional[str] | Omit = omit,
|
|
481
484
|
before: Optional[str] | Omit = omit,
|
|
@@ -493,6 +496,7 @@ class AsyncMembershipsResource(AsyncAPIResource):
|
|
|
493
496
|
]
|
|
494
497
|
]
|
|
495
498
|
| Omit = omit,
|
|
499
|
+
company_id: Optional[str] | Omit = omit,
|
|
496
500
|
created_after: Union[str, datetime, None] | Omit = omit,
|
|
497
501
|
created_before: Union[str, datetime, None] | Omit = omit,
|
|
498
502
|
direction: Optional[Direction] | Omit = omit,
|
|
@@ -503,6 +507,7 @@ class AsyncMembershipsResource(AsyncAPIResource):
|
|
|
503
507
|
plan_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
504
508
|
promo_code_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
505
509
|
statuses: Optional[List[MembershipStatus]] | Omit = omit,
|
|
510
|
+
user_ids: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
506
511
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
507
512
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
508
513
|
extra_headers: Headers | None = None,
|
|
@@ -518,8 +523,6 @@ class AsyncMembershipsResource(AsyncAPIResource):
|
|
|
518
523
|
- `member:basic:read`
|
|
519
524
|
|
|
520
525
|
Args:
|
|
521
|
-
company_id: The ID of the company to list memberships for
|
|
522
|
-
|
|
523
526
|
access_pass_ids: The access pass IDs to filter the memberships by
|
|
524
527
|
|
|
525
528
|
after: Returns the elements in the list that come after the specified cursor.
|
|
@@ -528,6 +531,8 @@ class AsyncMembershipsResource(AsyncAPIResource):
|
|
|
528
531
|
|
|
529
532
|
cancel_options: The cancel options to filter the memberships by
|
|
530
533
|
|
|
534
|
+
company_id: The ID of the company to list memberships for
|
|
535
|
+
|
|
531
536
|
created_after: The minimum creation date to filter by
|
|
532
537
|
|
|
533
538
|
created_before: The maximum creation date to filter by
|
|
@@ -546,6 +551,8 @@ class AsyncMembershipsResource(AsyncAPIResource):
|
|
|
546
551
|
|
|
547
552
|
statuses: The membership status to filter the memberships by
|
|
548
553
|
|
|
554
|
+
user_ids: Only return memberships from these whop user ids
|
|
555
|
+
|
|
549
556
|
extra_headers: Send extra headers
|
|
550
557
|
|
|
551
558
|
extra_query: Add additional query parameters to the request
|
|
@@ -564,11 +571,11 @@ class AsyncMembershipsResource(AsyncAPIResource):
|
|
|
564
571
|
timeout=timeout,
|
|
565
572
|
query=maybe_transform(
|
|
566
573
|
{
|
|
567
|
-
"company_id": company_id,
|
|
568
574
|
"access_pass_ids": access_pass_ids,
|
|
569
575
|
"after": after,
|
|
570
576
|
"before": before,
|
|
571
577
|
"cancel_options": cancel_options,
|
|
578
|
+
"company_id": company_id,
|
|
572
579
|
"created_after": created_after,
|
|
573
580
|
"created_before": created_before,
|
|
574
581
|
"direction": direction,
|
|
@@ -578,6 +585,7 @@ class AsyncMembershipsResource(AsyncAPIResource):
|
|
|
578
585
|
"plan_ids": plan_ids,
|
|
579
586
|
"promo_code_ids": promo_code_ids,
|
|
580
587
|
"statuses": statuses,
|
|
588
|
+
"user_ids": user_ids,
|
|
581
589
|
},
|
|
582
590
|
membership_list_params.MembershipListParams,
|
|
583
591
|
),
|
whop_sdk/resources/messages.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing import Iterable, Optional
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ..types import message_list_params, message_create_params
|
|
9
|
+
from ..types import message_list_params, message_create_params, message_update_params
|
|
10
10
|
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
11
|
from .._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from .._compat import cached_property
|
|
@@ -138,6 +138,56 @@ class MessagesResource(SyncAPIResource):
|
|
|
138
138
|
cast_to=Message,
|
|
139
139
|
)
|
|
140
140
|
|
|
141
|
+
def update(
|
|
142
|
+
self,
|
|
143
|
+
id: str,
|
|
144
|
+
*,
|
|
145
|
+
attachments: Optional[Iterable[message_update_params.Attachment]] | Omit = omit,
|
|
146
|
+
content: Optional[str] | Omit = omit,
|
|
147
|
+
is_pinned: Optional[bool] | Omit = omit,
|
|
148
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
149
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
150
|
+
extra_headers: Headers | None = None,
|
|
151
|
+
extra_query: Query | None = None,
|
|
152
|
+
extra_body: Body | None = None,
|
|
153
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
154
|
+
) -> Message:
|
|
155
|
+
"""
|
|
156
|
+
Updates an existing message
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
attachments: The attachments for this message
|
|
160
|
+
|
|
161
|
+
content: The content of the message in Markdown format
|
|
162
|
+
|
|
163
|
+
is_pinned: Whether this message is pinned
|
|
164
|
+
|
|
165
|
+
extra_headers: Send extra headers
|
|
166
|
+
|
|
167
|
+
extra_query: Add additional query parameters to the request
|
|
168
|
+
|
|
169
|
+
extra_body: Add additional JSON properties to the request
|
|
170
|
+
|
|
171
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
172
|
+
"""
|
|
173
|
+
if not id:
|
|
174
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
175
|
+
return self._patch(
|
|
176
|
+
f"/messages/{id}",
|
|
177
|
+
body=maybe_transform(
|
|
178
|
+
{
|
|
179
|
+
"attachments": attachments,
|
|
180
|
+
"content": content,
|
|
181
|
+
"is_pinned": is_pinned,
|
|
182
|
+
},
|
|
183
|
+
message_update_params.MessageUpdateParams,
|
|
184
|
+
),
|
|
185
|
+
options=make_request_options(
|
|
186
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
187
|
+
),
|
|
188
|
+
cast_to=Message,
|
|
189
|
+
)
|
|
190
|
+
|
|
141
191
|
def list(
|
|
142
192
|
self,
|
|
143
193
|
*,
|
|
@@ -318,6 +368,56 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
318
368
|
cast_to=Message,
|
|
319
369
|
)
|
|
320
370
|
|
|
371
|
+
async def update(
|
|
372
|
+
self,
|
|
373
|
+
id: str,
|
|
374
|
+
*,
|
|
375
|
+
attachments: Optional[Iterable[message_update_params.Attachment]] | Omit = omit,
|
|
376
|
+
content: Optional[str] | Omit = omit,
|
|
377
|
+
is_pinned: Optional[bool] | Omit = omit,
|
|
378
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
379
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
380
|
+
extra_headers: Headers | None = None,
|
|
381
|
+
extra_query: Query | None = None,
|
|
382
|
+
extra_body: Body | None = None,
|
|
383
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
384
|
+
) -> Message:
|
|
385
|
+
"""
|
|
386
|
+
Updates an existing message
|
|
387
|
+
|
|
388
|
+
Args:
|
|
389
|
+
attachments: The attachments for this message
|
|
390
|
+
|
|
391
|
+
content: The content of the message in Markdown format
|
|
392
|
+
|
|
393
|
+
is_pinned: Whether this message is pinned
|
|
394
|
+
|
|
395
|
+
extra_headers: Send extra headers
|
|
396
|
+
|
|
397
|
+
extra_query: Add additional query parameters to the request
|
|
398
|
+
|
|
399
|
+
extra_body: Add additional JSON properties to the request
|
|
400
|
+
|
|
401
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
402
|
+
"""
|
|
403
|
+
if not id:
|
|
404
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
405
|
+
return await self._patch(
|
|
406
|
+
f"/messages/{id}",
|
|
407
|
+
body=await async_maybe_transform(
|
|
408
|
+
{
|
|
409
|
+
"attachments": attachments,
|
|
410
|
+
"content": content,
|
|
411
|
+
"is_pinned": is_pinned,
|
|
412
|
+
},
|
|
413
|
+
message_update_params.MessageUpdateParams,
|
|
414
|
+
),
|
|
415
|
+
options=make_request_options(
|
|
416
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
417
|
+
),
|
|
418
|
+
cast_to=Message,
|
|
419
|
+
)
|
|
420
|
+
|
|
321
421
|
def list(
|
|
322
422
|
self,
|
|
323
423
|
*,
|
|
@@ -396,6 +496,9 @@ class MessagesResourceWithRawResponse:
|
|
|
396
496
|
self.retrieve = to_raw_response_wrapper(
|
|
397
497
|
messages.retrieve,
|
|
398
498
|
)
|
|
499
|
+
self.update = to_raw_response_wrapper(
|
|
500
|
+
messages.update,
|
|
501
|
+
)
|
|
399
502
|
self.list = to_raw_response_wrapper(
|
|
400
503
|
messages.list,
|
|
401
504
|
)
|
|
@@ -411,6 +514,9 @@ class AsyncMessagesResourceWithRawResponse:
|
|
|
411
514
|
self.retrieve = async_to_raw_response_wrapper(
|
|
412
515
|
messages.retrieve,
|
|
413
516
|
)
|
|
517
|
+
self.update = async_to_raw_response_wrapper(
|
|
518
|
+
messages.update,
|
|
519
|
+
)
|
|
414
520
|
self.list = async_to_raw_response_wrapper(
|
|
415
521
|
messages.list,
|
|
416
522
|
)
|
|
@@ -426,6 +532,9 @@ class MessagesResourceWithStreamingResponse:
|
|
|
426
532
|
self.retrieve = to_streamed_response_wrapper(
|
|
427
533
|
messages.retrieve,
|
|
428
534
|
)
|
|
535
|
+
self.update = to_streamed_response_wrapper(
|
|
536
|
+
messages.update,
|
|
537
|
+
)
|
|
429
538
|
self.list = to_streamed_response_wrapper(
|
|
430
539
|
messages.list,
|
|
431
540
|
)
|
|
@@ -441,6 +550,9 @@ class AsyncMessagesResourceWithStreamingResponse:
|
|
|
441
550
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
442
551
|
messages.retrieve,
|
|
443
552
|
)
|
|
553
|
+
self.update = async_to_streamed_response_wrapper(
|
|
554
|
+
messages.update,
|
|
555
|
+
)
|
|
444
556
|
self.list = async_to_streamed_response_wrapper(
|
|
445
557
|
messages.list,
|
|
446
558
|
)
|