whop-sdk 0.0.10__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.
Files changed (352) hide show
  1. whop_sdk/__init__.py +94 -0
  2. whop_sdk/_base_client.py +1995 -0
  3. whop_sdk/_client.py +800 -0
  4. whop_sdk/_compat.py +219 -0
  5. whop_sdk/_constants.py +14 -0
  6. whop_sdk/_exceptions.py +112 -0
  7. whop_sdk/_files.py +123 -0
  8. whop_sdk/_models.py +857 -0
  9. whop_sdk/_qs.py +150 -0
  10. whop_sdk/_resource.py +43 -0
  11. whop_sdk/_response.py +830 -0
  12. whop_sdk/_streaming.py +333 -0
  13. whop_sdk/_types.py +260 -0
  14. whop_sdk/_utils/__init__.py +64 -0
  15. whop_sdk/_utils/_compat.py +45 -0
  16. whop_sdk/_utils/_datetime_parse.py +136 -0
  17. whop_sdk/_utils/_logs.py +25 -0
  18. whop_sdk/_utils/_proxy.py +65 -0
  19. whop_sdk/_utils/_reflection.py +42 -0
  20. whop_sdk/_utils/_resources_proxy.py +24 -0
  21. whop_sdk/_utils/_streams.py +12 -0
  22. whop_sdk/_utils/_sync.py +58 -0
  23. whop_sdk/_utils/_transform.py +457 -0
  24. whop_sdk/_utils/_typing.py +156 -0
  25. whop_sdk/_utils/_utils.py +421 -0
  26. whop_sdk/_version.py +4 -0
  27. whop_sdk/lib/.keep +4 -0
  28. whop_sdk/pagination.py +61 -0
  29. whop_sdk/py.typed +0 -0
  30. whop_sdk/resources/__init__.py +540 -0
  31. whop_sdk/resources/access_tokens.py +341 -0
  32. whop_sdk/resources/account_links.py +211 -0
  33. whop_sdk/resources/app_builds.py +587 -0
  34. whop_sdk/resources/apps.py +684 -0
  35. whop_sdk/resources/authorized_users.py +353 -0
  36. whop_sdk/resources/chat_channels.py +469 -0
  37. whop_sdk/resources/checkout_configurations.py +776 -0
  38. whop_sdk/resources/companies.py +465 -0
  39. whop_sdk/resources/course_chapters.py +602 -0
  40. whop_sdk/resources/course_lesson_interactions.py +343 -0
  41. whop_sdk/resources/course_lessons.py +1040 -0
  42. whop_sdk/resources/course_students.py +327 -0
  43. whop_sdk/resources/courses.py +776 -0
  44. whop_sdk/resources/disputes.py +693 -0
  45. whop_sdk/resources/entries.py +556 -0
  46. whop_sdk/resources/experiences.py +983 -0
  47. whop_sdk/resources/forum_posts.py +656 -0
  48. whop_sdk/resources/forums.py +446 -0
  49. whop_sdk/resources/invoices.py +1099 -0
  50. whop_sdk/resources/ledger_accounts.py +171 -0
  51. whop_sdk/resources/members.py +429 -0
  52. whop_sdk/resources/memberships.py +818 -0
  53. whop_sdk/resources/messages.py +558 -0
  54. whop_sdk/resources/notifications.py +388 -0
  55. whop_sdk/resources/payment_tokens.py +359 -0
  56. whop_sdk/resources/payments.py +1040 -0
  57. whop_sdk/resources/plans.py +1001 -0
  58. whop_sdk/resources/products.py +970 -0
  59. whop_sdk/resources/promo_codes.py +668 -0
  60. whop_sdk/resources/reactions.py +423 -0
  61. whop_sdk/resources/refunds.py +347 -0
  62. whop_sdk/resources/reviews.py +332 -0
  63. whop_sdk/resources/setup_intents.py +349 -0
  64. whop_sdk/resources/shipments.py +451 -0
  65. whop_sdk/resources/support_channels.py +455 -0
  66. whop_sdk/resources/transfers.py +513 -0
  67. whop_sdk/resources/users.py +248 -0
  68. whop_sdk/resources/webhooks.py +69 -0
  69. whop_sdk/resources/withdrawals.py +341 -0
  70. whop_sdk/types/__init__.py +262 -0
  71. whop_sdk/types/access_token_create_params.py +64 -0
  72. whop_sdk/types/access_token_create_response.py +15 -0
  73. whop_sdk/types/account_link_create_params.py +27 -0
  74. whop_sdk/types/account_link_create_response.py +15 -0
  75. whop_sdk/types/app_build_create_params.py +72 -0
  76. whop_sdk/types/app_build_list_params.py +42 -0
  77. whop_sdk/types/app_build_list_response.py +50 -0
  78. whop_sdk/types/app_create_params.py +19 -0
  79. whop_sdk/types/app_list_params.py +59 -0
  80. whop_sdk/types/app_list_response.py +110 -0
  81. whop_sdk/types/app_type.py +7 -0
  82. whop_sdk/types/app_update_params.py +67 -0
  83. whop_sdk/types/assessment_question_types.py +7 -0
  84. whop_sdk/types/authorized_user_list_params.py +41 -0
  85. whop_sdk/types/authorized_user_list_response.py +33 -0
  86. whop_sdk/types/authorized_user_retrieve_response.py +33 -0
  87. whop_sdk/types/billing_reasons.py +9 -0
  88. whop_sdk/types/card_brands.py +25 -0
  89. whop_sdk/types/chat_channel_list_params.py +28 -0
  90. whop_sdk/types/chat_channel_list_response.py +43 -0
  91. whop_sdk/types/chat_channel_update_params.py +32 -0
  92. whop_sdk/types/checkout_configuration_create_params.py +373 -0
  93. whop_sdk/types/checkout_configuration_list_params.py +41 -0
  94. whop_sdk/types/checkout_configuration_list_response.py +104 -0
  95. whop_sdk/types/checkout_modes.py +7 -0
  96. whop_sdk/types/company_create_params.py +22 -0
  97. whop_sdk/types/company_list_params.py +38 -0
  98. whop_sdk/types/company_list_response.py +76 -0
  99. whop_sdk/types/course.py +122 -0
  100. whop_sdk/types/course_chapter.py +32 -0
  101. whop_sdk/types/course_chapter_create_params.py +16 -0
  102. whop_sdk/types/course_chapter_delete_response.py +7 -0
  103. whop_sdk/types/course_chapter_list_params.py +25 -0
  104. whop_sdk/types/course_chapter_list_response.py +16 -0
  105. whop_sdk/types/course_chapter_update_params.py +12 -0
  106. whop_sdk/types/course_create_params.py +78 -0
  107. whop_sdk/types/course_delete_response.py +7 -0
  108. whop_sdk/types/course_lesson_create_params.py +63 -0
  109. whop_sdk/types/course_lesson_delete_response.py +7 -0
  110. whop_sdk/types/course_lesson_interaction_completed_webhook_event.py +26 -0
  111. whop_sdk/types/course_lesson_interaction_list_params.py +34 -0
  112. whop_sdk/types/course_lesson_list_params.py +28 -0
  113. whop_sdk/types/course_lesson_list_response.py +57 -0
  114. whop_sdk/types/course_lesson_mark_as_completed_response.py +7 -0
  115. whop_sdk/types/course_lesson_start_response.py +7 -0
  116. whop_sdk/types/course_lesson_submit_assessment_params.py +26 -0
  117. whop_sdk/types/course_lesson_submit_assessment_response.py +62 -0
  118. whop_sdk/types/course_lesson_update_params.py +222 -0
  119. whop_sdk/types/course_list_params.py +28 -0
  120. whop_sdk/types/course_list_response.py +90 -0
  121. whop_sdk/types/course_student_list_params.py +28 -0
  122. whop_sdk/types/course_student_list_response.py +42 -0
  123. whop_sdk/types/course_student_retrieve_response.py +61 -0
  124. whop_sdk/types/course_update_params.py +114 -0
  125. whop_sdk/types/course_visibilities.py +7 -0
  126. whop_sdk/types/dispute.py +284 -0
  127. whop_sdk/types/dispute_created_webhook_event.py +26 -0
  128. whop_sdk/types/dispute_list_params.py +38 -0
  129. whop_sdk/types/dispute_list_response.py +77 -0
  130. whop_sdk/types/dispute_statuses.py +17 -0
  131. whop_sdk/types/dispute_update_evidence_params.py +159 -0
  132. whop_sdk/types/dispute_updated_webhook_event.py +26 -0
  133. whop_sdk/types/embed_type.py +7 -0
  134. whop_sdk/types/entry_approve_response.py +10 -0
  135. whop_sdk/types/entry_approved_webhook_event.py +26 -0
  136. whop_sdk/types/entry_created_webhook_event.py +26 -0
  137. whop_sdk/types/entry_deleted_webhook_event.py +26 -0
  138. whop_sdk/types/entry_denied_webhook_event.py +26 -0
  139. whop_sdk/types/entry_list_params.py +52 -0
  140. whop_sdk/types/entry_list_response.py +56 -0
  141. whop_sdk/types/experience_attach_params.py +12 -0
  142. whop_sdk/types/experience_create_params.py +22 -0
  143. whop_sdk/types/experience_delete_response.py +7 -0
  144. whop_sdk/types/experience_detach_params.py +12 -0
  145. whop_sdk/types/experience_duplicate_params.py +13 -0
  146. whop_sdk/types/experience_list_params.py +40 -0
  147. whop_sdk/types/experience_list_response.py +73 -0
  148. whop_sdk/types/experience_update_params.py +46 -0
  149. whop_sdk/types/forum_list_params.py +28 -0
  150. whop_sdk/types/forum_list_response.py +33 -0
  151. whop_sdk/types/forum_post_create_params.py +101 -0
  152. whop_sdk/types/forum_post_list_params.py +31 -0
  153. whop_sdk/types/forum_post_list_response.py +60 -0
  154. whop_sdk/types/forum_post_update_params.py +56 -0
  155. whop_sdk/types/forum_post_visibility_type.py +7 -0
  156. whop_sdk/types/forum_update_params.py +23 -0
  157. whop_sdk/types/invoice_create_params.py +515 -0
  158. whop_sdk/types/invoice_created_webhook_event.py +26 -0
  159. whop_sdk/types/invoice_list_params.py +53 -0
  160. whop_sdk/types/invoice_paid_webhook_event.py +26 -0
  161. whop_sdk/types/invoice_past_due_webhook_event.py +26 -0
  162. whop_sdk/types/invoice_void_response.py +7 -0
  163. whop_sdk/types/invoice_voided_webhook_event.py +26 -0
  164. whop_sdk/types/languages.py +30 -0
  165. whop_sdk/types/ledger_account_retrieve_response.py +93 -0
  166. whop_sdk/types/lesson.py +219 -0
  167. whop_sdk/types/lesson_types.py +7 -0
  168. whop_sdk/types/lesson_visibilities.py +7 -0
  169. whop_sdk/types/member_list_params.py +73 -0
  170. whop_sdk/types/member_list_response.py +65 -0
  171. whop_sdk/types/member_retrieve_response.py +79 -0
  172. whop_sdk/types/membership_activated_webhook_event.py +29 -0
  173. whop_sdk/types/membership_cancel_params.py +13 -0
  174. whop_sdk/types/membership_deactivated_webhook_event.py +29 -0
  175. whop_sdk/types/membership_list_params.py +73 -0
  176. whop_sdk/types/membership_list_response.py +128 -0
  177. whop_sdk/types/membership_pause_params.py +16 -0
  178. whop_sdk/types/membership_update_params.py +13 -0
  179. whop_sdk/types/message_create_params.py +63 -0
  180. whop_sdk/types/message_list_params.py +30 -0
  181. whop_sdk/types/message_list_response.py +90 -0
  182. whop_sdk/types/message_update_params.py +45 -0
  183. whop_sdk/types/notification_create_params.py +93 -0
  184. whop_sdk/types/notification_create_response.py +10 -0
  185. whop_sdk/types/payment_create_params.py +162 -0
  186. whop_sdk/types/payment_failed_webhook_event.py +26 -0
  187. whop_sdk/types/payment_list_params.py +67 -0
  188. whop_sdk/types/payment_list_response.py +273 -0
  189. whop_sdk/types/payment_method_types.py +94 -0
  190. whop_sdk/types/payment_pending_webhook_event.py +26 -0
  191. whop_sdk/types/payment_provider.py +9 -0
  192. whop_sdk/types/payment_refund_params.py +13 -0
  193. whop_sdk/types/payment_succeeded_webhook_event.py +26 -0
  194. whop_sdk/types/payment_token_list_params.py +38 -0
  195. whop_sdk/types/payment_token_list_response.py +41 -0
  196. whop_sdk/types/payment_token_retrieve_params.py +12 -0
  197. whop_sdk/types/payment_token_retrieve_response.py +41 -0
  198. whop_sdk/types/plan_create_params.py +162 -0
  199. whop_sdk/types/plan_delete_response.py +7 -0
  200. whop_sdk/types/plan_list_params.py +57 -0
  201. whop_sdk/types/plan_list_response.py +128 -0
  202. whop_sdk/types/plan_update_params.py +155 -0
  203. whop_sdk/types/product_create_params.py +147 -0
  204. whop_sdk/types/product_delete_response.py +7 -0
  205. whop_sdk/types/product_list_params.py +49 -0
  206. whop_sdk/types/product_update_params.py +82 -0
  207. whop_sdk/types/promo_code.py +90 -0
  208. whop_sdk/types/promo_code_create_params.py +70 -0
  209. whop_sdk/types/promo_code_delete_response.py +7 -0
  210. whop_sdk/types/promo_code_list_params.py +45 -0
  211. whop_sdk/types/promo_code_list_response.py +79 -0
  212. whop_sdk/types/promo_code_status.py +7 -0
  213. whop_sdk/types/promo_duration.py +7 -0
  214. whop_sdk/types/reaction_create_params.py +19 -0
  215. whop_sdk/types/reaction_list_params.py +25 -0
  216. whop_sdk/types/reaction_list_response.py +32 -0
  217. whop_sdk/types/refund_created_webhook_event.py +154 -0
  218. whop_sdk/types/refund_list_params.py +38 -0
  219. whop_sdk/types/refund_list_response.py +53 -0
  220. whop_sdk/types/refund_reference_status.py +7 -0
  221. whop_sdk/types/refund_reference_type.py +9 -0
  222. whop_sdk/types/refund_retrieve_response.py +129 -0
  223. whop_sdk/types/refund_status.py +7 -0
  224. whop_sdk/types/refund_updated_webhook_event.py +154 -0
  225. whop_sdk/types/review_list_params.py +40 -0
  226. whop_sdk/types/review_list_response.py +78 -0
  227. whop_sdk/types/review_retrieve_response.py +103 -0
  228. whop_sdk/types/review_status.py +7 -0
  229. whop_sdk/types/setup_intent.py +111 -0
  230. whop_sdk/types/setup_intent_canceled_webhook_event.py +29 -0
  231. whop_sdk/types/setup_intent_list_params.py +38 -0
  232. whop_sdk/types/setup_intent_list_response.py +111 -0
  233. whop_sdk/types/setup_intent_requires_action_webhook_event.py +29 -0
  234. whop_sdk/types/setup_intent_status.py +7 -0
  235. whop_sdk/types/setup_intent_succeeded_webhook_event.py +29 -0
  236. whop_sdk/types/shared/__init__.py +62 -0
  237. whop_sdk/types/shared/access_level.py +7 -0
  238. whop_sdk/types/shared/access_pass_type.py +7 -0
  239. whop_sdk/types/shared/app.py +187 -0
  240. whop_sdk/types/shared/app_build.py +50 -0
  241. whop_sdk/types/shared/app_build_platforms.py +7 -0
  242. whop_sdk/types/shared/app_build_statuses.py +7 -0
  243. whop_sdk/types/shared/app_statuses.py +7 -0
  244. whop_sdk/types/shared/app_view_type.py +7 -0
  245. whop_sdk/types/shared/authorized_user_roles.py +9 -0
  246. whop_sdk/types/shared/business_types.py +22 -0
  247. whop_sdk/types/shared/chat_channel.py +43 -0
  248. whop_sdk/types/shared/checkout_configuration.py +104 -0
  249. whop_sdk/types/shared/collection_method.py +7 -0
  250. whop_sdk/types/shared/company.py +91 -0
  251. whop_sdk/types/shared/course_lesson_interaction.py +63 -0
  252. whop_sdk/types/shared/course_lesson_interaction_list_item.py +44 -0
  253. whop_sdk/types/shared/currency.py +93 -0
  254. whop_sdk/types/shared/custom_cta.py +21 -0
  255. whop_sdk/types/shared/direction.py +7 -0
  256. whop_sdk/types/shared/dms_post_types.py +7 -0
  257. whop_sdk/types/shared/email_notification_preferences.py +7 -0
  258. whop_sdk/types/shared/entry.py +70 -0
  259. whop_sdk/types/shared/entry_status.py +7 -0
  260. whop_sdk/types/shared/experience.py +91 -0
  261. whop_sdk/types/shared/forum.py +33 -0
  262. whop_sdk/types/shared/forum_post.py +60 -0
  263. whop_sdk/types/shared/friendly_receipt_status.py +24 -0
  264. whop_sdk/types/shared/global_affiliate_status.py +7 -0
  265. whop_sdk/types/shared/industry_types.py +67 -0
  266. whop_sdk/types/shared/invoice.py +64 -0
  267. whop_sdk/types/shared/invoice_list_item.py +64 -0
  268. whop_sdk/types/shared/invoice_status.py +7 -0
  269. whop_sdk/types/shared/member_most_recent_actions.py +22 -0
  270. whop_sdk/types/shared/member_statuses.py +7 -0
  271. whop_sdk/types/shared/membership.py +128 -0
  272. whop_sdk/types/shared/membership_status.py +9 -0
  273. whop_sdk/types/shared/message.py +90 -0
  274. whop_sdk/types/shared/page_info.py +21 -0
  275. whop_sdk/types/shared/payment.py +273 -0
  276. whop_sdk/types/shared/plan.py +159 -0
  277. whop_sdk/types/shared/plan_type.py +7 -0
  278. whop_sdk/types/shared/product.py +132 -0
  279. whop_sdk/types/shared/product_list_item.py +57 -0
  280. whop_sdk/types/shared/promo_type.py +7 -0
  281. whop_sdk/types/shared/reaction.py +32 -0
  282. whop_sdk/types/shared/receipt_status.py +7 -0
  283. whop_sdk/types/shared/release_method.py +7 -0
  284. whop_sdk/types/shared/shipment.py +48 -0
  285. whop_sdk/types/shared/shipment_carrier.py +84 -0
  286. whop_sdk/types/shared/shipment_status.py +18 -0
  287. whop_sdk/types/shared/shipment_substatus.py +36 -0
  288. whop_sdk/types/shared/support_channel.py +39 -0
  289. whop_sdk/types/shared/tax_type.py +7 -0
  290. whop_sdk/types/shared/transfer.py +112 -0
  291. whop_sdk/types/shared/visibility.py +7 -0
  292. whop_sdk/types/shared/visibility_filter.py +9 -0
  293. whop_sdk/types/shared/who_can_comment_types.py +7 -0
  294. whop_sdk/types/shared/who_can_post.py +7 -0
  295. whop_sdk/types/shared/who_can_post_types.py +7 -0
  296. whop_sdk/types/shared/who_can_react.py +7 -0
  297. whop_sdk/types/shared_params/__init__.py +34 -0
  298. whop_sdk/types/shared_params/access_level.py +9 -0
  299. whop_sdk/types/shared_params/access_pass_type.py +9 -0
  300. whop_sdk/types/shared_params/app_build_platforms.py +9 -0
  301. whop_sdk/types/shared_params/app_build_statuses.py +9 -0
  302. whop_sdk/types/shared_params/app_statuses.py +9 -0
  303. whop_sdk/types/shared_params/app_view_type.py +9 -0
  304. whop_sdk/types/shared_params/authorized_user_roles.py +11 -0
  305. whop_sdk/types/shared_params/business_types.py +24 -0
  306. whop_sdk/types/shared_params/collection_method.py +9 -0
  307. whop_sdk/types/shared_params/currency.py +95 -0
  308. whop_sdk/types/shared_params/custom_cta.py +23 -0
  309. whop_sdk/types/shared_params/direction.py +9 -0
  310. whop_sdk/types/shared_params/email_notification_preferences.py +9 -0
  311. whop_sdk/types/shared_params/entry_status.py +9 -0
  312. whop_sdk/types/shared_params/friendly_receipt_status.py +26 -0
  313. whop_sdk/types/shared_params/global_affiliate_status.py +9 -0
  314. whop_sdk/types/shared_params/industry_types.py +69 -0
  315. whop_sdk/types/shared_params/invoice_status.py +9 -0
  316. whop_sdk/types/shared_params/member_most_recent_actions.py +24 -0
  317. whop_sdk/types/shared_params/member_statuses.py +9 -0
  318. whop_sdk/types/shared_params/membership_status.py +11 -0
  319. whop_sdk/types/shared_params/plan_type.py +9 -0
  320. whop_sdk/types/shared_params/promo_type.py +9 -0
  321. whop_sdk/types/shared_params/receipt_status.py +9 -0
  322. whop_sdk/types/shared_params/release_method.py +9 -0
  323. whop_sdk/types/shared_params/tax_type.py +9 -0
  324. whop_sdk/types/shared_params/visibility.py +9 -0
  325. whop_sdk/types/shared_params/visibility_filter.py +11 -0
  326. whop_sdk/types/shared_params/who_can_comment_types.py +9 -0
  327. whop_sdk/types/shared_params/who_can_post.py +9 -0
  328. whop_sdk/types/shared_params/who_can_post_types.py +9 -0
  329. whop_sdk/types/shared_params/who_can_react.py +9 -0
  330. whop_sdk/types/shipment_create_params.py +18 -0
  331. whop_sdk/types/shipment_list_params.py +31 -0
  332. whop_sdk/types/shipment_list_response.py +48 -0
  333. whop_sdk/types/support_channel_create_params.py +15 -0
  334. whop_sdk/types/support_channel_list_params.py +40 -0
  335. whop_sdk/types/support_channel_list_response.py +39 -0
  336. whop_sdk/types/transfer_create_params.py +39 -0
  337. whop_sdk/types/transfer_list_params.py +50 -0
  338. whop_sdk/types/transfer_list_response.py +38 -0
  339. whop_sdk/types/unwrap_webhook_event.py +52 -0
  340. whop_sdk/types/user_check_access_response.py +14 -0
  341. whop_sdk/types/user_retrieve_response.py +36 -0
  342. whop_sdk/types/withdrawal_fee_types.py +7 -0
  343. whop_sdk/types/withdrawal_list_params.py +38 -0
  344. whop_sdk/types/withdrawal_list_response.py +45 -0
  345. whop_sdk/types/withdrawal_retrieve_response.py +154 -0
  346. whop_sdk/types/withdrawal_speeds.py +7 -0
  347. whop_sdk/types/withdrawal_status.py +9 -0
  348. whop_sdk/types/withdrawal_types.py +7 -0
  349. whop_sdk-0.0.10.dist-info/METADATA +509 -0
  350. whop_sdk-0.0.10.dist-info/RECORD +352 -0
  351. whop_sdk-0.0.10.dist-info/WHEEL +4 -0
  352. whop_sdk-0.0.10.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,983 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union, Optional
6
+ from datetime import datetime
7
+ from typing_extensions import Literal
8
+
9
+ import httpx
10
+
11
+ from ..types import (
12
+ experience_list_params,
13
+ experience_attach_params,
14
+ experience_create_params,
15
+ experience_detach_params,
16
+ experience_update_params,
17
+ experience_duplicate_params,
18
+ )
19
+ from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
20
+ from .._utils import maybe_transform, async_maybe_transform
21
+ from .._compat import cached_property
22
+ from .._resource import SyncAPIResource, AsyncAPIResource
23
+ from .._response import (
24
+ to_raw_response_wrapper,
25
+ to_streamed_response_wrapper,
26
+ async_to_raw_response_wrapper,
27
+ async_to_streamed_response_wrapper,
28
+ )
29
+ from ..pagination import SyncCursorPage, AsyncCursorPage
30
+ from .._base_client import AsyncPaginator, make_request_options
31
+ from ..types.shared.experience import Experience
32
+ from ..types.experience_list_response import ExperienceListResponse
33
+ from ..types.experience_delete_response import ExperienceDeleteResponse
34
+
35
+ __all__ = ["ExperiencesResource", "AsyncExperiencesResource"]
36
+
37
+
38
+ class ExperiencesResource(SyncAPIResource):
39
+ @cached_property
40
+ def with_raw_response(self) -> ExperiencesResourceWithRawResponse:
41
+ """
42
+ This property can be used as a prefix for any HTTP method call to return
43
+ the raw response object instead of the parsed content.
44
+
45
+ For more information, see https://www.github.com/whopio/whopsdk-python#accessing-raw-response-data-eg-headers
46
+ """
47
+ return ExperiencesResourceWithRawResponse(self)
48
+
49
+ @cached_property
50
+ def with_streaming_response(self) -> ExperiencesResourceWithStreamingResponse:
51
+ """
52
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
53
+
54
+ For more information, see https://www.github.com/whopio/whopsdk-python#with_streaming_response
55
+ """
56
+ return ExperiencesResourceWithStreamingResponse(self)
57
+
58
+ def create(
59
+ self,
60
+ *,
61
+ app_id: str,
62
+ company_id: str,
63
+ name: Optional[str] | Omit = omit,
64
+ section_id: Optional[str] | Omit = omit,
65
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
66
+ # The extra values given here take precedence over values defined on the client or passed to this method.
67
+ extra_headers: Headers | None = None,
68
+ extra_query: Query | None = None,
69
+ extra_body: Body | None = None,
70
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
71
+ ) -> Experience:
72
+ """
73
+ Required permissions:
74
+
75
+ - `experience:create`
76
+
77
+ Args:
78
+ app_id: The ID of the app to create the experience for
79
+
80
+ company_id: The ID of the company to create the experience for
81
+
82
+ name: The name of the experience
83
+
84
+ section_id: The ID of the section to create the experience in
85
+
86
+ extra_headers: Send extra headers
87
+
88
+ extra_query: Add additional query parameters to the request
89
+
90
+ extra_body: Add additional JSON properties to the request
91
+
92
+ timeout: Override the client-level default timeout for this request, in seconds
93
+ """
94
+ return self._post(
95
+ "/experiences",
96
+ body=maybe_transform(
97
+ {
98
+ "app_id": app_id,
99
+ "company_id": company_id,
100
+ "name": name,
101
+ "section_id": section_id,
102
+ },
103
+ experience_create_params.ExperienceCreateParams,
104
+ ),
105
+ options=make_request_options(
106
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
107
+ ),
108
+ cast_to=Experience,
109
+ )
110
+
111
+ def retrieve(
112
+ self,
113
+ id: str,
114
+ *,
115
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
116
+ # The extra values given here take precedence over values defined on the client or passed to this method.
117
+ extra_headers: Headers | None = None,
118
+ extra_query: Query | None = None,
119
+ extra_body: Body | None = None,
120
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
121
+ ) -> Experience:
122
+ """
123
+ Retrieves an experience by ID
124
+
125
+ Args:
126
+ extra_headers: Send extra headers
127
+
128
+ extra_query: Add additional query parameters to the request
129
+
130
+ extra_body: Add additional JSON properties to the request
131
+
132
+ timeout: Override the client-level default timeout for this request, in seconds
133
+ """
134
+ if not id:
135
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
136
+ return self._get(
137
+ f"/experiences/{id}",
138
+ options=make_request_options(
139
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
140
+ ),
141
+ cast_to=Experience,
142
+ )
143
+
144
+ def update(
145
+ self,
146
+ id: str,
147
+ *,
148
+ access_level: Optional[Literal["public", "private"]] | Omit = omit,
149
+ logo: Optional[experience_update_params.Logo] | Omit = omit,
150
+ name: Optional[str] | Omit = omit,
151
+ order: Optional[str] | Omit = omit,
152
+ section_id: Optional[str] | Omit = omit,
153
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
154
+ # The extra values given here take precedence over values defined on the client or passed to this method.
155
+ extra_headers: Headers | None = None,
156
+ extra_query: Query | None = None,
157
+ extra_body: Body | None = None,
158
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
159
+ ) -> Experience:
160
+ """
161
+ Required permissions:
162
+
163
+ - `experience:update`
164
+
165
+ Args:
166
+ access_level: The different access levels for experiences (PUBLIC IS NEVER USED ANYMORE).
167
+
168
+ logo: The logo for the experience
169
+
170
+ name: The name of the experience.
171
+
172
+ order: The order of the experience in the section.
173
+
174
+ section_id: The ID of the section to update.
175
+
176
+ extra_headers: Send extra headers
177
+
178
+ extra_query: Add additional query parameters to the request
179
+
180
+ extra_body: Add additional JSON properties to the request
181
+
182
+ timeout: Override the client-level default timeout for this request, in seconds
183
+ """
184
+ if not id:
185
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
186
+ return self._patch(
187
+ f"/experiences/{id}",
188
+ body=maybe_transform(
189
+ {
190
+ "access_level": access_level,
191
+ "logo": logo,
192
+ "name": name,
193
+ "order": order,
194
+ "section_id": section_id,
195
+ },
196
+ experience_update_params.ExperienceUpdateParams,
197
+ ),
198
+ options=make_request_options(
199
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
200
+ ),
201
+ cast_to=Experience,
202
+ )
203
+
204
+ def list(
205
+ self,
206
+ *,
207
+ company_id: str,
208
+ after: Optional[str] | Omit = omit,
209
+ app_id: Optional[str] | Omit = omit,
210
+ before: Optional[str] | Omit = omit,
211
+ created_after: Union[str, datetime, None] | Omit = omit,
212
+ created_before: Union[str, datetime, None] | Omit = omit,
213
+ first: Optional[int] | Omit = omit,
214
+ last: Optional[int] | Omit = omit,
215
+ product_id: Optional[str] | Omit = omit,
216
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
217
+ # The extra values given here take precedence over values defined on the client or passed to this method.
218
+ extra_headers: Headers | None = None,
219
+ extra_query: Query | None = None,
220
+ extra_body: Body | None = None,
221
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
222
+ ) -> SyncCursorPage[ExperienceListResponse]:
223
+ """
224
+ Lists experiences for a company
225
+
226
+ Required permissions:
227
+
228
+ - `experience:hidden_experience:read`
229
+
230
+ Args:
231
+ company_id: The ID of the company to filter experiences by
232
+
233
+ after: Returns the elements in the list that come after the specified cursor.
234
+
235
+ app_id: The ID of the app to filter experiences by
236
+
237
+ before: Returns the elements in the list that come before the specified cursor.
238
+
239
+ created_after: The minimum creation date to filter by
240
+
241
+ created_before: The maximum creation date to filter by
242
+
243
+ first: Returns the first _n_ elements from the list.
244
+
245
+ last: Returns the last _n_ elements from the list.
246
+
247
+ product_id: The ID of the product to filter experiences by
248
+
249
+ extra_headers: Send extra headers
250
+
251
+ extra_query: Add additional query parameters to the request
252
+
253
+ extra_body: Add additional JSON properties to the request
254
+
255
+ timeout: Override the client-level default timeout for this request, in seconds
256
+ """
257
+ return self._get_api_list(
258
+ "/experiences",
259
+ page=SyncCursorPage[ExperienceListResponse],
260
+ options=make_request_options(
261
+ extra_headers=extra_headers,
262
+ extra_query=extra_query,
263
+ extra_body=extra_body,
264
+ timeout=timeout,
265
+ query=maybe_transform(
266
+ {
267
+ "company_id": company_id,
268
+ "after": after,
269
+ "app_id": app_id,
270
+ "before": before,
271
+ "created_after": created_after,
272
+ "created_before": created_before,
273
+ "first": first,
274
+ "last": last,
275
+ "product_id": product_id,
276
+ },
277
+ experience_list_params.ExperienceListParams,
278
+ ),
279
+ ),
280
+ model=ExperienceListResponse,
281
+ )
282
+
283
+ def delete(
284
+ self,
285
+ id: str,
286
+ *,
287
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
288
+ # The extra values given here take precedence over values defined on the client or passed to this method.
289
+ extra_headers: Headers | None = None,
290
+ extra_query: Query | None = None,
291
+ extra_body: Body | None = None,
292
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
293
+ ) -> ExperienceDeleteResponse:
294
+ """
295
+ Required permissions:
296
+
297
+ - `experience:delete`
298
+
299
+ Args:
300
+ extra_headers: Send extra headers
301
+
302
+ extra_query: Add additional query parameters to the request
303
+
304
+ extra_body: Add additional JSON properties to the request
305
+
306
+ timeout: Override the client-level default timeout for this request, in seconds
307
+ """
308
+ if not id:
309
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
310
+ return self._delete(
311
+ f"/experiences/{id}",
312
+ options=make_request_options(
313
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
314
+ ),
315
+ cast_to=ExperienceDeleteResponse,
316
+ )
317
+
318
+ def attach(
319
+ self,
320
+ id: str,
321
+ *,
322
+ product_id: str,
323
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
324
+ # The extra values given here take precedence over values defined on the client or passed to this method.
325
+ extra_headers: Headers | None = None,
326
+ extra_query: Query | None = None,
327
+ extra_body: Body | None = None,
328
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
329
+ ) -> Experience:
330
+ """
331
+ Adds an experience to an product, making it accessible to the product's
332
+ customers.
333
+
334
+ Required permissions:
335
+
336
+ - `experience:attach`
337
+
338
+ Args:
339
+ product_id: The ID of the Access Pass to add the Experience to.
340
+
341
+ extra_headers: Send extra headers
342
+
343
+ extra_query: Add additional query parameters to the request
344
+
345
+ extra_body: Add additional JSON properties to the request
346
+
347
+ timeout: Override the client-level default timeout for this request, in seconds
348
+ """
349
+ if not id:
350
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
351
+ return self._post(
352
+ f"/experiences/{id}/attach",
353
+ body=maybe_transform({"product_id": product_id}, experience_attach_params.ExperienceAttachParams),
354
+ options=make_request_options(
355
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
356
+ ),
357
+ cast_to=Experience,
358
+ )
359
+
360
+ def detach(
361
+ self,
362
+ id: str,
363
+ *,
364
+ product_id: str,
365
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
366
+ # The extra values given here take precedence over values defined on the client or passed to this method.
367
+ extra_headers: Headers | None = None,
368
+ extra_query: Query | None = None,
369
+ extra_body: Body | None = None,
370
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
371
+ ) -> Experience:
372
+ """
373
+ Removes an experience from an product, making it inaccessible to the product's
374
+ customers.
375
+
376
+ Required permissions:
377
+
378
+ - `experience:detach`
379
+
380
+ Args:
381
+ product_id: The ID of the Access Pass to add the Experience to.
382
+
383
+ extra_headers: Send extra headers
384
+
385
+ extra_query: Add additional query parameters to the request
386
+
387
+ extra_body: Add additional JSON properties to the request
388
+
389
+ timeout: Override the client-level default timeout for this request, in seconds
390
+ """
391
+ if not id:
392
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
393
+ return self._post(
394
+ f"/experiences/{id}/detach",
395
+ body=maybe_transform({"product_id": product_id}, experience_detach_params.ExperienceDetachParams),
396
+ options=make_request_options(
397
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
398
+ ),
399
+ cast_to=Experience,
400
+ )
401
+
402
+ def duplicate(
403
+ self,
404
+ id: str,
405
+ *,
406
+ name: Optional[str] | Omit = omit,
407
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
408
+ # The extra values given here take precedence over values defined on the client or passed to this method.
409
+ extra_headers: Headers | None = None,
410
+ extra_query: Query | None = None,
411
+ extra_body: Body | None = None,
412
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
413
+ ) -> Experience:
414
+ """Duplicates an existing experience.
415
+
416
+ The name will be copied, unless provided. The
417
+ new experience will be attached to the same products as the original experience.
418
+ If duplicating a Forum or Chat experience, the new experience will have the same
419
+ settings as the original experience, e.g. who can post, who can comment, etc. No
420
+ content, e.g. posts, messages, lessons from within the original experience will
421
+ be copied.
422
+
423
+ Required permissions:
424
+
425
+ - `experience:create`
426
+
427
+ Args:
428
+ name: The name of the new experience
429
+
430
+ extra_headers: Send extra headers
431
+
432
+ extra_query: Add additional query parameters to the request
433
+
434
+ extra_body: Add additional JSON properties to the request
435
+
436
+ timeout: Override the client-level default timeout for this request, in seconds
437
+ """
438
+ if not id:
439
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
440
+ return self._post(
441
+ f"/experiences/{id}/duplicate",
442
+ body=maybe_transform({"name": name}, experience_duplicate_params.ExperienceDuplicateParams),
443
+ options=make_request_options(
444
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
445
+ ),
446
+ cast_to=Experience,
447
+ )
448
+
449
+
450
+ class AsyncExperiencesResource(AsyncAPIResource):
451
+ @cached_property
452
+ def with_raw_response(self) -> AsyncExperiencesResourceWithRawResponse:
453
+ """
454
+ This property can be used as a prefix for any HTTP method call to return
455
+ the raw response object instead of the parsed content.
456
+
457
+ For more information, see https://www.github.com/whopio/whopsdk-python#accessing-raw-response-data-eg-headers
458
+ """
459
+ return AsyncExperiencesResourceWithRawResponse(self)
460
+
461
+ @cached_property
462
+ def with_streaming_response(self) -> AsyncExperiencesResourceWithStreamingResponse:
463
+ """
464
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
465
+
466
+ For more information, see https://www.github.com/whopio/whopsdk-python#with_streaming_response
467
+ """
468
+ return AsyncExperiencesResourceWithStreamingResponse(self)
469
+
470
+ async def create(
471
+ self,
472
+ *,
473
+ app_id: str,
474
+ company_id: str,
475
+ name: Optional[str] | Omit = omit,
476
+ section_id: Optional[str] | Omit = omit,
477
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
478
+ # The extra values given here take precedence over values defined on the client or passed to this method.
479
+ extra_headers: Headers | None = None,
480
+ extra_query: Query | None = None,
481
+ extra_body: Body | None = None,
482
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
483
+ ) -> Experience:
484
+ """
485
+ Required permissions:
486
+
487
+ - `experience:create`
488
+
489
+ Args:
490
+ app_id: The ID of the app to create the experience for
491
+
492
+ company_id: The ID of the company to create the experience for
493
+
494
+ name: The name of the experience
495
+
496
+ section_id: The ID of the section to create the experience in
497
+
498
+ extra_headers: Send extra headers
499
+
500
+ extra_query: Add additional query parameters to the request
501
+
502
+ extra_body: Add additional JSON properties to the request
503
+
504
+ timeout: Override the client-level default timeout for this request, in seconds
505
+ """
506
+ return await self._post(
507
+ "/experiences",
508
+ body=await async_maybe_transform(
509
+ {
510
+ "app_id": app_id,
511
+ "company_id": company_id,
512
+ "name": name,
513
+ "section_id": section_id,
514
+ },
515
+ experience_create_params.ExperienceCreateParams,
516
+ ),
517
+ options=make_request_options(
518
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
519
+ ),
520
+ cast_to=Experience,
521
+ )
522
+
523
+ async def retrieve(
524
+ self,
525
+ id: str,
526
+ *,
527
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
528
+ # The extra values given here take precedence over values defined on the client or passed to this method.
529
+ extra_headers: Headers | None = None,
530
+ extra_query: Query | None = None,
531
+ extra_body: Body | None = None,
532
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
533
+ ) -> Experience:
534
+ """
535
+ Retrieves an experience by ID
536
+
537
+ Args:
538
+ extra_headers: Send extra headers
539
+
540
+ extra_query: Add additional query parameters to the request
541
+
542
+ extra_body: Add additional JSON properties to the request
543
+
544
+ timeout: Override the client-level default timeout for this request, in seconds
545
+ """
546
+ if not id:
547
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
548
+ return await self._get(
549
+ f"/experiences/{id}",
550
+ options=make_request_options(
551
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
552
+ ),
553
+ cast_to=Experience,
554
+ )
555
+
556
+ async def update(
557
+ self,
558
+ id: str,
559
+ *,
560
+ access_level: Optional[Literal["public", "private"]] | Omit = omit,
561
+ logo: Optional[experience_update_params.Logo] | Omit = omit,
562
+ name: Optional[str] | Omit = omit,
563
+ order: Optional[str] | Omit = omit,
564
+ section_id: Optional[str] | Omit = omit,
565
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
566
+ # The extra values given here take precedence over values defined on the client or passed to this method.
567
+ extra_headers: Headers | None = None,
568
+ extra_query: Query | None = None,
569
+ extra_body: Body | None = None,
570
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
571
+ ) -> Experience:
572
+ """
573
+ Required permissions:
574
+
575
+ - `experience:update`
576
+
577
+ Args:
578
+ access_level: The different access levels for experiences (PUBLIC IS NEVER USED ANYMORE).
579
+
580
+ logo: The logo for the experience
581
+
582
+ name: The name of the experience.
583
+
584
+ order: The order of the experience in the section.
585
+
586
+ section_id: The ID of the section to update.
587
+
588
+ extra_headers: Send extra headers
589
+
590
+ extra_query: Add additional query parameters to the request
591
+
592
+ extra_body: Add additional JSON properties to the request
593
+
594
+ timeout: Override the client-level default timeout for this request, in seconds
595
+ """
596
+ if not id:
597
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
598
+ return await self._patch(
599
+ f"/experiences/{id}",
600
+ body=await async_maybe_transform(
601
+ {
602
+ "access_level": access_level,
603
+ "logo": logo,
604
+ "name": name,
605
+ "order": order,
606
+ "section_id": section_id,
607
+ },
608
+ experience_update_params.ExperienceUpdateParams,
609
+ ),
610
+ options=make_request_options(
611
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
612
+ ),
613
+ cast_to=Experience,
614
+ )
615
+
616
+ def list(
617
+ self,
618
+ *,
619
+ company_id: str,
620
+ after: Optional[str] | Omit = omit,
621
+ app_id: Optional[str] | Omit = omit,
622
+ before: Optional[str] | Omit = omit,
623
+ created_after: Union[str, datetime, None] | Omit = omit,
624
+ created_before: Union[str, datetime, None] | Omit = omit,
625
+ first: Optional[int] | Omit = omit,
626
+ last: Optional[int] | Omit = omit,
627
+ product_id: Optional[str] | Omit = omit,
628
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
629
+ # The extra values given here take precedence over values defined on the client or passed to this method.
630
+ extra_headers: Headers | None = None,
631
+ extra_query: Query | None = None,
632
+ extra_body: Body | None = None,
633
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
634
+ ) -> AsyncPaginator[ExperienceListResponse, AsyncCursorPage[ExperienceListResponse]]:
635
+ """
636
+ Lists experiences for a company
637
+
638
+ Required permissions:
639
+
640
+ - `experience:hidden_experience:read`
641
+
642
+ Args:
643
+ company_id: The ID of the company to filter experiences by
644
+
645
+ after: Returns the elements in the list that come after the specified cursor.
646
+
647
+ app_id: The ID of the app to filter experiences by
648
+
649
+ before: Returns the elements in the list that come before the specified cursor.
650
+
651
+ created_after: The minimum creation date to filter by
652
+
653
+ created_before: The maximum creation date to filter by
654
+
655
+ first: Returns the first _n_ elements from the list.
656
+
657
+ last: Returns the last _n_ elements from the list.
658
+
659
+ product_id: The ID of the product to filter experiences by
660
+
661
+ extra_headers: Send extra headers
662
+
663
+ extra_query: Add additional query parameters to the request
664
+
665
+ extra_body: Add additional JSON properties to the request
666
+
667
+ timeout: Override the client-level default timeout for this request, in seconds
668
+ """
669
+ return self._get_api_list(
670
+ "/experiences",
671
+ page=AsyncCursorPage[ExperienceListResponse],
672
+ options=make_request_options(
673
+ extra_headers=extra_headers,
674
+ extra_query=extra_query,
675
+ extra_body=extra_body,
676
+ timeout=timeout,
677
+ query=maybe_transform(
678
+ {
679
+ "company_id": company_id,
680
+ "after": after,
681
+ "app_id": app_id,
682
+ "before": before,
683
+ "created_after": created_after,
684
+ "created_before": created_before,
685
+ "first": first,
686
+ "last": last,
687
+ "product_id": product_id,
688
+ },
689
+ experience_list_params.ExperienceListParams,
690
+ ),
691
+ ),
692
+ model=ExperienceListResponse,
693
+ )
694
+
695
+ async def delete(
696
+ self,
697
+ id: str,
698
+ *,
699
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
700
+ # The extra values given here take precedence over values defined on the client or passed to this method.
701
+ extra_headers: Headers | None = None,
702
+ extra_query: Query | None = None,
703
+ extra_body: Body | None = None,
704
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
705
+ ) -> ExperienceDeleteResponse:
706
+ """
707
+ Required permissions:
708
+
709
+ - `experience:delete`
710
+
711
+ Args:
712
+ extra_headers: Send extra headers
713
+
714
+ extra_query: Add additional query parameters to the request
715
+
716
+ extra_body: Add additional JSON properties to the request
717
+
718
+ timeout: Override the client-level default timeout for this request, in seconds
719
+ """
720
+ if not id:
721
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
722
+ return await self._delete(
723
+ f"/experiences/{id}",
724
+ options=make_request_options(
725
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
726
+ ),
727
+ cast_to=ExperienceDeleteResponse,
728
+ )
729
+
730
+ async def attach(
731
+ self,
732
+ id: str,
733
+ *,
734
+ product_id: str,
735
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
736
+ # The extra values given here take precedence over values defined on the client or passed to this method.
737
+ extra_headers: Headers | None = None,
738
+ extra_query: Query | None = None,
739
+ extra_body: Body | None = None,
740
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
741
+ ) -> Experience:
742
+ """
743
+ Adds an experience to an product, making it accessible to the product's
744
+ customers.
745
+
746
+ Required permissions:
747
+
748
+ - `experience:attach`
749
+
750
+ Args:
751
+ product_id: The ID of the Access Pass to add the Experience to.
752
+
753
+ extra_headers: Send extra headers
754
+
755
+ extra_query: Add additional query parameters to the request
756
+
757
+ extra_body: Add additional JSON properties to the request
758
+
759
+ timeout: Override the client-level default timeout for this request, in seconds
760
+ """
761
+ if not id:
762
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
763
+ return await self._post(
764
+ f"/experiences/{id}/attach",
765
+ body=await async_maybe_transform(
766
+ {"product_id": product_id}, experience_attach_params.ExperienceAttachParams
767
+ ),
768
+ options=make_request_options(
769
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
770
+ ),
771
+ cast_to=Experience,
772
+ )
773
+
774
+ async def detach(
775
+ self,
776
+ id: str,
777
+ *,
778
+ product_id: str,
779
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
780
+ # The extra values given here take precedence over values defined on the client or passed to this method.
781
+ extra_headers: Headers | None = None,
782
+ extra_query: Query | None = None,
783
+ extra_body: Body | None = None,
784
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
785
+ ) -> Experience:
786
+ """
787
+ Removes an experience from an product, making it inaccessible to the product's
788
+ customers.
789
+
790
+ Required permissions:
791
+
792
+ - `experience:detach`
793
+
794
+ Args:
795
+ product_id: The ID of the Access Pass to add the Experience to.
796
+
797
+ extra_headers: Send extra headers
798
+
799
+ extra_query: Add additional query parameters to the request
800
+
801
+ extra_body: Add additional JSON properties to the request
802
+
803
+ timeout: Override the client-level default timeout for this request, in seconds
804
+ """
805
+ if not id:
806
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
807
+ return await self._post(
808
+ f"/experiences/{id}/detach",
809
+ body=await async_maybe_transform(
810
+ {"product_id": product_id}, experience_detach_params.ExperienceDetachParams
811
+ ),
812
+ options=make_request_options(
813
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
814
+ ),
815
+ cast_to=Experience,
816
+ )
817
+
818
+ async def duplicate(
819
+ self,
820
+ id: str,
821
+ *,
822
+ name: Optional[str] | Omit = omit,
823
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
824
+ # The extra values given here take precedence over values defined on the client or passed to this method.
825
+ extra_headers: Headers | None = None,
826
+ extra_query: Query | None = None,
827
+ extra_body: Body | None = None,
828
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
829
+ ) -> Experience:
830
+ """Duplicates an existing experience.
831
+
832
+ The name will be copied, unless provided. The
833
+ new experience will be attached to the same products as the original experience.
834
+ If duplicating a Forum or Chat experience, the new experience will have the same
835
+ settings as the original experience, e.g. who can post, who can comment, etc. No
836
+ content, e.g. posts, messages, lessons from within the original experience will
837
+ be copied.
838
+
839
+ Required permissions:
840
+
841
+ - `experience:create`
842
+
843
+ Args:
844
+ name: The name of the new experience
845
+
846
+ extra_headers: Send extra headers
847
+
848
+ extra_query: Add additional query parameters to the request
849
+
850
+ extra_body: Add additional JSON properties to the request
851
+
852
+ timeout: Override the client-level default timeout for this request, in seconds
853
+ """
854
+ if not id:
855
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
856
+ return await self._post(
857
+ f"/experiences/{id}/duplicate",
858
+ body=await async_maybe_transform({"name": name}, experience_duplicate_params.ExperienceDuplicateParams),
859
+ options=make_request_options(
860
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
861
+ ),
862
+ cast_to=Experience,
863
+ )
864
+
865
+
866
+ class ExperiencesResourceWithRawResponse:
867
+ def __init__(self, experiences: ExperiencesResource) -> None:
868
+ self._experiences = experiences
869
+
870
+ self.create = to_raw_response_wrapper(
871
+ experiences.create,
872
+ )
873
+ self.retrieve = to_raw_response_wrapper(
874
+ experiences.retrieve,
875
+ )
876
+ self.update = to_raw_response_wrapper(
877
+ experiences.update,
878
+ )
879
+ self.list = to_raw_response_wrapper(
880
+ experiences.list,
881
+ )
882
+ self.delete = to_raw_response_wrapper(
883
+ experiences.delete,
884
+ )
885
+ self.attach = to_raw_response_wrapper(
886
+ experiences.attach,
887
+ )
888
+ self.detach = to_raw_response_wrapper(
889
+ experiences.detach,
890
+ )
891
+ self.duplicate = to_raw_response_wrapper(
892
+ experiences.duplicate,
893
+ )
894
+
895
+
896
+ class AsyncExperiencesResourceWithRawResponse:
897
+ def __init__(self, experiences: AsyncExperiencesResource) -> None:
898
+ self._experiences = experiences
899
+
900
+ self.create = async_to_raw_response_wrapper(
901
+ experiences.create,
902
+ )
903
+ self.retrieve = async_to_raw_response_wrapper(
904
+ experiences.retrieve,
905
+ )
906
+ self.update = async_to_raw_response_wrapper(
907
+ experiences.update,
908
+ )
909
+ self.list = async_to_raw_response_wrapper(
910
+ experiences.list,
911
+ )
912
+ self.delete = async_to_raw_response_wrapper(
913
+ experiences.delete,
914
+ )
915
+ self.attach = async_to_raw_response_wrapper(
916
+ experiences.attach,
917
+ )
918
+ self.detach = async_to_raw_response_wrapper(
919
+ experiences.detach,
920
+ )
921
+ self.duplicate = async_to_raw_response_wrapper(
922
+ experiences.duplicate,
923
+ )
924
+
925
+
926
+ class ExperiencesResourceWithStreamingResponse:
927
+ def __init__(self, experiences: ExperiencesResource) -> None:
928
+ self._experiences = experiences
929
+
930
+ self.create = to_streamed_response_wrapper(
931
+ experiences.create,
932
+ )
933
+ self.retrieve = to_streamed_response_wrapper(
934
+ experiences.retrieve,
935
+ )
936
+ self.update = to_streamed_response_wrapper(
937
+ experiences.update,
938
+ )
939
+ self.list = to_streamed_response_wrapper(
940
+ experiences.list,
941
+ )
942
+ self.delete = to_streamed_response_wrapper(
943
+ experiences.delete,
944
+ )
945
+ self.attach = to_streamed_response_wrapper(
946
+ experiences.attach,
947
+ )
948
+ self.detach = to_streamed_response_wrapper(
949
+ experiences.detach,
950
+ )
951
+ self.duplicate = to_streamed_response_wrapper(
952
+ experiences.duplicate,
953
+ )
954
+
955
+
956
+ class AsyncExperiencesResourceWithStreamingResponse:
957
+ def __init__(self, experiences: AsyncExperiencesResource) -> None:
958
+ self._experiences = experiences
959
+
960
+ self.create = async_to_streamed_response_wrapper(
961
+ experiences.create,
962
+ )
963
+ self.retrieve = async_to_streamed_response_wrapper(
964
+ experiences.retrieve,
965
+ )
966
+ self.update = async_to_streamed_response_wrapper(
967
+ experiences.update,
968
+ )
969
+ self.list = async_to_streamed_response_wrapper(
970
+ experiences.list,
971
+ )
972
+ self.delete = async_to_streamed_response_wrapper(
973
+ experiences.delete,
974
+ )
975
+ self.attach = async_to_streamed_response_wrapper(
976
+ experiences.attach,
977
+ )
978
+ self.detach = async_to_streamed_response_wrapper(
979
+ experiences.detach,
980
+ )
981
+ self.duplicate = async_to_streamed_response_wrapper(
982
+ experiences.duplicate,
983
+ )