whop_sdk 0.0.2 → 0.0.4

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 (338) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +51 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +24 -0
  5. data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +30 -24
  6. data/lib/whop_sdk/models/app_build_create_params.rb +53 -29
  7. data/lib/whop_sdk/models/app_update_params.rb +53 -29
  8. data/lib/whop_sdk/models/assessment_question_types.rb +18 -0
  9. data/lib/whop_sdk/models/billing_reasons.rb +20 -0
  10. data/lib/whop_sdk/models/card_brands.rb +30 -0
  11. data/lib/whop_sdk/models/checkout_configuration.rb +10 -7
  12. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +251 -38
  13. data/lib/whop_sdk/models/checkout_configuration_list_response.rb +10 -7
  14. data/lib/whop_sdk/models/company.rb +13 -1
  15. data/lib/whop_sdk/models/company_create_params.rb +46 -0
  16. data/lib/whop_sdk/models/company_list_params.rb +62 -0
  17. data/lib/whop_sdk/models/company_list_response.rb +175 -0
  18. data/lib/whop_sdk/models/course.rb +230 -0
  19. data/lib/whop_sdk/models/course_chapter.rb +72 -0
  20. data/lib/whop_sdk/models/course_chapter_create_params.rb +30 -0
  21. data/lib/whop_sdk/models/course_chapter_delete_params.rb +14 -0
  22. data/lib/whop_sdk/models/course_chapter_delete_response.rb +8 -0
  23. data/lib/whop_sdk/models/course_chapter_list_params.rb +54 -0
  24. data/lib/whop_sdk/models/course_chapter_list_response.rb +35 -0
  25. data/lib/whop_sdk/models/course_chapter_retrieve_params.rb +14 -0
  26. data/lib/whop_sdk/models/course_chapter_update_params.rb +22 -0
  27. data/lib/whop_sdk/models/course_create_params.rb +127 -0
  28. data/lib/whop_sdk/models/course_delete_params.rb +14 -0
  29. data/lib/whop_sdk/models/course_delete_response.rb +8 -0
  30. data/lib/whop_sdk/models/course_lesson_create_params.rb +54 -0
  31. data/lib/whop_sdk/models/course_lesson_delete_params.rb +14 -0
  32. data/lib/whop_sdk/models/course_lesson_delete_response.rb +8 -0
  33. data/lib/whop_sdk/models/course_lesson_list_params.rb +62 -0
  34. data/lib/whop_sdk/models/course_lesson_list_response.rb +71 -0
  35. data/lib/whop_sdk/models/course_lesson_retrieve_params.rb +14 -0
  36. data/lib/whop_sdk/models/course_lesson_update_params.rb +399 -0
  37. data/lib/whop_sdk/models/course_list_params.rb +62 -0
  38. data/lib/whop_sdk/models/course_list_response.rb +148 -0
  39. data/lib/whop_sdk/models/course_retrieve_params.rb +14 -0
  40. data/lib/whop_sdk/models/course_student_list_params.rb +62 -0
  41. data/lib/whop_sdk/models/course_student_list_response.rb +97 -0
  42. data/lib/whop_sdk/models/course_student_retrieve_params.rb +14 -0
  43. data/lib/whop_sdk/models/course_student_retrieve_response.rb +149 -0
  44. data/lib/whop_sdk/models/course_update_params.rb +221 -0
  45. data/lib/whop_sdk/models/experience_duplicate_params.rb +22 -0
  46. data/lib/whop_sdk/models/experience_update_params.rb +53 -29
  47. data/lib/whop_sdk/models/forum_post.rb +17 -1
  48. data/lib/whop_sdk/models/forum_post_create_params.rb +51 -27
  49. data/lib/whop_sdk/models/forum_post_list_response.rb +17 -1
  50. data/lib/whop_sdk/models/forum_post_update_params.rb +104 -0
  51. data/lib/whop_sdk/models/invoice.rb +6 -2
  52. data/lib/whop_sdk/models/invoice_create_params.rb +48 -32
  53. data/lib/whop_sdk/models/invoice_list_item.rb +6 -2
  54. data/lib/whop_sdk/models/languages.rb +36 -0
  55. data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +9 -0
  56. data/lib/whop_sdk/models/lesson.rb +373 -0
  57. data/lib/whop_sdk/models/lesson_types.rb +20 -0
  58. data/lib/whop_sdk/models/lesson_visibilities.rb +17 -0
  59. data/lib/whop_sdk/models/member_list_params.rb +9 -1
  60. data/lib/whop_sdk/models/membership.rb +31 -1
  61. data/lib/whop_sdk/models/membership_list_params.rb +16 -8
  62. data/lib/whop_sdk/models/membership_list_response.rb +31 -1
  63. data/lib/whop_sdk/models/message_create_params.rb +51 -27
  64. data/lib/whop_sdk/models/message_update_params.rb +92 -0
  65. data/lib/whop_sdk/models/payment.rb +34 -22
  66. data/lib/whop_sdk/models/payment_list_params.rb +3 -18
  67. data/lib/whop_sdk/models/payment_list_response.rb +34 -22
  68. data/lib/whop_sdk/models/payment_method_types.rb +99 -0
  69. data/lib/whop_sdk/models/plan.rb +72 -1
  70. data/lib/whop_sdk/models/plan_create_params.rb +133 -24
  71. data/lib/whop_sdk/models/plan_list_response.rb +75 -1
  72. data/lib/whop_sdk/models/plan_update_params.rb +131 -22
  73. data/lib/whop_sdk/models/product.rb +11 -1
  74. data/lib/whop_sdk/models/product_create_params.rb +1 -45
  75. data/lib/whop_sdk/models/product_list_item.rb +14 -1
  76. data/lib/whop_sdk/models/product_update_params.rb +76 -23
  77. data/lib/whop_sdk/models/promo_code.rb +211 -0
  78. data/lib/whop_sdk/models/promo_code_create_params.rb +140 -0
  79. data/lib/whop_sdk/models/promo_code_delete_params.rb +14 -0
  80. data/lib/whop_sdk/models/promo_code_delete_response.rb +8 -0
  81. data/lib/whop_sdk/models/promo_code_list_params.rb +78 -0
  82. data/lib/whop_sdk/models/promo_code_list_response.rb +181 -0
  83. data/lib/whop_sdk/models/promo_code_retrieve_params.rb +14 -0
  84. data/lib/whop_sdk/models/promo_code_status.rb +17 -0
  85. data/lib/whop_sdk/models/promo_duration.rb +17 -0
  86. data/lib/whop_sdk/models/review_list_params.rb +70 -0
  87. data/lib/whop_sdk/models/review_list_response.rb +183 -0
  88. data/lib/whop_sdk/models/review_retrieve_params.rb +14 -0
  89. data/lib/whop_sdk/models/review_retrieve_response.rb +251 -0
  90. data/lib/whop_sdk/models/review_status.rb +17 -0
  91. data/lib/whop_sdk/models/transfer.rb +9 -1
  92. data/lib/whop_sdk/models/transfer_create_params.rb +9 -1
  93. data/lib/whop_sdk/models/transfer_list_response.rb +9 -1
  94. data/lib/whop_sdk/models.rb +84 -0
  95. data/lib/whop_sdk/resources/app_builds.rb +1 -1
  96. data/lib/whop_sdk/resources/apps.rb +1 -1
  97. data/lib/whop_sdk/resources/checkout_configurations.rb +8 -6
  98. data/lib/whop_sdk/resources/companies.rb +70 -0
  99. data/lib/whop_sdk/resources/course_chapters.rb +151 -0
  100. data/lib/whop_sdk/resources/course_lesson_interactions.rb +2 -2
  101. data/lib/whop_sdk/resources/course_lessons.rb +182 -0
  102. data/lib/whop_sdk/resources/course_students.rb +76 -0
  103. data/lib/whop_sdk/resources/courses.rb +185 -0
  104. data/lib/whop_sdk/resources/experiences.rb +34 -1
  105. data/lib/whop_sdk/resources/forum_posts.rb +34 -1
  106. data/lib/whop_sdk/resources/invoices.rb +11 -11
  107. data/lib/whop_sdk/resources/members.rb +3 -1
  108. data/lib/whop_sdk/resources/memberships.rb +6 -4
  109. data/lib/whop_sdk/resources/messages.rb +29 -1
  110. data/lib/whop_sdk/resources/payments.rb +1 -1
  111. data/lib/whop_sdk/resources/plans.rb +25 -5
  112. data/lib/whop_sdk/resources/products.rb +5 -7
  113. data/lib/whop_sdk/resources/promo_codes.rb +161 -0
  114. data/lib/whop_sdk/resources/reviews.rb +68 -0
  115. data/lib/whop_sdk/resources/transfers.rb +3 -1
  116. data/lib/whop_sdk/version.rb +1 -1
  117. data/lib/whop_sdk.rb +61 -1
  118. data/rbi/whop_sdk/client.rbi +18 -0
  119. data/rbi/whop_sdk/models/app_build_create_params.rbi +80 -40
  120. data/rbi/whop_sdk/models/app_update_params.rbi +86 -37
  121. data/rbi/whop_sdk/models/assessment_question_types.rbi +31 -0
  122. data/rbi/whop_sdk/models/billing_reasons.rbi +27 -0
  123. data/rbi/whop_sdk/models/card_brands.rbi +35 -0
  124. data/rbi/whop_sdk/models/checkout_configuration.rbi +4 -2
  125. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +371 -62
  126. data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +4 -2
  127. data/rbi/whop_sdk/models/company.rbi +10 -0
  128. data/rbi/whop_sdk/models/company_create_params.rbi +67 -0
  129. data/rbi/whop_sdk/models/company_list_params.rbi +83 -0
  130. data/rbi/whop_sdk/models/company_list_response.rbi +235 -0
  131. data/rbi/whop_sdk/models/course.rbi +313 -0
  132. data/rbi/whop_sdk/models/course_chapter.rbi +101 -0
  133. data/rbi/whop_sdk/models/course_chapter_create_params.rbi +51 -0
  134. data/rbi/whop_sdk/models/course_chapter_delete_params.rbi +27 -0
  135. data/rbi/whop_sdk/models/course_chapter_delete_response.rbi +8 -0
  136. data/rbi/whop_sdk/models/course_chapter_list_params.rbi +75 -0
  137. data/rbi/whop_sdk/models/course_chapter_list_response.rbi +47 -0
  138. data/rbi/whop_sdk/models/course_chapter_retrieve_params.rbi +30 -0
  139. data/rbi/whop_sdk/models/course_chapter_update_params.rbi +40 -0
  140. data/rbi/whop_sdk/models/course_create_params.rbi +197 -0
  141. data/rbi/whop_sdk/models/course_delete_params.rbi +27 -0
  142. data/rbi/whop_sdk/models/course_delete_response.rbi +7 -0
  143. data/rbi/whop_sdk/models/course_lesson_create_params.rbi +75 -0
  144. data/rbi/whop_sdk/models/course_lesson_delete_params.rbi +27 -0
  145. data/rbi/whop_sdk/models/course_lesson_delete_response.rbi +8 -0
  146. data/rbi/whop_sdk/models/course_lesson_list_params.rbi +83 -0
  147. data/rbi/whop_sdk/models/course_lesson_list_response.rbi +91 -0
  148. data/rbi/whop_sdk/models/course_lesson_retrieve_params.rbi +27 -0
  149. data/rbi/whop_sdk/models/course_lesson_update_params.rbi +677 -0
  150. data/rbi/whop_sdk/models/course_list_params.rbi +83 -0
  151. data/rbi/whop_sdk/models/course_list_response.rbi +198 -0
  152. data/rbi/whop_sdk/models/course_retrieve_params.rbi +27 -0
  153. data/rbi/whop_sdk/models/course_student_list_params.rbi +83 -0
  154. data/rbi/whop_sdk/models/course_student_list_response.rbi +142 -0
  155. data/rbi/whop_sdk/models/course_student_retrieve_params.rbi +30 -0
  156. data/rbi/whop_sdk/models/course_student_retrieve_response.rbi +250 -0
  157. data/rbi/whop_sdk/models/course_update_params.rbi +339 -0
  158. data/rbi/whop_sdk/models/experience_duplicate_params.rbi +40 -0
  159. data/rbi/whop_sdk/models/experience_update_params.rbi +84 -38
  160. data/rbi/whop_sdk/models/forum_post.rbi +16 -0
  161. data/rbi/whop_sdk/models/forum_post_create_params.rbi +85 -32
  162. data/rbi/whop_sdk/models/forum_post_list_response.rbi +16 -0
  163. data/rbi/whop_sdk/models/forum_post_update_params.rbi +177 -0
  164. data/rbi/whop_sdk/models/invoice.rbi +4 -2
  165. data/rbi/whop_sdk/models/invoice_create_params.rbi +58 -44
  166. data/rbi/whop_sdk/models/invoice_list_item.rbi +4 -2
  167. data/rbi/whop_sdk/models/languages.rbi +40 -0
  168. data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +45 -0
  169. data/rbi/whop_sdk/models/lesson.rbi +521 -0
  170. data/rbi/whop_sdk/models/lesson_types.rbi +25 -0
  171. data/rbi/whop_sdk/models/lesson_visibilities.rbi +23 -0
  172. data/rbi/whop_sdk/models/member_list_params.rbi +8 -0
  173. data/rbi/whop_sdk/models/membership.rbi +40 -0
  174. data/rbi/whop_sdk/models/membership_list_params.rbi +16 -8
  175. data/rbi/whop_sdk/models/membership_list_response.rbi +47 -0
  176. data/rbi/whop_sdk/models/message_create_params.rbi +85 -32
  177. data/rbi/whop_sdk/models/message_update_params.rbi +167 -0
  178. data/rbi/whop_sdk/models/payment.rbi +42 -25
  179. data/rbi/whop_sdk/models/payment_list_params.rbi +3 -63
  180. data/rbi/whop_sdk/models/payment_list_response.rbi +42 -25
  181. data/rbi/whop_sdk/models/payment_method_types.rbi +118 -0
  182. data/rbi/whop_sdk/models/plan.rbi +106 -0
  183. data/rbi/whop_sdk/models/plan_create_params.rbi +212 -34
  184. data/rbi/whop_sdk/models/plan_list_response.rbi +118 -0
  185. data/rbi/whop_sdk/models/plan_update_params.rbi +210 -32
  186. data/rbi/whop_sdk/models/product.rbi +12 -0
  187. data/rbi/whop_sdk/models/product_create_params.rbi +0 -74
  188. data/rbi/whop_sdk/models/product_list_item.rbi +12 -0
  189. data/rbi/whop_sdk/models/product_update_params.rbi +136 -33
  190. data/rbi/whop_sdk/models/promo_code.rbi +248 -0
  191. data/rbi/whop_sdk/models/promo_code_create_params.rbi +161 -0
  192. data/rbi/whop_sdk/models/promo_code_delete_params.rbi +27 -0
  193. data/rbi/whop_sdk/models/promo_code_delete_response.rbi +8 -0
  194. data/rbi/whop_sdk/models/promo_code_list_params.rbi +99 -0
  195. data/rbi/whop_sdk/models/promo_code_list_response.rbi +222 -0
  196. data/rbi/whop_sdk/models/promo_code_retrieve_params.rbi +27 -0
  197. data/rbi/whop_sdk/models/promo_code_status.rbi +21 -0
  198. data/rbi/whop_sdk/models/promo_duration.rbi +21 -0
  199. data/rbi/whop_sdk/models/review_list_params.rbi +91 -0
  200. data/rbi/whop_sdk/models/review_list_response.rbi +243 -0
  201. data/rbi/whop_sdk/models/review_retrieve_params.rbi +27 -0
  202. data/rbi/whop_sdk/models/review_retrieve_response.rbi +354 -0
  203. data/rbi/whop_sdk/models/review_status.rbi +21 -0
  204. data/rbi/whop_sdk/models/transfer.rbi +8 -0
  205. data/rbi/whop_sdk/models/transfer_create_params.rbi +8 -0
  206. data/rbi/whop_sdk/models/transfer_list_response.rbi +8 -0
  207. data/rbi/whop_sdk/models.rbi +84 -0
  208. data/rbi/whop_sdk/resources/app_builds.rbi +5 -1
  209. data/rbi/whop_sdk/resources/apps.rbi +7 -1
  210. data/rbi/whop_sdk/resources/checkout_configurations.rbi +8 -7
  211. data/rbi/whop_sdk/resources/companies.rbi +63 -0
  212. data/rbi/whop_sdk/resources/course_chapters.rbi +115 -0
  213. data/rbi/whop_sdk/resources/course_lesson_interactions.rbi +2 -2
  214. data/rbi/whop_sdk/resources/course_lessons.rbi +182 -0
  215. data/rbi/whop_sdk/resources/course_students.rbi +65 -0
  216. data/rbi/whop_sdk/resources/courses.rbi +172 -0
  217. data/rbi/whop_sdk/resources/experiences.rbi +32 -1
  218. data/rbi/whop_sdk/resources/forum_posts.rbi +40 -1
  219. data/rbi/whop_sdk/resources/invoices.rbi +18 -18
  220. data/rbi/whop_sdk/resources/members.rbi +3 -0
  221. data/rbi/whop_sdk/resources/memberships.rbi +6 -3
  222. data/rbi/whop_sdk/resources/messages.rbi +36 -1
  223. data/rbi/whop_sdk/resources/payments.rbi +1 -3
  224. data/rbi/whop_sdk/resources/plans.rbi +57 -3
  225. data/rbi/whop_sdk/resources/products.rbi +10 -8
  226. data/rbi/whop_sdk/resources/promo_codes.rbi +147 -0
  227. data/rbi/whop_sdk/resources/reviews.rbi +56 -0
  228. data/rbi/whop_sdk/resources/transfers.rbi +3 -0
  229. data/sig/whop_sdk/client.rbs +12 -0
  230. data/sig/whop_sdk/models/app_build_create_params.rbs +29 -10
  231. data/sig/whop_sdk/models/app_update_params.rbs +29 -10
  232. data/sig/whop_sdk/models/assessment_question_types.rbs +17 -0
  233. data/sig/whop_sdk/models/billing_reasons.rbs +24 -0
  234. data/sig/whop_sdk/models/card_brands.rbs +44 -0
  235. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +159 -21
  236. data/sig/whop_sdk/models/company.rbs +5 -0
  237. data/sig/whop_sdk/models/company_create_params.rbs +41 -0
  238. data/sig/whop_sdk/models/company_list_params.rbs +51 -0
  239. data/sig/whop_sdk/models/company_list_response.rbs +109 -0
  240. data/sig/whop_sdk/models/course.rbs +171 -0
  241. data/sig/whop_sdk/models/course_chapter.rbs +49 -0
  242. data/sig/whop_sdk/models/course_chapter_create_params.rbs +28 -0
  243. data/sig/whop_sdk/models/course_chapter_delete_params.rbs +15 -0
  244. data/sig/whop_sdk/models/course_chapter_delete_response.rbs +5 -0
  245. data/sig/whop_sdk/models/course_chapter_list_params.rbs +46 -0
  246. data/sig/whop_sdk/models/course_chapter_list_response.rbs +18 -0
  247. data/sig/whop_sdk/models/course_chapter_retrieve_params.rbs +15 -0
  248. data/sig/whop_sdk/models/course_chapter_update_params.rbs +23 -0
  249. data/sig/whop_sdk/models/course_create_params.rbs +87 -0
  250. data/sig/whop_sdk/models/course_delete_params.rbs +15 -0
  251. data/sig/whop_sdk/models/course_delete_response.rbs +5 -0
  252. data/sig/whop_sdk/models/course_lesson_create_params.rbs +46 -0
  253. data/sig/whop_sdk/models/course_lesson_delete_params.rbs +15 -0
  254. data/sig/whop_sdk/models/course_lesson_delete_response.rbs +5 -0
  255. data/sig/whop_sdk/models/course_lesson_list_params.rbs +51 -0
  256. data/sig/whop_sdk/models/course_lesson_list_response.rbs +50 -0
  257. data/sig/whop_sdk/models/course_lesson_retrieve_params.rbs +15 -0
  258. data/sig/whop_sdk/models/course_lesson_update_params.rbs +248 -0
  259. data/sig/whop_sdk/models/course_list_params.rbs +51 -0
  260. data/sig/whop_sdk/models/course_list_response.rbs +102 -0
  261. data/sig/whop_sdk/models/course_retrieve_params.rbs +15 -0
  262. data/sig/whop_sdk/models/course_student_list_params.rbs +51 -0
  263. data/sig/whop_sdk/models/course_student_list_response.rbs +64 -0
  264. data/sig/whop_sdk/models/course_student_retrieve_params.rbs +15 -0
  265. data/sig/whop_sdk/models/course_student_retrieve_response.rbs +106 -0
  266. data/sig/whop_sdk/models/course_update_params.rbs +156 -0
  267. data/sig/whop_sdk/models/experience_duplicate_params.rbs +23 -0
  268. data/sig/whop_sdk/models/experience_update_params.rbs +29 -10
  269. data/sig/whop_sdk/models/forum_post.rbs +10 -0
  270. data/sig/whop_sdk/models/forum_post_create_params.rbs +29 -10
  271. data/sig/whop_sdk/models/forum_post_list_response.rbs +10 -0
  272. data/sig/whop_sdk/models/forum_post_update_params.rbs +72 -0
  273. data/sig/whop_sdk/models/invoice_create_params.rbs +28 -18
  274. data/sig/whop_sdk/models/languages.rbs +56 -0
  275. data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +20 -1
  276. data/sig/whop_sdk/models/lesson.rbs +248 -0
  277. data/sig/whop_sdk/models/lesson_types.rbs +19 -0
  278. data/sig/whop_sdk/models/lesson_visibilities.rbs +14 -0
  279. data/sig/whop_sdk/models/member_list_params.rbs +6 -1
  280. data/sig/whop_sdk/models/membership.rbs +17 -0
  281. data/sig/whop_sdk/models/membership_list_params.rbs +11 -6
  282. data/sig/whop_sdk/models/membership_list_response.rbs +17 -0
  283. data/sig/whop_sdk/models/message_create_params.rbs +29 -10
  284. data/sig/whop_sdk/models/message_update_params.rbs +67 -0
  285. data/sig/whop_sdk/models/payment.rbs +17 -12
  286. data/sig/whop_sdk/models/payment_list_params.rbs +4 -25
  287. data/sig/whop_sdk/models/payment_list_response.rbs +17 -12
  288. data/sig/whop_sdk/models/payment_method_types.rbs +182 -0
  289. data/sig/whop_sdk/models/plan.rbs +47 -0
  290. data/sig/whop_sdk/models/plan_create_params.rbs +81 -10
  291. data/sig/whop_sdk/models/plan_list_response.rbs +47 -0
  292. data/sig/whop_sdk/models/plan_update_params.rbs +81 -10
  293. data/sig/whop_sdk/models/product.rbs +5 -0
  294. data/sig/whop_sdk/models/product_create_params.rbs +0 -22
  295. data/sig/whop_sdk/models/product_list_item.rbs +5 -0
  296. data/sig/whop_sdk/models/product_update_params.rbs +46 -10
  297. data/sig/whop_sdk/models/promo_code.rbs +134 -0
  298. data/sig/whop_sdk/models/promo_code_create_params.rbs +96 -0
  299. data/sig/whop_sdk/models/promo_code_delete_params.rbs +15 -0
  300. data/sig/whop_sdk/models/promo_code_delete_response.rbs +5 -0
  301. data/sig/whop_sdk/models/promo_code_list_params.rbs +61 -0
  302. data/sig/whop_sdk/models/promo_code_list_response.rbs +117 -0
  303. data/sig/whop_sdk/models/promo_code_retrieve_params.rbs +15 -0
  304. data/sig/whop_sdk/models/promo_code_status.rbs +15 -0
  305. data/sig/whop_sdk/models/promo_duration.rbs +15 -0
  306. data/sig/whop_sdk/models/review_list_params.rbs +56 -0
  307. data/sig/whop_sdk/models/review_list_response.rbs +116 -0
  308. data/sig/whop_sdk/models/review_retrieve_params.rbs +15 -0
  309. data/sig/whop_sdk/models/review_retrieve_response.rbs +152 -0
  310. data/sig/whop_sdk/models/review_status.rbs +15 -0
  311. data/sig/whop_sdk/models/transfer.rbs +5 -0
  312. data/sig/whop_sdk/models/transfer_create_params.rbs +5 -0
  313. data/sig/whop_sdk/models/transfer_list_response.rbs +5 -0
  314. data/sig/whop_sdk/models.rbs +84 -0
  315. data/sig/whop_sdk/resources/app_builds.rbs +1 -1
  316. data/sig/whop_sdk/resources/apps.rbs +1 -1
  317. data/sig/whop_sdk/resources/checkout_configurations.rbs +2 -2
  318. data/sig/whop_sdk/resources/companies.rbs +18 -0
  319. data/sig/whop_sdk/resources/course_chapters.rbs +35 -0
  320. data/sig/whop_sdk/resources/course_lessons.rbs +49 -0
  321. data/sig/whop_sdk/resources/course_students.rbs +22 -0
  322. data/sig/whop_sdk/resources/courses.rbs +49 -0
  323. data/sig/whop_sdk/resources/experiences.rbs +7 -1
  324. data/sig/whop_sdk/resources/forum_posts.rbs +10 -1
  325. data/sig/whop_sdk/resources/invoices.rbs +5 -5
  326. data/sig/whop_sdk/resources/members.rbs +1 -0
  327. data/sig/whop_sdk/resources/memberships.rbs +2 -1
  328. data/sig/whop_sdk/resources/messages.rbs +9 -1
  329. data/sig/whop_sdk/resources/payments.rbs +1 -1
  330. data/sig/whop_sdk/resources/plans.rbs +12 -2
  331. data/sig/whop_sdk/resources/products.rbs +2 -3
  332. data/sig/whop_sdk/resources/promo_codes.rbs +45 -0
  333. data/sig/whop_sdk/resources/reviews.rbs +23 -0
  334. data/sig/whop_sdk/resources/transfers.rbs +1 -0
  335. metadata +213 -5
  336. data/lib/whop_sdk/models/invoice_create_response.rb +0 -27
  337. data/rbi/whop_sdk/models/invoice_create_response.rbi +0 -49
  338. data/sig/whop_sdk/models/invoice_create_response.rbs +0 -19
@@ -12,16 +12,17 @@ module WhopSDK
12
12
  end
13
13
 
14
14
  # A banner image for the product in png, jpeg format
15
- sig { returns(T.nilable(WhopSDK::ProductUpdateParams::BannerImage)) }
16
- attr_reader :banner_image
17
-
18
15
  sig do
19
- params(
20
- banner_image:
21
- T.nilable(WhopSDK::ProductUpdateParams::BannerImage::OrHash)
22
- ).void
16
+ returns(
17
+ T.nilable(
18
+ T.any(
19
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithDirectUploadID,
20
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithID
21
+ )
22
+ )
23
+ )
23
24
  end
24
- attr_writer :banner_image
25
+ attr_accessor :banner_image
25
26
 
26
27
  # The different business types a company can be.
27
28
  sig { returns(T.nilable(WhopSDK::BusinessTypes::OrSymbol)) }
@@ -85,6 +86,18 @@ module WhopSDK
85
86
  sig { returns(T.nilable(String)) }
86
87
  attr_accessor :route
87
88
 
89
+ # Configuration for a product on the company's store page.
90
+ sig { returns(T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig)) }
91
+ attr_reader :store_page_config
92
+
93
+ sig do
94
+ params(
95
+ store_page_config:
96
+ T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash)
97
+ ).void
98
+ end
99
+ attr_writer :store_page_config
100
+
88
101
  # The title of the product.
89
102
  sig { returns(T.nilable(String)) }
90
103
  attr_accessor :title
@@ -96,7 +109,12 @@ module WhopSDK
96
109
  sig do
97
110
  params(
98
111
  banner_image:
99
- T.nilable(WhopSDK::ProductUpdateParams::BannerImage::OrHash),
112
+ T.nilable(
113
+ T.any(
114
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithDirectUploadID::OrHash,
115
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithID::OrHash
116
+ )
117
+ ),
100
118
  business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
101
119
  collect_shipping_address: T.nilable(T::Boolean),
102
120
  custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol),
@@ -114,6 +132,8 @@ module WhopSDK
114
132
  product_tax_code_id: T.nilable(String),
115
133
  redirect_purchase_url: T.nilable(String),
116
134
  route: T.nilable(String),
135
+ store_page_config:
136
+ T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash),
117
137
  title: T.nilable(String),
118
138
  visibility: T.nilable(WhopSDK::Visibility::OrSymbol),
119
139
  request_options: WhopSDK::RequestOptions::OrHash
@@ -154,6 +174,8 @@ module WhopSDK
154
174
  redirect_purchase_url: nil,
155
175
  # The route of the product.
156
176
  route: nil,
177
+ # Configuration for a product on the company's store page.
178
+ store_page_config: nil,
157
179
  # The title of the product.
158
180
  title: nil,
159
181
  # Visibility of a resource
@@ -165,7 +187,13 @@ module WhopSDK
165
187
  sig do
166
188
  override.returns(
167
189
  {
168
- banner_image: T.nilable(WhopSDK::ProductUpdateParams::BannerImage),
190
+ banner_image:
191
+ T.nilable(
192
+ T.any(
193
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithDirectUploadID,
194
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithID
195
+ )
196
+ ),
169
197
  business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
170
198
  collect_shipping_address: T.nilable(T::Boolean),
171
199
  custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol),
@@ -183,6 +211,8 @@ module WhopSDK
183
211
  product_tax_code_id: T.nilable(String),
184
212
  redirect_purchase_url: T.nilable(String),
185
213
  route: T.nilable(String),
214
+ store_page_config:
215
+ T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig),
186
216
  title: T.nilable(String),
187
217
  visibility: T.nilable(WhopSDK::Visibility::OrSymbol),
188
218
  request_options: WhopSDK::RequestOptions
@@ -192,49 +222,122 @@ module WhopSDK
192
222
  def to_hash
193
223
  end
194
224
 
195
- class BannerImage < WhopSDK::Internal::Type::BaseModel
225
+ # A banner image for the product in png, jpeg format
226
+ module BannerImage
227
+ extend WhopSDK::Internal::Type::Union
228
+
229
+ Variants =
230
+ T.type_alias do
231
+ T.any(
232
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithDirectUploadID,
233
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithID
234
+ )
235
+ end
236
+
237
+ class AttachmentInputWithDirectUploadID < WhopSDK::Internal::Type::BaseModel
238
+ OrHash =
239
+ T.type_alias do
240
+ T.any(
241
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithDirectUploadID,
242
+ WhopSDK::Internal::AnyHash
243
+ )
244
+ end
245
+
246
+ # This ID should be used the first time you upload an attachment. It is the ID of
247
+ # the direct upload that was created when uploading the file to S3 via the
248
+ # mediaDirectUpload mutation.
249
+ sig { returns(String) }
250
+ attr_accessor :direct_upload_id
251
+
252
+ # Input for an attachment
253
+ sig { params(direct_upload_id: String).returns(T.attached_class) }
254
+ def self.new(
255
+ # This ID should be used the first time you upload an attachment. It is the ID of
256
+ # the direct upload that was created when uploading the file to S3 via the
257
+ # mediaDirectUpload mutation.
258
+ direct_upload_id:
259
+ )
260
+ end
261
+
262
+ sig { override.returns({ direct_upload_id: String }) }
263
+ def to_hash
264
+ end
265
+ end
266
+
267
+ class AttachmentInputWithID < WhopSDK::Internal::Type::BaseModel
268
+ OrHash =
269
+ T.type_alias do
270
+ T.any(
271
+ WhopSDK::ProductUpdateParams::BannerImage::AttachmentInputWithID,
272
+ WhopSDK::Internal::AnyHash
273
+ )
274
+ end
275
+
276
+ # The ID of an existing attachment object. Use this when updating a resource and
277
+ # keeping a subset of the attachments. Don't use this unless you know what you're
278
+ # doing.
279
+ sig { returns(String) }
280
+ attr_accessor :id
281
+
282
+ # Input for an attachment
283
+ sig { params(id: String).returns(T.attached_class) }
284
+ def self.new(
285
+ # The ID of an existing attachment object. Use this when updating a resource and
286
+ # keeping a subset of the attachments. Don't use this unless you know what you're
287
+ # doing.
288
+ id:
289
+ )
290
+ end
291
+
292
+ sig { override.returns({ id: String }) }
293
+ def to_hash
294
+ end
295
+ end
296
+
297
+ sig do
298
+ override.returns(
299
+ T::Array[WhopSDK::ProductUpdateParams::BannerImage::Variants]
300
+ )
301
+ end
302
+ def self.variants
303
+ end
304
+ end
305
+
306
+ class StorePageConfig < WhopSDK::Internal::Type::BaseModel
196
307
  OrHash =
197
308
  T.type_alias do
198
309
  T.any(
199
- WhopSDK::ProductUpdateParams::BannerImage,
310
+ WhopSDK::ProductUpdateParams::StorePageConfig,
200
311
  WhopSDK::Internal::AnyHash
201
312
  )
202
313
  end
203
314
 
204
- # The ID of an existing attachment object. Use this when updating a resource and
205
- # keeping a subset of the attachments. Don't use this unless you know what you're
206
- # doing.
315
+ # Custom call-to-action text for the product's store page.
207
316
  sig { returns(T.nilable(String)) }
208
- attr_accessor :id
317
+ attr_accessor :custom_cta
209
318
 
210
- # This ID should be used the first time you upload an attachment. It is the ID of
211
- # the direct upload that was created when uploading the file to S3 via the
212
- # mediaDirectUpload mutation.
213
- sig { returns(T.nilable(String)) }
214
- attr_accessor :direct_upload_id
319
+ # Whether or not to show the price on the product's store page.
320
+ sig { returns(T.nilable(T::Boolean)) }
321
+ attr_accessor :show_price
215
322
 
216
- # A banner image for the product in png, jpeg format
323
+ # Configuration for a product on the company's store page.
217
324
  sig do
218
325
  params(
219
- id: T.nilable(String),
220
- direct_upload_id: T.nilable(String)
326
+ custom_cta: T.nilable(String),
327
+ show_price: T.nilable(T::Boolean)
221
328
  ).returns(T.attached_class)
222
329
  end
223
330
  def self.new(
224
- # The ID of an existing attachment object. Use this when updating a resource and
225
- # keeping a subset of the attachments. Don't use this unless you know what you're
226
- # doing.
227
- id: nil,
228
- # This ID should be used the first time you upload an attachment. It is the ID of
229
- # the direct upload that was created when uploading the file to S3 via the
230
- # mediaDirectUpload mutation.
231
- direct_upload_id: nil
331
+ # Custom call-to-action text for the product's store page.
332
+ custom_cta: nil,
333
+ # Whether or not to show the price on the product's store page.
334
+ show_price: nil
232
335
  )
233
336
  end
234
337
 
235
338
  sig do
236
339
  override.returns(
237
- { id: T.nilable(String), direct_upload_id: T.nilable(String) }
340
+ { custom_cta: T.nilable(String), show_price: T.nilable(T::Boolean) }
238
341
  )
239
342
  end
240
343
  def to_hash
@@ -0,0 +1,248 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class PromoCode < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias { T.any(WhopSDK::PromoCode, WhopSDK::Internal::AnyHash) }
8
+
9
+ # The ID of the promo.
10
+ sig { returns(String) }
11
+ attr_accessor :id
12
+
13
+ # The amount off (% or flat amount) for the promo.
14
+ sig { returns(Float) }
15
+ attr_accessor :amount_off
16
+
17
+ # Restricts promo use to only users who have churned from the company before.
18
+ sig { returns(T::Boolean) }
19
+ attr_accessor :churned_users_only
20
+
21
+ # The specific code used to apply the promo at checkout.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_accessor :code
24
+
25
+ # The company for the promo code.
26
+ sig { returns(WhopSDK::PromoCode::Company) }
27
+ attr_reader :company
28
+
29
+ sig { params(company: WhopSDK::PromoCode::Company::OrHash).void }
30
+ attr_writer :company
31
+
32
+ # The timestamp of when the promo was created.
33
+ sig { returns(Time) }
34
+ attr_accessor :created_at
35
+
36
+ # The monetary currency of the promo code.
37
+ sig { returns(WhopSDK::Currency::TaggedSymbol) }
38
+ attr_accessor :currency
39
+
40
+ # The duration setting for the promo code
41
+ sig { returns(T.nilable(WhopSDK::PromoDuration::TaggedSymbol)) }
42
+ attr_accessor :duration
43
+
44
+ # Restricts promo use to only be applied to already purchased memberships.
45
+ sig { returns(T::Boolean) }
46
+ attr_accessor :existing_memberships_only
47
+
48
+ # The date/time of when the promo expires.
49
+ sig { returns(T.nilable(Time)) }
50
+ attr_accessor :expires_at
51
+
52
+ # Restricts promo use to only users who have never purchased from the company
53
+ # before.
54
+ sig { returns(T::Boolean) }
55
+ attr_accessor :new_users_only
56
+
57
+ # Restricts promo use to only be applied once per customer.
58
+ sig { returns(T::Boolean) }
59
+ attr_accessor :one_per_customer
60
+
61
+ # The access pass associated with the promo code.
62
+ sig { returns(T.nilable(WhopSDK::PromoCode::Product)) }
63
+ attr_reader :product
64
+
65
+ sig do
66
+ params(product: T.nilable(WhopSDK::PromoCode::Product::OrHash)).void
67
+ end
68
+ attr_writer :product
69
+
70
+ # The number of months the promo is applied for.
71
+ sig { returns(T.nilable(Integer)) }
72
+ attr_accessor :promo_duration_months
73
+
74
+ # The type (% or flat amount) of the promo.
75
+ sig { returns(WhopSDK::PromoType::TaggedSymbol) }
76
+ attr_accessor :promo_type
77
+
78
+ # Indicates if the promo code is live or disabled.
79
+ sig { returns(WhopSDK::PromoCodeStatus::TaggedSymbol) }
80
+ attr_accessor :status
81
+
82
+ # The quantity limit on the number of uses.
83
+ sig { returns(Integer) }
84
+ attr_accessor :stock
85
+
86
+ # Whether or not the promo code has unlimited stock.
87
+ sig { returns(T::Boolean) }
88
+ attr_accessor :unlimited_stock
89
+
90
+ # The amount of times the promo codes has been used.
91
+ sig { returns(Integer) }
92
+ attr_accessor :uses
93
+
94
+ # An object representing a promo code for a plan.
95
+ sig do
96
+ params(
97
+ id: String,
98
+ amount_off: Float,
99
+ churned_users_only: T::Boolean,
100
+ code: T.nilable(String),
101
+ company: WhopSDK::PromoCode::Company::OrHash,
102
+ created_at: Time,
103
+ currency: WhopSDK::Currency::OrSymbol,
104
+ duration: T.nilable(WhopSDK::PromoDuration::OrSymbol),
105
+ existing_memberships_only: T::Boolean,
106
+ expires_at: T.nilable(Time),
107
+ new_users_only: T::Boolean,
108
+ one_per_customer: T::Boolean,
109
+ product: T.nilable(WhopSDK::PromoCode::Product::OrHash),
110
+ promo_duration_months: T.nilable(Integer),
111
+ promo_type: WhopSDK::PromoType::OrSymbol,
112
+ status: WhopSDK::PromoCodeStatus::OrSymbol,
113
+ stock: Integer,
114
+ unlimited_stock: T::Boolean,
115
+ uses: Integer
116
+ ).returns(T.attached_class)
117
+ end
118
+ def self.new(
119
+ # The ID of the promo.
120
+ id:,
121
+ # The amount off (% or flat amount) for the promo.
122
+ amount_off:,
123
+ # Restricts promo use to only users who have churned from the company before.
124
+ churned_users_only:,
125
+ # The specific code used to apply the promo at checkout.
126
+ code:,
127
+ # The company for the promo code.
128
+ company:,
129
+ # The timestamp of when the promo was created.
130
+ created_at:,
131
+ # The monetary currency of the promo code.
132
+ currency:,
133
+ # The duration setting for the promo code
134
+ duration:,
135
+ # Restricts promo use to only be applied to already purchased memberships.
136
+ existing_memberships_only:,
137
+ # The date/time of when the promo expires.
138
+ expires_at:,
139
+ # Restricts promo use to only users who have never purchased from the company
140
+ # before.
141
+ new_users_only:,
142
+ # Restricts promo use to only be applied once per customer.
143
+ one_per_customer:,
144
+ # The access pass associated with the promo code.
145
+ product:,
146
+ # The number of months the promo is applied for.
147
+ promo_duration_months:,
148
+ # The type (% or flat amount) of the promo.
149
+ promo_type:,
150
+ # Indicates if the promo code is live or disabled.
151
+ status:,
152
+ # The quantity limit on the number of uses.
153
+ stock:,
154
+ # Whether or not the promo code has unlimited stock.
155
+ unlimited_stock:,
156
+ # The amount of times the promo codes has been used.
157
+ uses:
158
+ )
159
+ end
160
+
161
+ sig do
162
+ override.returns(
163
+ {
164
+ id: String,
165
+ amount_off: Float,
166
+ churned_users_only: T::Boolean,
167
+ code: T.nilable(String),
168
+ company: WhopSDK::PromoCode::Company,
169
+ created_at: Time,
170
+ currency: WhopSDK::Currency::TaggedSymbol,
171
+ duration: T.nilable(WhopSDK::PromoDuration::TaggedSymbol),
172
+ existing_memberships_only: T::Boolean,
173
+ expires_at: T.nilable(Time),
174
+ new_users_only: T::Boolean,
175
+ one_per_customer: T::Boolean,
176
+ product: T.nilable(WhopSDK::PromoCode::Product),
177
+ promo_duration_months: T.nilable(Integer),
178
+ promo_type: WhopSDK::PromoType::TaggedSymbol,
179
+ status: WhopSDK::PromoCodeStatus::TaggedSymbol,
180
+ stock: Integer,
181
+ unlimited_stock: T::Boolean,
182
+ uses: Integer
183
+ }
184
+ )
185
+ end
186
+ def to_hash
187
+ end
188
+
189
+ class Company < WhopSDK::Internal::Type::BaseModel
190
+ OrHash =
191
+ T.type_alias do
192
+ T.any(WhopSDK::PromoCode::Company, WhopSDK::Internal::AnyHash)
193
+ end
194
+
195
+ # The ID of the company
196
+ sig { returns(String) }
197
+ attr_accessor :id
198
+
199
+ # The written name of the company.
200
+ sig { returns(String) }
201
+ attr_accessor :title
202
+
203
+ # The company for the promo code.
204
+ sig { params(id: String, title: String).returns(T.attached_class) }
205
+ def self.new(
206
+ # The ID of the company
207
+ id:,
208
+ # The written name of the company.
209
+ title:
210
+ )
211
+ end
212
+
213
+ sig { override.returns({ id: String, title: String }) }
214
+ def to_hash
215
+ end
216
+ end
217
+
218
+ class Product < WhopSDK::Internal::Type::BaseModel
219
+ OrHash =
220
+ T.type_alias do
221
+ T.any(WhopSDK::PromoCode::Product, WhopSDK::Internal::AnyHash)
222
+ end
223
+
224
+ # The internal ID of the public product.
225
+ sig { returns(String) }
226
+ attr_accessor :id
227
+
228
+ # The title of the product. Use for Whop 4.0.
229
+ sig { returns(String) }
230
+ attr_accessor :title
231
+
232
+ # The access pass associated with the promo code.
233
+ sig { params(id: String, title: String).returns(T.attached_class) }
234
+ def self.new(
235
+ # The internal ID of the public product.
236
+ id:,
237
+ # The title of the product. Use for Whop 4.0.
238
+ title:
239
+ )
240
+ end
241
+
242
+ sig { override.returns({ id: String, title: String }) }
243
+ def to_hash
244
+ end
245
+ end
246
+ end
247
+ end
248
+ end
@@ -0,0 +1,161 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class PromoCodeCreateParams < WhopSDK::Internal::Type::BaseModel
6
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
7
+ include WhopSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(WhopSDK::PromoCodeCreateParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The amount off (% or flat amount) for the promo.
15
+ sig { returns(Float) }
16
+ attr_accessor :amount_off
17
+
18
+ # The monetary currency of the promo code.
19
+ sig { returns(WhopSDK::Currency::OrSymbol) }
20
+ attr_accessor :base_currency
21
+
22
+ # The specific code used to apply the promo at checkout.
23
+ sig { returns(String) }
24
+ attr_accessor :code
25
+
26
+ # The id of the company to create the promo code for.
27
+ sig { returns(String) }
28
+ attr_accessor :company_id
29
+
30
+ # Restricts promo use to only users who have never purchased from the company
31
+ # before.
32
+ sig { returns(T::Boolean) }
33
+ attr_accessor :new_users_only
34
+
35
+ # The number of months this promo code is applied and valid for.
36
+ sig { returns(Integer) }
37
+ attr_accessor :promo_duration_months
38
+
39
+ # The type (% or flat amount) of the promo.
40
+ sig { returns(WhopSDK::PromoType::OrSymbol) }
41
+ attr_accessor :promo_type
42
+
43
+ # Restricts promo use to only users who have churned from the company before.
44
+ sig { returns(T.nilable(T::Boolean)) }
45
+ attr_accessor :churned_users_only
46
+
47
+ # Whether this promo code is for existing memberships only (cancelations)
48
+ sig { returns(T.nilable(T::Boolean)) }
49
+ attr_accessor :existing_memberships_only
50
+
51
+ # The date/time of when the promo expires.
52
+ sig { returns(T.nilable(Time)) }
53
+ attr_accessor :expires_at
54
+
55
+ # Restricts promo use to only be applied once per customer.
56
+ sig { returns(T.nilable(T::Boolean)) }
57
+ attr_accessor :one_per_customer
58
+
59
+ # The IDs of the plans that the promo code applies to. If product_id is provided,
60
+ # it will only apply to plans attached to that product
61
+ sig { returns(T.nilable(T::Array[String])) }
62
+ attr_accessor :plan_ids
63
+
64
+ # The product to lock the promo code to, if any. If provided will filter out any
65
+ # plan ids not attached to this product
66
+ sig { returns(T.nilable(String)) }
67
+ attr_accessor :product_id
68
+
69
+ # The quantity limit on the number of uses.
70
+ sig { returns(T.nilable(Integer)) }
71
+ attr_accessor :stock
72
+
73
+ # Whether or not the promo code should have unlimited stock.
74
+ sig { returns(T.nilable(T::Boolean)) }
75
+ attr_accessor :unlimited_stock
76
+
77
+ sig do
78
+ params(
79
+ amount_off: Float,
80
+ base_currency: WhopSDK::Currency::OrSymbol,
81
+ code: String,
82
+ company_id: String,
83
+ new_users_only: T::Boolean,
84
+ promo_duration_months: Integer,
85
+ promo_type: WhopSDK::PromoType::OrSymbol,
86
+ churned_users_only: T.nilable(T::Boolean),
87
+ existing_memberships_only: T.nilable(T::Boolean),
88
+ expires_at: T.nilable(Time),
89
+ one_per_customer: T.nilable(T::Boolean),
90
+ plan_ids: T.nilable(T::Array[String]),
91
+ product_id: T.nilable(String),
92
+ stock: T.nilable(Integer),
93
+ unlimited_stock: T.nilable(T::Boolean),
94
+ request_options: WhopSDK::RequestOptions::OrHash
95
+ ).returns(T.attached_class)
96
+ end
97
+ def self.new(
98
+ # The amount off (% or flat amount) for the promo.
99
+ amount_off:,
100
+ # The monetary currency of the promo code.
101
+ base_currency:,
102
+ # The specific code used to apply the promo at checkout.
103
+ code:,
104
+ # The id of the company to create the promo code for.
105
+ company_id:,
106
+ # Restricts promo use to only users who have never purchased from the company
107
+ # before.
108
+ new_users_only:,
109
+ # The number of months this promo code is applied and valid for.
110
+ promo_duration_months:,
111
+ # The type (% or flat amount) of the promo.
112
+ promo_type:,
113
+ # Restricts promo use to only users who have churned from the company before.
114
+ churned_users_only: nil,
115
+ # Whether this promo code is for existing memberships only (cancelations)
116
+ existing_memberships_only: nil,
117
+ # The date/time of when the promo expires.
118
+ expires_at: nil,
119
+ # Restricts promo use to only be applied once per customer.
120
+ one_per_customer: nil,
121
+ # The IDs of the plans that the promo code applies to. If product_id is provided,
122
+ # it will only apply to plans attached to that product
123
+ plan_ids: nil,
124
+ # The product to lock the promo code to, if any. If provided will filter out any
125
+ # plan ids not attached to this product
126
+ product_id: nil,
127
+ # The quantity limit on the number of uses.
128
+ stock: nil,
129
+ # Whether or not the promo code should have unlimited stock.
130
+ unlimited_stock: nil,
131
+ request_options: {}
132
+ )
133
+ end
134
+
135
+ sig do
136
+ override.returns(
137
+ {
138
+ amount_off: Float,
139
+ base_currency: WhopSDK::Currency::OrSymbol,
140
+ code: String,
141
+ company_id: String,
142
+ new_users_only: T::Boolean,
143
+ promo_duration_months: Integer,
144
+ promo_type: WhopSDK::PromoType::OrSymbol,
145
+ churned_users_only: T.nilable(T::Boolean),
146
+ existing_memberships_only: T.nilable(T::Boolean),
147
+ expires_at: T.nilable(Time),
148
+ one_per_customer: T.nilable(T::Boolean),
149
+ plan_ids: T.nilable(T::Array[String]),
150
+ product_id: T.nilable(String),
151
+ stock: T.nilable(Integer),
152
+ unlimited_stock: T.nilable(T::Boolean),
153
+ request_options: WhopSDK::RequestOptions
154
+ }
155
+ )
156
+ end
157
+ def to_hash
158
+ end
159
+ end
160
+ end
161
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class PromoCodeDeleteParams < WhopSDK::Internal::Type::BaseModel
6
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
7
+ include WhopSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(WhopSDK::PromoCodeDeleteParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: WhopSDK::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: WhopSDK::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,8 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ PromoCodeDeleteResponse =
6
+ T.let(T::Boolean, WhopSDK::Internal::Type::Converter)
7
+ end
8
+ end