whop_sdk 0.0.2 → 0.0.3

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 (263) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +20 -0
  5. data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +30 -24
  6. data/lib/whop_sdk/models/assessment_question_types.rb +18 -0
  7. data/lib/whop_sdk/models/billing_reasons.rb +20 -0
  8. data/lib/whop_sdk/models/card_brands.rb +30 -0
  9. data/lib/whop_sdk/models/checkout_configuration.rb +10 -7
  10. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +140 -3
  11. data/lib/whop_sdk/models/checkout_configuration_list_response.rb +10 -7
  12. data/lib/whop_sdk/models/course.rb +230 -0
  13. data/lib/whop_sdk/models/course_chapter.rb +72 -0
  14. data/lib/whop_sdk/models/course_chapter_create_params.rb +30 -0
  15. data/lib/whop_sdk/models/course_chapter_delete_params.rb +14 -0
  16. data/lib/whop_sdk/models/course_chapter_delete_response.rb +8 -0
  17. data/lib/whop_sdk/models/course_chapter_list_params.rb +54 -0
  18. data/lib/whop_sdk/models/course_chapter_list_response.rb +35 -0
  19. data/lib/whop_sdk/models/course_chapter_retrieve_params.rb +14 -0
  20. data/lib/whop_sdk/models/course_chapter_update_params.rb +22 -0
  21. data/lib/whop_sdk/models/course_create_params.rb +82 -0
  22. data/lib/whop_sdk/models/course_delete_params.rb +14 -0
  23. data/lib/whop_sdk/models/course_delete_response.rb +8 -0
  24. data/lib/whop_sdk/models/course_lesson_create_params.rb +54 -0
  25. data/lib/whop_sdk/models/course_lesson_delete_params.rb +14 -0
  26. data/lib/whop_sdk/models/course_lesson_delete_response.rb +8 -0
  27. data/lib/whop_sdk/models/course_lesson_list_params.rb +62 -0
  28. data/lib/whop_sdk/models/course_lesson_list_response.rb +71 -0
  29. data/lib/whop_sdk/models/course_lesson_retrieve_params.rb +14 -0
  30. data/lib/whop_sdk/models/course_lesson_update_params.rb +278 -0
  31. data/lib/whop_sdk/models/course_list_params.rb +62 -0
  32. data/lib/whop_sdk/models/course_list_response.rb +148 -0
  33. data/lib/whop_sdk/models/course_retrieve_params.rb +14 -0
  34. data/lib/whop_sdk/models/course_update_params.rb +197 -0
  35. data/lib/whop_sdk/models/experience_duplicate_params.rb +22 -0
  36. data/lib/whop_sdk/models/forum_post.rb +17 -1
  37. data/lib/whop_sdk/models/forum_post_list_response.rb +17 -1
  38. data/lib/whop_sdk/models/forum_post_update_params.rb +80 -0
  39. data/lib/whop_sdk/models/invoice.rb +6 -2
  40. data/lib/whop_sdk/models/invoice_list_item.rb +6 -2
  41. data/lib/whop_sdk/models/languages.rb +36 -0
  42. data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +9 -0
  43. data/lib/whop_sdk/models/lesson.rb +365 -0
  44. data/lib/whop_sdk/models/lesson_types.rb +20 -0
  45. data/lib/whop_sdk/models/lesson_visibilities.rb +17 -0
  46. data/lib/whop_sdk/models/member_list_params.rb +9 -1
  47. data/lib/whop_sdk/models/membership.rb +31 -1
  48. data/lib/whop_sdk/models/membership_list_params.rb +16 -8
  49. data/lib/whop_sdk/models/membership_list_response.rb +31 -1
  50. data/lib/whop_sdk/models/message_update_params.rb +68 -0
  51. data/lib/whop_sdk/models/payment.rb +24 -21
  52. data/lib/whop_sdk/models/payment_list_params.rb +3 -18
  53. data/lib/whop_sdk/models/payment_list_response.rb +24 -21
  54. data/lib/whop_sdk/models/payment_method_types.rb +98 -0
  55. data/lib/whop_sdk/models/plan.rb +25 -1
  56. data/lib/whop_sdk/models/plan_create_params.rb +37 -3
  57. data/lib/whop_sdk/models/plan_list_response.rb +25 -1
  58. data/lib/whop_sdk/models/plan_update_params.rb +35 -1
  59. data/lib/whop_sdk/models/product.rb +11 -1
  60. data/lib/whop_sdk/models/product_create_params.rb +1 -45
  61. data/lib/whop_sdk/models/product_list_item.rb +14 -1
  62. data/lib/whop_sdk/models/product_update_params.rb +30 -1
  63. data/lib/whop_sdk/models/promo_code.rb +211 -0
  64. data/lib/whop_sdk/models/promo_code_create_params.rb +140 -0
  65. data/lib/whop_sdk/models/promo_code_delete_params.rb +14 -0
  66. data/lib/whop_sdk/models/promo_code_delete_response.rb +8 -0
  67. data/lib/whop_sdk/models/promo_code_list_params.rb +78 -0
  68. data/lib/whop_sdk/models/promo_code_list_response.rb +181 -0
  69. data/lib/whop_sdk/models/promo_code_retrieve_params.rb +14 -0
  70. data/lib/whop_sdk/models/promo_code_status.rb +17 -0
  71. data/lib/whop_sdk/models/promo_duration.rb +17 -0
  72. data/lib/whop_sdk/models/review_list_params.rb +70 -0
  73. data/lib/whop_sdk/models/review_list_response.rb +183 -0
  74. data/lib/whop_sdk/models/review_retrieve_params.rb +14 -0
  75. data/lib/whop_sdk/models/review_retrieve_response.rb +251 -0
  76. data/lib/whop_sdk/models/review_status.rb +17 -0
  77. data/lib/whop_sdk/models.rb +76 -0
  78. data/lib/whop_sdk/resources/checkout_configurations.rb +2 -0
  79. data/lib/whop_sdk/resources/course_chapters.rb +151 -0
  80. data/lib/whop_sdk/resources/course_lessons.rb +178 -0
  81. data/lib/whop_sdk/resources/courses.rb +178 -0
  82. data/lib/whop_sdk/resources/experiences.rb +33 -0
  83. data/lib/whop_sdk/resources/forum_posts.rb +33 -0
  84. data/lib/whop_sdk/resources/members.rb +3 -1
  85. data/lib/whop_sdk/resources/memberships.rb +6 -4
  86. data/lib/whop_sdk/resources/messages.rb +28 -0
  87. data/lib/whop_sdk/resources/payments.rb +1 -1
  88. data/lib/whop_sdk/resources/plans.rb +19 -3
  89. data/lib/whop_sdk/resources/products.rb +4 -6
  90. data/lib/whop_sdk/resources/promo_codes.rb +161 -0
  91. data/lib/whop_sdk/resources/reviews.rb +68 -0
  92. data/lib/whop_sdk/version.rb +1 -1
  93. data/lib/whop_sdk.rb +53 -0
  94. data/rbi/whop_sdk/client.rbi +15 -0
  95. data/rbi/whop_sdk/models/assessment_question_types.rbi +31 -0
  96. data/rbi/whop_sdk/models/billing_reasons.rbi +27 -0
  97. data/rbi/whop_sdk/models/card_brands.rbi +35 -0
  98. data/rbi/whop_sdk/models/checkout_configuration.rbi +4 -2
  99. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +183 -2
  100. data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +4 -2
  101. data/rbi/whop_sdk/models/course.rbi +313 -0
  102. data/rbi/whop_sdk/models/course_chapter.rbi +101 -0
  103. data/rbi/whop_sdk/models/course_chapter_create_params.rbi +51 -0
  104. data/rbi/whop_sdk/models/course_chapter_delete_params.rbi +27 -0
  105. data/rbi/whop_sdk/models/course_chapter_delete_response.rbi +8 -0
  106. data/rbi/whop_sdk/models/course_chapter_list_params.rbi +75 -0
  107. data/rbi/whop_sdk/models/course_chapter_list_response.rbi +47 -0
  108. data/rbi/whop_sdk/models/course_chapter_retrieve_params.rbi +30 -0
  109. data/rbi/whop_sdk/models/course_chapter_update_params.rbi +40 -0
  110. data/rbi/whop_sdk/models/course_create_params.rbi +131 -0
  111. data/rbi/whop_sdk/models/course_delete_params.rbi +27 -0
  112. data/rbi/whop_sdk/models/course_delete_response.rbi +7 -0
  113. data/rbi/whop_sdk/models/course_lesson_create_params.rbi +75 -0
  114. data/rbi/whop_sdk/models/course_lesson_delete_params.rbi +27 -0
  115. data/rbi/whop_sdk/models/course_lesson_delete_response.rbi +8 -0
  116. data/rbi/whop_sdk/models/course_lesson_list_params.rbi +83 -0
  117. data/rbi/whop_sdk/models/course_lesson_list_response.rbi +91 -0
  118. data/rbi/whop_sdk/models/course_lesson_retrieve_params.rbi +27 -0
  119. data/rbi/whop_sdk/models/course_lesson_update_params.rbi +465 -0
  120. data/rbi/whop_sdk/models/course_list_params.rbi +83 -0
  121. data/rbi/whop_sdk/models/course_list_response.rbi +198 -0
  122. data/rbi/whop_sdk/models/course_retrieve_params.rbi +27 -0
  123. data/rbi/whop_sdk/models/course_update_params.rbi +293 -0
  124. data/rbi/whop_sdk/models/experience_duplicate_params.rbi +40 -0
  125. data/rbi/whop_sdk/models/forum_post.rbi +16 -0
  126. data/rbi/whop_sdk/models/forum_post_list_response.rbi +16 -0
  127. data/rbi/whop_sdk/models/forum_post_update_params.rbi +124 -0
  128. data/rbi/whop_sdk/models/invoice.rbi +4 -2
  129. data/rbi/whop_sdk/models/invoice_list_item.rbi +4 -2
  130. data/rbi/whop_sdk/models/languages.rbi +40 -0
  131. data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +45 -0
  132. data/rbi/whop_sdk/models/lesson.rbi +517 -0
  133. data/rbi/whop_sdk/models/lesson_types.rbi +25 -0
  134. data/rbi/whop_sdk/models/lesson_visibilities.rbi +23 -0
  135. data/rbi/whop_sdk/models/member_list_params.rbi +8 -0
  136. data/rbi/whop_sdk/models/membership.rbi +40 -0
  137. data/rbi/whop_sdk/models/membership_list_params.rbi +16 -8
  138. data/rbi/whop_sdk/models/membership_list_response.rbi +47 -0
  139. data/rbi/whop_sdk/models/message_update_params.rbi +114 -0
  140. data/rbi/whop_sdk/models/payment.rbi +32 -25
  141. data/rbi/whop_sdk/models/payment_list_params.rbi +3 -63
  142. data/rbi/whop_sdk/models/payment_list_response.rbi +32 -25
  143. data/rbi/whop_sdk/models/payment_method_types.rbi +116 -0
  144. data/rbi/whop_sdk/models/plan.rbi +24 -0
  145. data/rbi/whop_sdk/models/plan_create_params.rbi +38 -2
  146. data/rbi/whop_sdk/models/plan_list_response.rbi +24 -0
  147. data/rbi/whop_sdk/models/plan_update_params.rbi +36 -0
  148. data/rbi/whop_sdk/models/product.rbi +12 -0
  149. data/rbi/whop_sdk/models/product_create_params.rbi +0 -74
  150. data/rbi/whop_sdk/models/product_list_item.rbi +12 -0
  151. data/rbi/whop_sdk/models/product_update_params.rbi +59 -0
  152. data/rbi/whop_sdk/models/promo_code.rbi +248 -0
  153. data/rbi/whop_sdk/models/promo_code_create_params.rbi +161 -0
  154. data/rbi/whop_sdk/models/promo_code_delete_params.rbi +27 -0
  155. data/rbi/whop_sdk/models/promo_code_delete_response.rbi +8 -0
  156. data/rbi/whop_sdk/models/promo_code_list_params.rbi +99 -0
  157. data/rbi/whop_sdk/models/promo_code_list_response.rbi +222 -0
  158. data/rbi/whop_sdk/models/promo_code_retrieve_params.rbi +27 -0
  159. data/rbi/whop_sdk/models/promo_code_status.rbi +21 -0
  160. data/rbi/whop_sdk/models/promo_duration.rbi +21 -0
  161. data/rbi/whop_sdk/models/review_list_params.rbi +91 -0
  162. data/rbi/whop_sdk/models/review_list_response.rbi +243 -0
  163. data/rbi/whop_sdk/models/review_retrieve_params.rbi +27 -0
  164. data/rbi/whop_sdk/models/review_retrieve_response.rbi +354 -0
  165. data/rbi/whop_sdk/models/review_status.rbi +21 -0
  166. data/rbi/whop_sdk/models.rbi +76 -0
  167. data/rbi/whop_sdk/resources/checkout_configurations.rbi +2 -0
  168. data/rbi/whop_sdk/resources/course_chapters.rbi +115 -0
  169. data/rbi/whop_sdk/resources/course_lessons.rbi +163 -0
  170. data/rbi/whop_sdk/resources/courses.rbi +152 -0
  171. data/rbi/whop_sdk/resources/experiences.rbi +25 -0
  172. data/rbi/whop_sdk/resources/forum_posts.rbi +29 -0
  173. data/rbi/whop_sdk/resources/members.rbi +3 -0
  174. data/rbi/whop_sdk/resources/memberships.rbi +6 -3
  175. data/rbi/whop_sdk/resources/messages.rbi +25 -0
  176. data/rbi/whop_sdk/resources/payments.rbi +1 -3
  177. data/rbi/whop_sdk/resources/plans.rbi +29 -1
  178. data/rbi/whop_sdk/resources/products.rbi +4 -7
  179. data/rbi/whop_sdk/resources/promo_codes.rbi +147 -0
  180. data/rbi/whop_sdk/resources/reviews.rbi +56 -0
  181. data/sig/whop_sdk/client.rbs +10 -0
  182. data/sig/whop_sdk/models/assessment_question_types.rbs +17 -0
  183. data/sig/whop_sdk/models/billing_reasons.rbs +24 -0
  184. data/sig/whop_sdk/models/card_brands.rbs +44 -0
  185. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +87 -0
  186. data/sig/whop_sdk/models/course.rbs +171 -0
  187. data/sig/whop_sdk/models/course_chapter.rbs +49 -0
  188. data/sig/whop_sdk/models/course_chapter_create_params.rbs +28 -0
  189. data/sig/whop_sdk/models/course_chapter_delete_params.rbs +15 -0
  190. data/sig/whop_sdk/models/course_chapter_delete_response.rbs +5 -0
  191. data/sig/whop_sdk/models/course_chapter_list_params.rbs +46 -0
  192. data/sig/whop_sdk/models/course_chapter_list_response.rbs +18 -0
  193. data/sig/whop_sdk/models/course_chapter_retrieve_params.rbs +15 -0
  194. data/sig/whop_sdk/models/course_chapter_update_params.rbs +23 -0
  195. data/sig/whop_sdk/models/course_create_params.rbs +58 -0
  196. data/sig/whop_sdk/models/course_delete_params.rbs +15 -0
  197. data/sig/whop_sdk/models/course_delete_response.rbs +5 -0
  198. data/sig/whop_sdk/models/course_lesson_create_params.rbs +46 -0
  199. data/sig/whop_sdk/models/course_lesson_delete_params.rbs +15 -0
  200. data/sig/whop_sdk/models/course_lesson_delete_response.rbs +5 -0
  201. data/sig/whop_sdk/models/course_lesson_list_params.rbs +51 -0
  202. data/sig/whop_sdk/models/course_lesson_list_response.rbs +50 -0
  203. data/sig/whop_sdk/models/course_lesson_retrieve_params.rbs +15 -0
  204. data/sig/whop_sdk/models/course_lesson_update_params.rbs +162 -0
  205. data/sig/whop_sdk/models/course_list_params.rbs +51 -0
  206. data/sig/whop_sdk/models/course_list_response.rbs +102 -0
  207. data/sig/whop_sdk/models/course_retrieve_params.rbs +15 -0
  208. data/sig/whop_sdk/models/course_update_params.rbs +137 -0
  209. data/sig/whop_sdk/models/experience_duplicate_params.rbs +23 -0
  210. data/sig/whop_sdk/models/forum_post.rbs +10 -0
  211. data/sig/whop_sdk/models/forum_post_list_response.rbs +10 -0
  212. data/sig/whop_sdk/models/forum_post_update_params.rbs +53 -0
  213. data/sig/whop_sdk/models/languages.rbs +56 -0
  214. data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +20 -1
  215. data/sig/whop_sdk/models/lesson.rbs +248 -0
  216. data/sig/whop_sdk/models/lesson_types.rbs +19 -0
  217. data/sig/whop_sdk/models/lesson_visibilities.rbs +14 -0
  218. data/sig/whop_sdk/models/member_list_params.rbs +6 -1
  219. data/sig/whop_sdk/models/membership.rbs +17 -0
  220. data/sig/whop_sdk/models/membership_list_params.rbs +11 -6
  221. data/sig/whop_sdk/models/membership_list_response.rbs +17 -0
  222. data/sig/whop_sdk/models/message_update_params.rbs +48 -0
  223. data/sig/whop_sdk/models/payment.rbs +12 -12
  224. data/sig/whop_sdk/models/payment_list_params.rbs +4 -25
  225. data/sig/whop_sdk/models/payment_list_response.rbs +12 -12
  226. data/sig/whop_sdk/models/payment_method_types.rbs +180 -0
  227. data/sig/whop_sdk/models/plan.rbs +15 -0
  228. data/sig/whop_sdk/models/plan_create_params.rbs +20 -0
  229. data/sig/whop_sdk/models/plan_list_response.rbs +15 -0
  230. data/sig/whop_sdk/models/plan_update_params.rbs +20 -0
  231. data/sig/whop_sdk/models/product.rbs +5 -0
  232. data/sig/whop_sdk/models/product_create_params.rbs +0 -22
  233. data/sig/whop_sdk/models/product_list_item.rbs +5 -0
  234. data/sig/whop_sdk/models/product_update_params.rbs +17 -0
  235. data/sig/whop_sdk/models/promo_code.rbs +134 -0
  236. data/sig/whop_sdk/models/promo_code_create_params.rbs +96 -0
  237. data/sig/whop_sdk/models/promo_code_delete_params.rbs +15 -0
  238. data/sig/whop_sdk/models/promo_code_delete_response.rbs +5 -0
  239. data/sig/whop_sdk/models/promo_code_list_params.rbs +61 -0
  240. data/sig/whop_sdk/models/promo_code_list_response.rbs +117 -0
  241. data/sig/whop_sdk/models/promo_code_retrieve_params.rbs +15 -0
  242. data/sig/whop_sdk/models/promo_code_status.rbs +15 -0
  243. data/sig/whop_sdk/models/promo_duration.rbs +15 -0
  244. data/sig/whop_sdk/models/review_list_params.rbs +56 -0
  245. data/sig/whop_sdk/models/review_list_response.rbs +116 -0
  246. data/sig/whop_sdk/models/review_retrieve_params.rbs +15 -0
  247. data/sig/whop_sdk/models/review_retrieve_response.rbs +152 -0
  248. data/sig/whop_sdk/models/review_status.rbs +15 -0
  249. data/sig/whop_sdk/models.rbs +76 -0
  250. data/sig/whop_sdk/resources/course_chapters.rbs +35 -0
  251. data/sig/whop_sdk/resources/course_lessons.rbs +47 -0
  252. data/sig/whop_sdk/resources/courses.rbs +47 -0
  253. data/sig/whop_sdk/resources/experiences.rbs +6 -0
  254. data/sig/whop_sdk/resources/forum_posts.rbs +9 -0
  255. data/sig/whop_sdk/resources/members.rbs +1 -0
  256. data/sig/whop_sdk/resources/memberships.rbs +2 -1
  257. data/sig/whop_sdk/resources/messages.rbs +8 -0
  258. data/sig/whop_sdk/resources/payments.rbs +1 -1
  259. data/sig/whop_sdk/resources/plans.rbs +8 -0
  260. data/sig/whop_sdk/resources/products.rbs +1 -2
  261. data/sig/whop_sdk/resources/promo_codes.rbs +45 -0
  262. data/sig/whop_sdk/resources/reviews.rbs +23 -0
  263. metadata +189 -2
@@ -19,22 +19,6 @@ module WhopSDK
19
19
  sig { returns(String) }
20
20
  attr_accessor :title
21
21
 
22
- # The different types an access pass can be.
23
- sig { returns(T.nilable(WhopSDK::AccessPassType::OrSymbol)) }
24
- attr_accessor :access_pass_type
25
-
26
- # A banner image for the product in png, jpeg format
27
- sig { returns(T.nilable(WhopSDK::ProductCreateParams::BannerImage)) }
28
- attr_reader :banner_image
29
-
30
- sig do
31
- params(
32
- banner_image:
33
- T.nilable(WhopSDK::ProductCreateParams::BannerImage::OrHash)
34
- ).void
35
- end
36
- attr_writer :banner_image
37
-
38
22
  # The different business types a company can be.
39
23
  sig { returns(T.nilable(WhopSDK::BusinessTypes::OrSymbol)) }
40
24
  attr_accessor :business_type
@@ -129,9 +113,6 @@ module WhopSDK
129
113
  params(
130
114
  company_id: String,
131
115
  title: String,
132
- access_pass_type: T.nilable(WhopSDK::AccessPassType::OrSymbol),
133
- banner_image:
134
- T.nilable(WhopSDK::ProductCreateParams::BannerImage::OrHash),
135
116
  business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
136
117
  collect_shipping_address: T.nilable(T::Boolean),
137
118
  custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol),
@@ -165,10 +146,6 @@ module WhopSDK
165
146
  company_id:,
166
147
  # The title of the product.
167
148
  title:,
168
- # The different types an access pass can be.
169
- access_pass_type: nil,
170
- # A banner image for the product in png, jpeg format
171
- banner_image: nil,
172
149
  # The different business types a company can be.
173
150
  business_type: nil,
174
151
  # Whether or not to collect shipping information at checkout from the customer.
@@ -218,8 +195,6 @@ module WhopSDK
218
195
  {
219
196
  company_id: String,
220
197
  title: String,
221
- access_pass_type: T.nilable(WhopSDK::AccessPassType::OrSymbol),
222
- banner_image: T.nilable(WhopSDK::ProductCreateParams::BannerImage),
223
198
  business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
224
199
  collect_shipping_address: T.nilable(T::Boolean),
225
200
  custom_cta: T.nilable(WhopSDK::CustomCta::OrSymbol),
@@ -251,55 +226,6 @@ module WhopSDK
251
226
  def to_hash
252
227
  end
253
228
 
254
- class BannerImage < WhopSDK::Internal::Type::BaseModel
255
- OrHash =
256
- T.type_alias do
257
- T.any(
258
- WhopSDK::ProductCreateParams::BannerImage,
259
- WhopSDK::Internal::AnyHash
260
- )
261
- end
262
-
263
- # The ID of an existing attachment object. Use this when updating a resource and
264
- # keeping a subset of the attachments. Don't use this unless you know what you're
265
- # doing.
266
- sig { returns(T.nilable(String)) }
267
- attr_accessor :id
268
-
269
- # This ID should be used the first time you upload an attachment. It is the ID of
270
- # the direct upload that was created when uploading the file to S3 via the
271
- # mediaDirectUpload mutation.
272
- sig { returns(T.nilable(String)) }
273
- attr_accessor :direct_upload_id
274
-
275
- # A banner image for the product in png, jpeg format
276
- sig do
277
- params(
278
- id: T.nilable(String),
279
- direct_upload_id: T.nilable(String)
280
- ).returns(T.attached_class)
281
- end
282
- def self.new(
283
- # The ID of an existing attachment object. Use this when updating a resource and
284
- # keeping a subset of the attachments. Don't use this unless you know what you're
285
- # doing.
286
- id: nil,
287
- # This ID should be used the first time you upload an attachment. It is the ID of
288
- # the direct upload that was created when uploading the file to S3 via the
289
- # mediaDirectUpload mutation.
290
- direct_upload_id: nil
291
- )
292
- end
293
-
294
- sig do
295
- override.returns(
296
- { id: T.nilable(String), direct_upload_id: T.nilable(String) }
297
- )
298
- end
299
- def to_hash
300
- end
301
- end
302
-
303
229
  class PlanOptions < WhopSDK::Internal::Type::BaseModel
304
230
  OrHash =
305
231
  T.type_alias do
@@ -20,6 +20,12 @@ module WhopSDK
20
20
  sig { returns(Time) }
21
21
  attr_accessor :created_at
22
22
 
23
+ # A unique identifier used to create or update products. When provided on product
24
+ # creation endpoints, we’ll look up an existing product by this identifier — if it
25
+ # exists, we’ll update it; if not, we’ll create a new one.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_accessor :external_identifier
28
+
23
29
  # The headline of the product.
24
30
  sig { returns(T.nilable(String)) }
25
31
  attr_accessor :headline
@@ -62,6 +68,7 @@ module WhopSDK
62
68
  id: String,
63
69
  business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
64
70
  created_at: Time,
71
+ external_identifier: T.nilable(String),
65
72
  headline: T.nilable(String),
66
73
  industry_type: T.nilable(WhopSDK::IndustryTypes::OrSymbol),
67
74
  member_count: Integer,
@@ -80,6 +87,10 @@ module WhopSDK
80
87
  business_type:,
81
88
  # When the product was created.
82
89
  created_at:,
90
+ # A unique identifier used to create or update products. When provided on product
91
+ # creation endpoints, we’ll look up an existing product by this identifier — if it
92
+ # exists, we’ll update it; if not, we’ll create a new one.
93
+ external_identifier:,
83
94
  # The headline of the product.
84
95
  headline:,
85
96
  # The different industry types a company can be in.
@@ -107,6 +118,7 @@ module WhopSDK
107
118
  id: String,
108
119
  business_type: T.nilable(WhopSDK::BusinessTypes::TaggedSymbol),
109
120
  created_at: Time,
121
+ external_identifier: T.nilable(String),
110
122
  headline: T.nilable(String),
111
123
  industry_type: T.nilable(WhopSDK::IndustryTypes::TaggedSymbol),
112
124
  member_count: Integer,
@@ -85,6 +85,18 @@ module WhopSDK
85
85
  sig { returns(T.nilable(String)) }
86
86
  attr_accessor :route
87
87
 
88
+ # Configuration for a product on the company's store page.
89
+ sig { returns(T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig)) }
90
+ attr_reader :store_page_config
91
+
92
+ sig do
93
+ params(
94
+ store_page_config:
95
+ T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash)
96
+ ).void
97
+ end
98
+ attr_writer :store_page_config
99
+
88
100
  # The title of the product.
89
101
  sig { returns(T.nilable(String)) }
90
102
  attr_accessor :title
@@ -114,6 +126,8 @@ module WhopSDK
114
126
  product_tax_code_id: T.nilable(String),
115
127
  redirect_purchase_url: T.nilable(String),
116
128
  route: T.nilable(String),
129
+ store_page_config:
130
+ T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig::OrHash),
117
131
  title: T.nilable(String),
118
132
  visibility: T.nilable(WhopSDK::Visibility::OrSymbol),
119
133
  request_options: WhopSDK::RequestOptions::OrHash
@@ -154,6 +168,8 @@ module WhopSDK
154
168
  redirect_purchase_url: nil,
155
169
  # The route of the product.
156
170
  route: nil,
171
+ # Configuration for a product on the company's store page.
172
+ store_page_config: nil,
157
173
  # The title of the product.
158
174
  title: nil,
159
175
  # Visibility of a resource
@@ -183,6 +199,8 @@ module WhopSDK
183
199
  product_tax_code_id: T.nilable(String),
184
200
  redirect_purchase_url: T.nilable(String),
185
201
  route: T.nilable(String),
202
+ store_page_config:
203
+ T.nilable(WhopSDK::ProductUpdateParams::StorePageConfig),
186
204
  title: T.nilable(String),
187
205
  visibility: T.nilable(WhopSDK::Visibility::OrSymbol),
188
206
  request_options: WhopSDK::RequestOptions
@@ -240,6 +258,47 @@ module WhopSDK
240
258
  def to_hash
241
259
  end
242
260
  end
261
+
262
+ class StorePageConfig < WhopSDK::Internal::Type::BaseModel
263
+ OrHash =
264
+ T.type_alias do
265
+ T.any(
266
+ WhopSDK::ProductUpdateParams::StorePageConfig,
267
+ WhopSDK::Internal::AnyHash
268
+ )
269
+ end
270
+
271
+ # Custom call-to-action text for the product's store page.
272
+ sig { returns(T.nilable(String)) }
273
+ attr_accessor :custom_cta
274
+
275
+ # Whether or not to show the price on the product's store page.
276
+ sig { returns(T.nilable(T::Boolean)) }
277
+ attr_accessor :show_price
278
+
279
+ # Configuration for a product on the company's store page.
280
+ sig do
281
+ params(
282
+ custom_cta: T.nilable(String),
283
+ show_price: T.nilable(T::Boolean)
284
+ ).returns(T.attached_class)
285
+ end
286
+ def self.new(
287
+ # Custom call-to-action text for the product's store page.
288
+ custom_cta: nil,
289
+ # Whether or not to show the price on the product's store page.
290
+ show_price: nil
291
+ )
292
+ end
293
+
294
+ sig do
295
+ override.returns(
296
+ { custom_cta: T.nilable(String), show_price: T.nilable(T::Boolean) }
297
+ )
298
+ end
299
+ def to_hash
300
+ end
301
+ end
243
302
  end
244
303
  end
245
304
  end
@@ -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