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
@@ -0,0 +1,181 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::PromoCodes#list
6
+ class PromoCodeListResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The ID of the promo.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute amount_off
14
+ # The amount off (% or flat amount) for the promo.
15
+ #
16
+ # @return [Float]
17
+ required :amount_off, Float
18
+
19
+ # @!attribute churned_users_only
20
+ # Restricts promo use to only users who have churned from the company before.
21
+ #
22
+ # @return [Boolean]
23
+ required :churned_users_only, WhopSDK::Internal::Type::Boolean
24
+
25
+ # @!attribute code
26
+ # The specific code used to apply the promo at checkout.
27
+ #
28
+ # @return [String, nil]
29
+ required :code, String, nil?: true
30
+
31
+ # @!attribute created_at
32
+ # The timestamp of when the promo was created.
33
+ #
34
+ # @return [Time]
35
+ required :created_at, Time
36
+
37
+ # @!attribute currency
38
+ # The monetary currency of the promo code.
39
+ #
40
+ # @return [Symbol, WhopSDK::Models::Currency]
41
+ required :currency, enum: -> { WhopSDK::Currency }
42
+
43
+ # @!attribute duration
44
+ # The duration setting for the promo code
45
+ #
46
+ # @return [Symbol, WhopSDK::Models::PromoDuration, nil]
47
+ required :duration, enum: -> { WhopSDK::PromoDuration }, nil?: true
48
+
49
+ # @!attribute existing_memberships_only
50
+ # Restricts promo use to only be applied to already purchased memberships.
51
+ #
52
+ # @return [Boolean]
53
+ required :existing_memberships_only, WhopSDK::Internal::Type::Boolean
54
+
55
+ # @!attribute expires_at
56
+ # The date/time of when the promo expires.
57
+ #
58
+ # @return [Time, nil]
59
+ required :expires_at, Time, nil?: true
60
+
61
+ # @!attribute new_users_only
62
+ # Restricts promo use to only users who have never purchased from the company
63
+ # before.
64
+ #
65
+ # @return [Boolean]
66
+ required :new_users_only, WhopSDK::Internal::Type::Boolean
67
+
68
+ # @!attribute one_per_customer
69
+ # Restricts promo use to only be applied once per customer.
70
+ #
71
+ # @return [Boolean]
72
+ required :one_per_customer, WhopSDK::Internal::Type::Boolean
73
+
74
+ # @!attribute product
75
+ # The access pass associated with the promo code.
76
+ #
77
+ # @return [WhopSDK::Models::PromoCodeListResponse::Product, nil]
78
+ required :product, -> { WhopSDK::Models::PromoCodeListResponse::Product }, nil?: true
79
+
80
+ # @!attribute promo_duration_months
81
+ # The number of months the promo is applied for.
82
+ #
83
+ # @return [Integer, nil]
84
+ required :promo_duration_months, Integer, nil?: true
85
+
86
+ # @!attribute promo_type
87
+ # The type (% or flat amount) of the promo.
88
+ #
89
+ # @return [Symbol, WhopSDK::Models::PromoType]
90
+ required :promo_type, enum: -> { WhopSDK::PromoType }
91
+
92
+ # @!attribute status
93
+ # Indicates if the promo code is live or disabled.
94
+ #
95
+ # @return [Symbol, WhopSDK::Models::PromoCodeStatus]
96
+ required :status, enum: -> { WhopSDK::PromoCodeStatus }
97
+
98
+ # @!attribute stock
99
+ # The quantity limit on the number of uses.
100
+ #
101
+ # @return [Integer]
102
+ required :stock, Integer
103
+
104
+ # @!attribute unlimited_stock
105
+ # Whether or not the promo code has unlimited stock.
106
+ #
107
+ # @return [Boolean]
108
+ required :unlimited_stock, WhopSDK::Internal::Type::Boolean
109
+
110
+ # @!attribute uses
111
+ # The amount of times the promo codes has been used.
112
+ #
113
+ # @return [Integer]
114
+ required :uses, Integer
115
+
116
+ # @!method initialize(id:, amount_off:, churned_users_only:, code:, created_at:, currency:, duration:, existing_memberships_only:, expires_at:, new_users_only:, one_per_customer:, product:, promo_duration_months:, promo_type:, status:, stock:, unlimited_stock:, uses:)
117
+ # Some parameter documentations has been truncated, see
118
+ # {WhopSDK::Models::PromoCodeListResponse} for more details.
119
+ #
120
+ # An object representing a promo code for a plan.
121
+ #
122
+ # @param id [String] The ID of the promo.
123
+ #
124
+ # @param amount_off [Float] The amount off (% or flat amount) for the promo.
125
+ #
126
+ # @param churned_users_only [Boolean] Restricts promo use to only users who have churned from the company before.
127
+ #
128
+ # @param code [String, nil] The specific code used to apply the promo at checkout.
129
+ #
130
+ # @param created_at [Time] The timestamp of when the promo was created.
131
+ #
132
+ # @param currency [Symbol, WhopSDK::Models::Currency] The monetary currency of the promo code.
133
+ #
134
+ # @param duration [Symbol, WhopSDK::Models::PromoDuration, nil] The duration setting for the promo code
135
+ #
136
+ # @param existing_memberships_only [Boolean] Restricts promo use to only be applied to already purchased memberships.
137
+ #
138
+ # @param expires_at [Time, nil] The date/time of when the promo expires.
139
+ #
140
+ # @param new_users_only [Boolean] Restricts promo use to only users who have never purchased from the company befo
141
+ #
142
+ # @param one_per_customer [Boolean] Restricts promo use to only be applied once per customer.
143
+ #
144
+ # @param product [WhopSDK::Models::PromoCodeListResponse::Product, nil] The access pass associated with the promo code.
145
+ #
146
+ # @param promo_duration_months [Integer, nil] The number of months the promo is applied for.
147
+ #
148
+ # @param promo_type [Symbol, WhopSDK::Models::PromoType] The type (% or flat amount) of the promo.
149
+ #
150
+ # @param status [Symbol, WhopSDK::Models::PromoCodeStatus] Indicates if the promo code is live or disabled.
151
+ #
152
+ # @param stock [Integer] The quantity limit on the number of uses.
153
+ #
154
+ # @param unlimited_stock [Boolean] Whether or not the promo code has unlimited stock.
155
+ #
156
+ # @param uses [Integer] The amount of times the promo codes has been used.
157
+
158
+ # @see WhopSDK::Models::PromoCodeListResponse#product
159
+ class Product < WhopSDK::Internal::Type::BaseModel
160
+ # @!attribute id
161
+ # The internal ID of the public product.
162
+ #
163
+ # @return [String]
164
+ required :id, String
165
+
166
+ # @!attribute title
167
+ # The title of the product. Use for Whop 4.0.
168
+ #
169
+ # @return [String]
170
+ required :title, String
171
+
172
+ # @!method initialize(id:, title:)
173
+ # The access pass associated with the promo code.
174
+ #
175
+ # @param id [String] The internal ID of the public product.
176
+ #
177
+ # @param title [String] The title of the product. Use for Whop 4.0.
178
+ end
179
+ end
180
+ end
181
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::PromoCodes#retrieve
6
+ class PromoCodeRetrieveParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # Statuses for promo codes
6
+ module PromoCodeStatus
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ ACTIVE = :active
10
+ INACTIVE = :inactive
11
+ ARCHIVED = :archived
12
+
13
+ # @!method self.values
14
+ # @return [Array<Symbol>]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # The duration setting for the promo code
6
+ module PromoDuration
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ FOREVER = :forever
10
+ ONCE = :once
11
+ REPEATING = :repeating
12
+
13
+ # @!method self.values
14
+ # @return [Array<Symbol>]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Reviews#list
6
+ class ReviewListParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute product_id
11
+ # The ID of the product
12
+ #
13
+ # @return [String]
14
+ required :product_id, String
15
+
16
+ # @!attribute after
17
+ # Returns the elements in the list that come after the specified cursor.
18
+ #
19
+ # @return [String, nil]
20
+ optional :after, String, nil?: true
21
+
22
+ # @!attribute before
23
+ # Returns the elements in the list that come before the specified cursor.
24
+ #
25
+ # @return [String, nil]
26
+ optional :before, String, nil?: true
27
+
28
+ # @!attribute first
29
+ # Returns the first _n_ elements from the list.
30
+ #
31
+ # @return [Integer, nil]
32
+ optional :first, Integer, nil?: true
33
+
34
+ # @!attribute last
35
+ # Returns the last _n_ elements from the list.
36
+ #
37
+ # @return [Integer, nil]
38
+ optional :last, Integer, nil?: true
39
+
40
+ # @!attribute max_stars
41
+ # The maximum star rating of the review (inclusive)
42
+ #
43
+ # @return [Integer, nil]
44
+ optional :max_stars, Integer, nil?: true
45
+
46
+ # @!attribute min_stars
47
+ # The minimum star rating of the review (inclusive)
48
+ #
49
+ # @return [Integer, nil]
50
+ optional :min_stars, Integer, nil?: true
51
+
52
+ # @!method initialize(product_id:, after: nil, before: nil, first: nil, last: nil, max_stars: nil, min_stars: nil, request_options: {})
53
+ # @param product_id [String] The ID of the product
54
+ #
55
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
56
+ #
57
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
58
+ #
59
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
60
+ #
61
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
62
+ #
63
+ # @param max_stars [Integer, nil] The maximum star rating of the review (inclusive)
64
+ #
65
+ # @param min_stars [Integer, nil] The minimum star rating of the review (inclusive)
66
+ #
67
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,183 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Reviews#list
6
+ class ReviewListResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The internal ID of the review.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute attachments
14
+ # The attachments attached to the review.
15
+ #
16
+ # @return [Array<WhopSDK::Models::ReviewListResponse::Attachment>]
17
+ required :attachments,
18
+ -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Models::ReviewListResponse::Attachment] }
19
+
20
+ # @!attribute created_at
21
+ # The timestamp of when the review was created.
22
+ #
23
+ # @return [Time]
24
+ required :created_at, Time
25
+
26
+ # @!attribute description
27
+ # The description of the review.
28
+ #
29
+ # @return [String, nil]
30
+ required :description, String, nil?: true
31
+
32
+ # @!attribute joined_at
33
+ # The timestamp of when the user joined the product.
34
+ #
35
+ # @return [Time, nil]
36
+ required :joined_at, Time, nil?: true
37
+
38
+ # @!attribute paid_for_product
39
+ # Whether or not the user paid for the product. If null, the payment status is
40
+ # unknown.
41
+ #
42
+ # @return [Boolean, nil]
43
+ required :paid_for_product, WhopSDK::Internal::Type::Boolean, nil?: true
44
+
45
+ # @!attribute published_at
46
+ # The timestamp of when the review was published.
47
+ #
48
+ # @return [Time, nil]
49
+ required :published_at, Time, nil?: true
50
+
51
+ # @!attribute stars
52
+ # The number of stars the user gave the product.
53
+ #
54
+ # @return [Integer]
55
+ required :stars, Integer
56
+
57
+ # @!attribute status
58
+ # The status of the review.
59
+ #
60
+ # @return [Symbol, WhopSDK::Models::ReviewStatus]
61
+ required :status, enum: -> { WhopSDK::ReviewStatus }
62
+
63
+ # @!attribute title
64
+ # The title of the review.
65
+ #
66
+ # @return [String, nil]
67
+ required :title, String, nil?: true
68
+
69
+ # @!attribute updated_at
70
+ # The timestamp of when the review was last updated.
71
+ #
72
+ # @return [Time]
73
+ required :updated_at, Time
74
+
75
+ # @!attribute user
76
+ # The user account that performed the action.
77
+ #
78
+ # @return [WhopSDK::Models::ReviewListResponse::User]
79
+ required :user, -> { WhopSDK::Models::ReviewListResponse::User }
80
+
81
+ # @!method initialize(id:, attachments:, created_at:, description:, joined_at:, paid_for_product:, published_at:, stars:, status:, title:, updated_at:, user:)
82
+ # Some parameter documentations has been truncated, see
83
+ # {WhopSDK::Models::ReviewListResponse} for more details.
84
+ #
85
+ # An object representing a user review of a company.
86
+ #
87
+ # @param id [String] The internal ID of the review.
88
+ #
89
+ # @param attachments [Array<WhopSDK::Models::ReviewListResponse::Attachment>] The attachments attached to the review.
90
+ #
91
+ # @param created_at [Time] The timestamp of when the review was created.
92
+ #
93
+ # @param description [String, nil] The description of the review.
94
+ #
95
+ # @param joined_at [Time, nil] The timestamp of when the user joined the product.
96
+ #
97
+ # @param paid_for_product [Boolean, nil] Whether or not the user paid for the product. If null, the payment status is unk
98
+ #
99
+ # @param published_at [Time, nil] The timestamp of when the review was published.
100
+ #
101
+ # @param stars [Integer] The number of stars the user gave the product.
102
+ #
103
+ # @param status [Symbol, WhopSDK::Models::ReviewStatus] The status of the review.
104
+ #
105
+ # @param title [String, nil] The title of the review.
106
+ #
107
+ # @param updated_at [Time] The timestamp of when the review was last updated.
108
+ #
109
+ # @param user [WhopSDK::Models::ReviewListResponse::User] The user account that performed the action.
110
+
111
+ class Attachment < WhopSDK::Internal::Type::BaseModel
112
+ # @!attribute id
113
+ # The ID of the attachment
114
+ #
115
+ # @return [String]
116
+ required :id, String
117
+
118
+ # @!attribute content_type
119
+ # The attachment's content type (e.g., image/jpg, video/mp4)
120
+ #
121
+ # @return [String, nil]
122
+ required :content_type, String, nil?: true
123
+
124
+ # @!attribute filename
125
+ # The name of the file
126
+ #
127
+ # @return [String, nil]
128
+ required :filename, String, nil?: true
129
+
130
+ # @!attribute url
131
+ # This is the URL you use to render optimized attachments on the client. This
132
+ # should be used for apps.
133
+ #
134
+ # @return [String, nil]
135
+ required :url, String, nil?: true
136
+
137
+ # @!method initialize(id:, content_type:, filename:, url:)
138
+ # Some parameter documentations has been truncated, see
139
+ # {WhopSDK::Models::ReviewListResponse::Attachment} for more details.
140
+ #
141
+ # Represents an image attachment
142
+ #
143
+ # @param id [String] The ID of the attachment
144
+ #
145
+ # @param content_type [String, nil] The attachment's content type (e.g., image/jpg, video/mp4)
146
+ #
147
+ # @param filename [String, nil] The name of the file
148
+ #
149
+ # @param url [String, nil] This is the URL you use to render optimized attachments on the client. This shou
150
+ end
151
+
152
+ # @see WhopSDK::Models::ReviewListResponse#user
153
+ class User < WhopSDK::Internal::Type::BaseModel
154
+ # @!attribute id
155
+ # The internal ID of the user.
156
+ #
157
+ # @return [String]
158
+ required :id, String
159
+
160
+ # @!attribute name
161
+ # The name of the user from their Whop account.
162
+ #
163
+ # @return [String, nil]
164
+ required :name, String, nil?: true
165
+
166
+ # @!attribute username
167
+ # The username of the user from their Whop account.
168
+ #
169
+ # @return [String]
170
+ required :username, String
171
+
172
+ # @!method initialize(id:, name:, username:)
173
+ # The user account that performed the action.
174
+ #
175
+ # @param id [String] The internal ID of the user.
176
+ #
177
+ # @param name [String, nil] The name of the user from their Whop account.
178
+ #
179
+ # @param username [String] The username of the user from their Whop account.
180
+ end
181
+ end
182
+ end
183
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Reviews#retrieve
6
+ class ReviewRetrieveParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end