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
@@ -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
  )