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
@@ -11,10 +11,6 @@ module WhopSDK
11
11
  T.any(WhopSDK::MembershipListParams, WhopSDK::Internal::AnyHash)
12
12
  end
13
13
 
14
- # The ID of the company to list memberships for
15
- sig { returns(String) }
16
- attr_accessor :company_id
17
-
18
14
  # The access pass IDs to filter the memberships by
19
15
  sig { returns(T.nilable(T::Array[String])) }
20
16
  attr_accessor :access_pass_ids
@@ -37,6 +33,10 @@ module WhopSDK
37
33
  end
38
34
  attr_accessor :cancel_options
39
35
 
36
+ # The ID of the company to list memberships for
37
+ sig { returns(T.nilable(String)) }
38
+ attr_accessor :company_id
39
+
40
40
  # The minimum creation date to filter by
41
41
  sig { returns(T.nilable(Time)) }
42
42
  attr_accessor :created_after
@@ -73,9 +73,12 @@ module WhopSDK
73
73
  sig { returns(T.nilable(T::Array[WhopSDK::MembershipStatus::OrSymbol])) }
74
74
  attr_accessor :statuses
75
75
 
76
+ # Only return memberships from these whop user ids
77
+ sig { returns(T.nilable(T::Array[String])) }
78
+ attr_accessor :user_ids
79
+
76
80
  sig do
77
81
  params(
78
- company_id: String,
79
82
  access_pass_ids: T.nilable(T::Array[String]),
80
83
  after: T.nilable(String),
81
84
  before: T.nilable(String),
@@ -83,6 +86,7 @@ module WhopSDK
83
86
  T.nilable(
84
87
  T::Array[WhopSDK::MembershipListParams::CancelOption::OrSymbol]
85
88
  ),
89
+ company_id: T.nilable(String),
86
90
  created_after: T.nilable(Time),
87
91
  created_before: T.nilable(Time),
88
92
  direction: T.nilable(WhopSDK::Direction::OrSymbol),
@@ -92,12 +96,11 @@ module WhopSDK
92
96
  plan_ids: T.nilable(T::Array[String]),
93
97
  promo_code_ids: T.nilable(T::Array[String]),
94
98
  statuses: T.nilable(T::Array[WhopSDK::MembershipStatus::OrSymbol]),
99
+ user_ids: T.nilable(T::Array[String]),
95
100
  request_options: WhopSDK::RequestOptions::OrHash
96
101
  ).returns(T.attached_class)
97
102
  end
98
103
  def self.new(
99
- # The ID of the company to list memberships for
100
- company_id:,
101
104
  # The access pass IDs to filter the memberships by
102
105
  access_pass_ids: nil,
103
106
  # Returns the elements in the list that come after the specified cursor.
@@ -106,6 +109,8 @@ module WhopSDK
106
109
  before: nil,
107
110
  # The cancel options to filter the memberships by
108
111
  cancel_options: nil,
112
+ # The ID of the company to list memberships for
113
+ company_id: nil,
109
114
  # The minimum creation date to filter by
110
115
  created_after: nil,
111
116
  # The maximum creation date to filter by
@@ -124,6 +129,8 @@ module WhopSDK
124
129
  promo_code_ids: nil,
125
130
  # The membership status to filter the memberships by
126
131
  statuses: nil,
132
+ # Only return memberships from these whop user ids
133
+ user_ids: nil,
127
134
  request_options: {}
128
135
  )
129
136
  end
@@ -131,7 +138,6 @@ module WhopSDK
131
138
  sig do
132
139
  override.returns(
133
140
  {
134
- company_id: String,
135
141
  access_pass_ids: T.nilable(T::Array[String]),
136
142
  after: T.nilable(String),
137
143
  before: T.nilable(String),
@@ -139,6 +145,7 @@ module WhopSDK
139
145
  T.nilable(
140
146
  T::Array[WhopSDK::MembershipListParams::CancelOption::OrSymbol]
141
147
  ),
148
+ company_id: T.nilable(String),
142
149
  created_after: T.nilable(Time),
143
150
  created_before: T.nilable(Time),
144
151
  direction: T.nilable(WhopSDK::Direction::OrSymbol),
@@ -148,6 +155,7 @@ module WhopSDK
148
155
  plan_ids: T.nilable(T::Array[String]),
149
156
  promo_code_ids: T.nilable(T::Array[String]),
150
157
  statuses: T.nilable(T::Array[WhopSDK::MembershipStatus::OrSymbol]),
158
+ user_ids: T.nilable(T::Array[String]),
151
159
  request_options: WhopSDK::RequestOptions
152
160
  }
153
161
  )
@@ -87,6 +87,17 @@ module WhopSDK
87
87
  end
88
88
  attr_writer :plan
89
89
 
90
+ # The Product this Membership grants access to.
91
+ sig { returns(WhopSDK::Models::MembershipListResponse::Product) }
92
+ attr_reader :product
93
+
94
+ sig do
95
+ params(
96
+ product: WhopSDK::Models::MembershipListResponse::Product::OrHash
97
+ ).void
98
+ end
99
+ attr_writer :product
100
+
90
101
  # The Promo Code that is currently applied to this Membership.
91
102
  sig do
92
103
  returns(T.nilable(WhopSDK::Models::MembershipListResponse::PromoCode))
@@ -150,6 +161,7 @@ module WhopSDK
150
161
  metadata: T::Hash[Symbol, T.anything],
151
162
  payment_collection_paused: T::Boolean,
152
163
  plan: WhopSDK::Models::MembershipListResponse::Plan::OrHash,
164
+ product: WhopSDK::Models::MembershipListResponse::Product::OrHash,
153
165
  promo_code:
154
166
  T.nilable(
155
167
  WhopSDK::Models::MembershipListResponse::PromoCode::OrHash
@@ -190,6 +202,8 @@ module WhopSDK
190
202
  payment_collection_paused:,
191
203
  # The Plan this Membership is for.
192
204
  plan:,
205
+ # The Product this Membership grants access to.
206
+ product:,
193
207
  # The Promo Code that is currently applied to this Membership.
194
208
  promo_code:,
195
209
  # The timestamp in seconds at which the current billing cycle for this
@@ -223,6 +237,7 @@ module WhopSDK
223
237
  metadata: T::Hash[Symbol, T.anything],
224
238
  payment_collection_paused: T::Boolean,
225
239
  plan: WhopSDK::Models::MembershipListResponse::Plan,
240
+ product: WhopSDK::Models::MembershipListResponse::Product,
226
241
  promo_code:
227
242
  T.nilable(WhopSDK::Models::MembershipListResponse::PromoCode),
228
243
  renewal_period_end: T.nilable(Time),
@@ -320,6 +335,38 @@ module WhopSDK
320
335
  end
321
336
  end
322
337
 
338
+ class Product < WhopSDK::Internal::Type::BaseModel
339
+ OrHash =
340
+ T.type_alias do
341
+ T.any(
342
+ WhopSDK::Models::MembershipListResponse::Product,
343
+ WhopSDK::Internal::AnyHash
344
+ )
345
+ end
346
+
347
+ # The internal ID of the public product.
348
+ sig { returns(String) }
349
+ attr_accessor :id
350
+
351
+ # The title of the product. Use for Whop 4.0.
352
+ sig { returns(String) }
353
+ attr_accessor :title
354
+
355
+ # The Product this Membership grants access to.
356
+ sig { params(id: String, title: String).returns(T.attached_class) }
357
+ def self.new(
358
+ # The internal ID of the public product.
359
+ id:,
360
+ # The title of the product. Use for Whop 4.0.
361
+ title:
362
+ )
363
+ end
364
+
365
+ sig { override.returns({ id: String, title: String }) }
366
+ def to_hash
367
+ end
368
+ end
369
+
323
370
  class PromoCode < WhopSDK::Internal::Type::BaseModel
324
371
  OrHash =
325
372
  T.type_alias do
@@ -0,0 +1,114 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class MessageUpdateParams < 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::MessageUpdateParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The attachments for this message
15
+ sig do
16
+ returns(T.nilable(T::Array[WhopSDK::MessageUpdateParams::Attachment]))
17
+ end
18
+ attr_accessor :attachments
19
+
20
+ # The content of the message in Markdown format
21
+ sig { returns(T.nilable(String)) }
22
+ attr_accessor :content
23
+
24
+ # Whether this message is pinned
25
+ sig { returns(T.nilable(T::Boolean)) }
26
+ attr_accessor :is_pinned
27
+
28
+ sig do
29
+ params(
30
+ attachments:
31
+ T.nilable(
32
+ T::Array[WhopSDK::MessageUpdateParams::Attachment::OrHash]
33
+ ),
34
+ content: T.nilable(String),
35
+ is_pinned: T.nilable(T::Boolean),
36
+ request_options: WhopSDK::RequestOptions::OrHash
37
+ ).returns(T.attached_class)
38
+ end
39
+ def self.new(
40
+ # The attachments for this message
41
+ attachments: nil,
42
+ # The content of the message in Markdown format
43
+ content: nil,
44
+ # Whether this message is pinned
45
+ is_pinned: nil,
46
+ request_options: {}
47
+ )
48
+ end
49
+
50
+ sig do
51
+ override.returns(
52
+ {
53
+ attachments:
54
+ T.nilable(T::Array[WhopSDK::MessageUpdateParams::Attachment]),
55
+ content: T.nilable(String),
56
+ is_pinned: T.nilable(T::Boolean),
57
+ request_options: WhopSDK::RequestOptions
58
+ }
59
+ )
60
+ end
61
+ def to_hash
62
+ end
63
+
64
+ class Attachment < WhopSDK::Internal::Type::BaseModel
65
+ OrHash =
66
+ T.type_alias do
67
+ T.any(
68
+ WhopSDK::MessageUpdateParams::Attachment,
69
+ WhopSDK::Internal::AnyHash
70
+ )
71
+ end
72
+
73
+ # The ID of an existing attachment object. Use this when updating a resource and
74
+ # keeping a subset of the attachments. Don't use this unless you know what you're
75
+ # doing.
76
+ sig { returns(T.nilable(String)) }
77
+ attr_accessor :id
78
+
79
+ # This ID should be used the first time you upload an attachment. It is the ID of
80
+ # the direct upload that was created when uploading the file to S3 via the
81
+ # mediaDirectUpload mutation.
82
+ sig { returns(T.nilable(String)) }
83
+ attr_accessor :direct_upload_id
84
+
85
+ # Input for an attachment
86
+ sig do
87
+ params(
88
+ id: T.nilable(String),
89
+ direct_upload_id: T.nilable(String)
90
+ ).returns(T.attached_class)
91
+ end
92
+ def self.new(
93
+ # The ID of an existing attachment object. Use this when updating a resource and
94
+ # keeping a subset of the attachments. Don't use this unless you know what you're
95
+ # doing.
96
+ id: nil,
97
+ # This ID should be used the first time you upload an attachment. It is the ID of
98
+ # the direct upload that was created when uploading the file to S3 via the
99
+ # mediaDirectUpload mutation.
100
+ direct_upload_id: nil
101
+ )
102
+ end
103
+
104
+ sig do
105
+ override.returns(
106
+ { id: T.nilable(String), direct_upload_id: T.nilable(String) }
107
+ )
108
+ end
109
+ def to_hash
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -29,12 +29,12 @@ module WhopSDK
29
29
  end
30
30
  attr_writer :billing_address
31
31
 
32
- # The billing reason
33
- sig { returns(T.nilable(String)) }
32
+ # The reason why a specific payment was billed
33
+ sig { returns(T.nilable(WhopSDK::BillingReasons::TaggedSymbol)) }
34
34
  attr_accessor :billing_reason
35
35
 
36
- # The type of card used as the payment method.
37
- sig { returns(T.nilable(String)) }
36
+ # Possible card brands that a payment token can have
37
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
38
38
  attr_accessor :card_brand
39
39
 
40
40
  # The last 4 digits of the card used to make the payment.
@@ -88,9 +88,8 @@ module WhopSDK
88
88
  sig { returns(T.nilable(Time)) }
89
89
  attr_accessor :paid_at
90
90
 
91
- # Returns the type of payment method used for the payment, if available. Ex.
92
- # klarna, affirm, card, cashapp
93
- sig { returns(T.nilable(String)) }
91
+ # The different types of payment methods that can be used.
92
+ sig { returns(T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol)) }
94
93
  attr_accessor :payment_method_type
95
94
 
96
95
  # The plan attached to this payment.
@@ -116,7 +115,8 @@ module WhopSDK
116
115
  end
117
116
  attr_writer :promo_code
118
117
 
119
- # Whether the payment can be refunded.
118
+ # True only for payments that are `paid`, have not been fully refunded, and were
119
+ # processed by a payment processor that allows refunds.
120
120
  sig { returns(T::Boolean) }
121
121
  attr_accessor :refundable
122
122
 
@@ -128,7 +128,9 @@ module WhopSDK
128
128
  sig { returns(T.nilable(Time)) }
129
129
  attr_accessor :refunded_at
130
130
 
131
- # Whether the payment can be retried.
131
+ # True when the payment status is `open` and its membership is in one of the
132
+ # retry-eligible states (`active`, `trialing`, `completed`, or `past_due`);
133
+ # otherwise false. Used to decide if Whop can attempt the charge again.
132
134
  sig { returns(T::Boolean) }
133
135
  attr_accessor :retryable
134
136
 
@@ -159,7 +161,8 @@ module WhopSDK
159
161
  sig { params(user: T.nilable(WhopSDK::Payment::User::OrHash)).void }
160
162
  attr_writer :user
161
163
 
162
- # Whether the payment can be voided.
164
+ # True when the payment is tied to a membership in `past_due`, the payment status
165
+ # is `open`, and the processor allows voiding payments; otherwise false.
163
166
  sig { returns(T::Boolean) }
164
167
  attr_accessor :voidable
165
168
 
@@ -170,8 +173,8 @@ module WhopSDK
170
173
  amount_after_fees: Float,
171
174
  auto_refunded: T::Boolean,
172
175
  billing_address: T.nilable(WhopSDK::Payment::BillingAddress::OrHash),
173
- billing_reason: T.nilable(String),
174
- card_brand: T.nilable(String),
176
+ billing_reason: T.nilable(WhopSDK::BillingReasons::OrSymbol),
177
+ card_brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
175
178
  card_last4: T.nilable(String),
176
179
  company: T.nilable(WhopSDK::Payment::Company::OrHash),
177
180
  created_at: Time,
@@ -182,7 +185,7 @@ module WhopSDK
182
185
  member: T.nilable(WhopSDK::Payment::Member::OrHash),
183
186
  membership: T.nilable(WhopSDK::Payment::Membership::OrHash),
184
187
  paid_at: T.nilable(Time),
185
- payment_method_type: T.nilable(String),
188
+ payment_method_type: T.nilable(WhopSDK::PaymentMethodTypes::OrSymbol),
186
189
  plan: T.nilable(WhopSDK::Payment::Plan::OrHash),
187
190
  product: T.nilable(WhopSDK::Payment::Product::OrHash),
188
191
  promo_code: T.nilable(WhopSDK::Payment::PromoCode::OrHash),
@@ -208,9 +211,9 @@ module WhopSDK
208
211
  auto_refunded:,
209
212
  # The address of the user who made the payment.
210
213
  billing_address:,
211
- # The billing reason
214
+ # The reason why a specific payment was billed
212
215
  billing_reason:,
213
- # The type of card used as the payment method.
216
+ # Possible card brands that a payment token can have
214
217
  card_brand:,
215
218
  # The last 4 digits of the card used to make the payment.
216
219
  card_last4:,
@@ -232,8 +235,7 @@ module WhopSDK
232
235
  membership:,
233
236
  # The datetime the payment was paid
234
237
  paid_at:,
235
- # Returns the type of payment method used for the payment, if available. Ex.
236
- # klarna, affirm, card, cashapp
238
+ # The different types of payment methods that can be used.
237
239
  payment_method_type:,
238
240
  # The plan attached to this payment.
239
241
  plan:,
@@ -241,13 +243,16 @@ module WhopSDK
241
243
  product:,
242
244
  # The promo code used for this payment.
243
245
  promo_code:,
244
- # Whether the payment can be refunded.
246
+ # True only for payments that are `paid`, have not been fully refunded, and were
247
+ # processed by a payment processor that allows refunds.
245
248
  refundable:,
246
249
  # The payment refund amount(if applicable).
247
250
  refunded_amount:,
248
251
  # When the payment was refunded (if applicable).
249
252
  refunded_at:,
250
- # Whether the payment can be retried.
253
+ # True when the payment status is `open` and its membership is in one of the
254
+ # retry-eligible states (`active`, `trialing`, `completed`, or `past_due`);
255
+ # otherwise false. Used to decide if Whop can attempt the charge again.
251
256
  retryable:,
252
257
  # The status of a receipt
253
258
  status:,
@@ -261,7 +266,8 @@ module WhopSDK
261
266
  usd_total:,
262
267
  # The user that made this payment.
263
268
  user:,
264
- # Whether the payment can be voided.
269
+ # True when the payment is tied to a membership in `past_due`, the payment status
270
+ # is `open`, and the processor allows voiding payments; otherwise false.
265
271
  voidable:
266
272
  )
267
273
  end
@@ -273,8 +279,8 @@ module WhopSDK
273
279
  amount_after_fees: Float,
274
280
  auto_refunded: T::Boolean,
275
281
  billing_address: T.nilable(WhopSDK::Payment::BillingAddress),
276
- billing_reason: T.nilable(String),
277
- card_brand: T.nilable(String),
282
+ billing_reason: T.nilable(WhopSDK::BillingReasons::TaggedSymbol),
283
+ card_brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
278
284
  card_last4: T.nilable(String),
279
285
  company: T.nilable(WhopSDK::Payment::Company),
280
286
  created_at: Time,
@@ -285,7 +291,8 @@ module WhopSDK
285
291
  member: T.nilable(WhopSDK::Payment::Member),
286
292
  membership: T.nilable(WhopSDK::Payment::Membership),
287
293
  paid_at: T.nilable(Time),
288
- payment_method_type: T.nilable(String),
294
+ payment_method_type:
295
+ T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol),
289
296
  plan: T.nilable(WhopSDK::Payment::Plan),
290
297
  product: T.nilable(WhopSDK::Payment::Product),
291
298
  promo_code: T.nilable(WhopSDK::Payment::PromoCode),
@@ -579,7 +586,7 @@ module WhopSDK
579
586
  sig { returns(T.nilable(String)) }
580
587
  attr_accessor :code
581
588
 
582
- # The number of billing cycles the promo is applied for.
589
+ # The number of months the promo is applied for.
583
590
  sig { returns(T.nilable(Integer)) }
584
591
  attr_accessor :number_of_intervals
585
592
 
@@ -607,7 +614,7 @@ module WhopSDK
607
614
  base_currency:,
608
615
  # The specific code used to apply the promo at checkout.
609
616
  code:,
610
- # The number of billing cycles the promo is applied for.
617
+ # The number of months the promo is applied for.
611
618
  number_of_intervals:,
612
619
  # The type (% or flat amount) of the promo.
613
620
  promo_type:
@@ -24,13 +24,7 @@ module WhopSDK
24
24
  attr_accessor :before
25
25
 
26
26
  # The billing reason for the payment
27
- sig do
28
- returns(
29
- T.nilable(
30
- T::Array[WhopSDK::PaymentListParams::BillingReason::OrSymbol]
31
- )
32
- )
33
- end
27
+ sig { returns(T.nilable(T::Array[WhopSDK::BillingReasons::OrSymbol])) }
34
28
  attr_accessor :billing_reasons
35
29
 
36
30
  # The minimum creation date to filter by
@@ -89,9 +83,7 @@ module WhopSDK
89
83
  after: T.nilable(String),
90
84
  before: T.nilable(String),
91
85
  billing_reasons:
92
- T.nilable(
93
- T::Array[WhopSDK::PaymentListParams::BillingReason::OrSymbol]
94
- ),
86
+ T.nilable(T::Array[WhopSDK::BillingReasons::OrSymbol]),
95
87
  created_after: T.nilable(Time),
96
88
  created_before: T.nilable(Time),
97
89
  currencies: T.nilable(T::Array[WhopSDK::Currency::OrSymbol]),
@@ -152,9 +144,7 @@ module WhopSDK
152
144
  after: T.nilable(String),
153
145
  before: T.nilable(String),
154
146
  billing_reasons:
155
- T.nilable(
156
- T::Array[WhopSDK::PaymentListParams::BillingReason::OrSymbol]
157
- ),
147
+ T.nilable(T::Array[WhopSDK::BillingReasons::OrSymbol]),
158
148
  created_after: T.nilable(Time),
159
149
  created_before: T.nilable(Time),
160
150
  currencies: T.nilable(T::Array[WhopSDK::Currency::OrSymbol]),
@@ -175,56 +165,6 @@ module WhopSDK
175
165
  def to_hash
176
166
  end
177
167
 
178
- # The reason why a specific payment was billed
179
- module BillingReason
180
- extend WhopSDK::Internal::Type::Enum
181
-
182
- TaggedSymbol =
183
- T.type_alias do
184
- T.all(Symbol, WhopSDK::PaymentListParams::BillingReason)
185
- end
186
- OrSymbol = T.type_alias { T.any(Symbol, String) }
187
-
188
- SUBSCRIPTION_CREATE =
189
- T.let(
190
- :subscription_create,
191
- WhopSDK::PaymentListParams::BillingReason::TaggedSymbol
192
- )
193
- SUBSCRIPTION_CYCLE =
194
- T.let(
195
- :subscription_cycle,
196
- WhopSDK::PaymentListParams::BillingReason::TaggedSymbol
197
- )
198
- SUBSCRIPTION_UPDATE =
199
- T.let(
200
- :subscription_update,
201
- WhopSDK::PaymentListParams::BillingReason::TaggedSymbol
202
- )
203
- ONE_TIME =
204
- T.let(
205
- :one_time,
206
- WhopSDK::PaymentListParams::BillingReason::TaggedSymbol
207
- )
208
- MANUAL =
209
- T.let(
210
- :manual,
211
- WhopSDK::PaymentListParams::BillingReason::TaggedSymbol
212
- )
213
- SUBSCRIPTION =
214
- T.let(
215
- :subscription,
216
- WhopSDK::PaymentListParams::BillingReason::TaggedSymbol
217
- )
218
-
219
- sig do
220
- override.returns(
221
- T::Array[WhopSDK::PaymentListParams::BillingReason::TaggedSymbol]
222
- )
223
- end
224
- def self.values
225
- end
226
- end
227
-
228
168
  # The order to sort the results by.
229
169
  module Order
230
170
  extend WhopSDK::Internal::Type::Enum