whop_sdk 0.0.3 → 0.0.5

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 (267) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +8 -0
  5. data/lib/whop_sdk/internal/transport/base_client.rb +7 -1
  6. data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +6 -2
  7. data/lib/whop_sdk/models/access_level.rb +1 -1
  8. data/lib/whop_sdk/models/access_pass_type.rb +2 -1
  9. data/lib/whop_sdk/models/access_token_create_params.rb +67 -0
  10. data/lib/whop_sdk/models/access_token_create_response.rb +27 -0
  11. data/lib/whop_sdk/models/app_build_create_params.rb +53 -29
  12. data/lib/whop_sdk/models/app_update_params.rb +53 -29
  13. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +119 -43
  14. data/lib/whop_sdk/models/company.rb +13 -1
  15. data/lib/whop_sdk/models/company_create_params.rb +46 -0
  16. data/lib/whop_sdk/models/company_list_params.rb +62 -0
  17. data/lib/whop_sdk/models/company_list_response.rb +175 -0
  18. data/lib/whop_sdk/models/course.rb +18 -1
  19. data/lib/whop_sdk/models/course_create_params.rb +94 -30
  20. data/lib/whop_sdk/models/course_lesson_create_params.rb +77 -1
  21. data/lib/whop_sdk/models/course_lesson_list_response.rb +43 -1
  22. data/lib/whop_sdk/models/course_lesson_update_params.rb +280 -83
  23. data/lib/whop_sdk/models/course_list_response.rb +18 -1
  24. data/lib/whop_sdk/models/course_student_list_params.rb +62 -0
  25. data/lib/whop_sdk/models/course_student_list_response.rb +97 -0
  26. data/lib/whop_sdk/models/course_student_retrieve_params.rb +14 -0
  27. data/lib/whop_sdk/models/course_student_retrieve_response.rb +149 -0
  28. data/lib/whop_sdk/models/course_update_params.rb +70 -28
  29. data/lib/whop_sdk/models/course_visibilities.rb +17 -0
  30. data/lib/whop_sdk/models/embed_type.rb +16 -0
  31. data/lib/whop_sdk/models/entry.rb +3 -3
  32. data/lib/whop_sdk/models/entry_list_response.rb +3 -3
  33. data/lib/whop_sdk/models/experience.rb +5 -6
  34. data/lib/whop_sdk/models/experience_update_params.rb +53 -29
  35. data/lib/whop_sdk/models/forum_post.rb +2 -2
  36. data/lib/whop_sdk/models/forum_post_create_params.rb +51 -27
  37. data/lib/whop_sdk/models/forum_post_list_response.rb +2 -2
  38. data/lib/whop_sdk/models/forum_post_update_params.rb +51 -27
  39. data/lib/whop_sdk/models/global_affiliate_status.rb +1 -1
  40. data/lib/whop_sdk/models/invoice_create_params.rb +50 -34
  41. data/lib/whop_sdk/models/invoice_list_params.rb +27 -40
  42. data/lib/whop_sdk/models/lesson.rb +59 -9
  43. data/lib/whop_sdk/models/member_list_params.rb +11 -11
  44. data/lib/whop_sdk/models/member_list_response.rb +3 -3
  45. data/lib/whop_sdk/models/member_retrieve_response.rb +3 -3
  46. data/lib/whop_sdk/models/membership_list_params.rb +9 -9
  47. data/lib/whop_sdk/models/message.rb +2 -2
  48. data/lib/whop_sdk/models/message_create_params.rb +51 -27
  49. data/lib/whop_sdk/models/message_list_response.rb +2 -2
  50. data/lib/whop_sdk/models/message_update_params.rb +51 -27
  51. data/lib/whop_sdk/models/payment.rb +13 -4
  52. data/lib/whop_sdk/models/payment_list_response.rb +13 -4
  53. data/lib/whop_sdk/models/payment_method_types.rb +2 -1
  54. data/lib/whop_sdk/models/plan.rb +54 -5
  55. data/lib/whop_sdk/models/plan_create_params.rb +99 -24
  56. data/lib/whop_sdk/models/plan_list_response.rb +57 -5
  57. data/lib/whop_sdk/models/plan_type.rb +1 -1
  58. data/lib/whop_sdk/models/plan_update_params.rb +97 -22
  59. data/lib/whop_sdk/models/product.rb +1 -1
  60. data/lib/whop_sdk/models/product_create_params.rb +6 -6
  61. data/lib/whop_sdk/models/product_list_item.rb +1 -1
  62. data/lib/whop_sdk/models/product_update_params.rb +57 -33
  63. data/lib/whop_sdk/models/promo_code.rb +3 -3
  64. data/lib/whop_sdk/models/promo_code_list_response.rb +3 -3
  65. data/lib/whop_sdk/models/transfer.rb +9 -1
  66. data/lib/whop_sdk/models/transfer_create_params.rb +9 -1
  67. data/lib/whop_sdk/models/transfer_list_response.rb +9 -1
  68. data/lib/whop_sdk/models.rb +14 -0
  69. data/lib/whop_sdk/resources/access_tokens.rb +46 -0
  70. data/lib/whop_sdk/resources/app_builds.rb +5 -3
  71. data/lib/whop_sdk/resources/apps.rb +4 -3
  72. data/lib/whop_sdk/resources/authorized_users.rb +2 -1
  73. data/lib/whop_sdk/resources/chat_channels.rb +9 -2
  74. data/lib/whop_sdk/resources/checkout_configurations.rb +8 -7
  75. data/lib/whop_sdk/resources/companies.rb +72 -1
  76. data/lib/whop_sdk/resources/course_chapters.rb +5 -3
  77. data/lib/whop_sdk/resources/course_lesson_interactions.rb +4 -3
  78. data/lib/whop_sdk/resources/course_lessons.rb +25 -7
  79. data/lib/whop_sdk/resources/course_students.rb +77 -0
  80. data/lib/whop_sdk/resources/courses.rb +24 -7
  81. data/lib/whop_sdk/resources/entries.rb +6 -3
  82. data/lib/whop_sdk/resources/experiences.rb +9 -7
  83. data/lib/whop_sdk/resources/forum_posts.rb +5 -4
  84. data/lib/whop_sdk/resources/forums.rb +3 -2
  85. data/lib/whop_sdk/resources/invoices.rb +22 -16
  86. data/lib/whop_sdk/resources/ledger_accounts.rb +6 -2
  87. data/lib/whop_sdk/resources/members.rb +6 -5
  88. data/lib/whop_sdk/resources/memberships.rb +10 -8
  89. data/lib/whop_sdk/resources/messages.rb +5 -4
  90. data/lib/whop_sdk/resources/payments.rb +7 -4
  91. data/lib/whop_sdk/resources/plans.rb +14 -8
  92. data/lib/whop_sdk/resources/products.rb +10 -8
  93. data/lib/whop_sdk/resources/promo_codes.rb +4 -2
  94. data/lib/whop_sdk/resources/reactions.rb +2 -1
  95. data/lib/whop_sdk/resources/reviews.rb +2 -1
  96. data/lib/whop_sdk/resources/shipments.rb +2 -1
  97. data/lib/whop_sdk/resources/support_channels.rb +2 -1
  98. data/lib/whop_sdk/resources/transfers.rb +5 -2
  99. data/lib/whop_sdk/resources/users.rb +9 -3
  100. data/lib/whop_sdk/version.rb +1 -1
  101. data/lib/whop_sdk.rb +14 -1
  102. data/manifest.yaml +1 -0
  103. data/rbi/whop_sdk/client.rbi +6 -0
  104. data/rbi/whop_sdk/internal/transport/base_client.rbi +5 -0
  105. data/rbi/whop_sdk/internal/transport/pooled_net_requester.rbi +6 -2
  106. data/rbi/whop_sdk/internal/type/base_model.rbi +8 -4
  107. data/rbi/whop_sdk/models/access_level.rbi +1 -1
  108. data/rbi/whop_sdk/models/access_pass_type.rbi +2 -1
  109. data/rbi/whop_sdk/models/access_token_create_params.rbi +126 -0
  110. data/rbi/whop_sdk/models/access_token_create_response.rbi +37 -0
  111. data/rbi/whop_sdk/models/app_build_create_params.rbi +80 -40
  112. data/rbi/whop_sdk/models/app_update_params.rbi +86 -37
  113. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +196 -68
  114. data/rbi/whop_sdk/models/company.rbi +10 -0
  115. data/rbi/whop_sdk/models/company_create_params.rbi +67 -0
  116. data/rbi/whop_sdk/models/company_list_params.rbi +83 -0
  117. data/rbi/whop_sdk/models/company_list_response.rbi +235 -0
  118. data/rbi/whop_sdk/models/course.rbi +21 -3
  119. data/rbi/whop_sdk/models/course_create_params.rbi +126 -38
  120. data/rbi/whop_sdk/models/course_lesson_create_params.rbi +126 -0
  121. data/rbi/whop_sdk/models/course_lesson_list_response.rbi +68 -0
  122. data/rbi/whop_sdk/models/course_lesson_update_params.rbi +449 -111
  123. data/rbi/whop_sdk/models/course_list_response.rbi +21 -3
  124. data/rbi/whop_sdk/models/course_student_list_params.rbi +83 -0
  125. data/rbi/whop_sdk/models/course_student_list_response.rbi +142 -0
  126. data/rbi/whop_sdk/models/course_student_retrieve_params.rbi +30 -0
  127. data/rbi/whop_sdk/models/course_student_retrieve_response.rbi +250 -0
  128. data/rbi/whop_sdk/models/course_update_params.rbi +104 -38
  129. data/rbi/whop_sdk/models/course_visibilities.rbi +23 -0
  130. data/rbi/whop_sdk/models/embed_type.rbi +20 -0
  131. data/rbi/whop_sdk/models/entry.rbi +3 -3
  132. data/rbi/whop_sdk/models/entry_list_response.rbi +3 -3
  133. data/rbi/whop_sdk/models/experience.rbi +7 -9
  134. data/rbi/whop_sdk/models/experience_update_params.rbi +84 -38
  135. data/rbi/whop_sdk/models/forum_post.rbi +2 -2
  136. data/rbi/whop_sdk/models/forum_post_create_params.rbi +85 -32
  137. data/rbi/whop_sdk/models/forum_post_list_response.rbi +2 -2
  138. data/rbi/whop_sdk/models/forum_post_update_params.rbi +85 -32
  139. data/rbi/whop_sdk/models/global_affiliate_status.rbi +1 -1
  140. data/rbi/whop_sdk/models/invoice_create_params.rbi +60 -46
  141. data/rbi/whop_sdk/models/invoice_list_params.rbi +26 -71
  142. data/rbi/whop_sdk/models/lesson.rbi +68 -10
  143. data/rbi/whop_sdk/models/member_list_params.rbi +10 -10
  144. data/rbi/whop_sdk/models/member_list_response.rbi +6 -6
  145. data/rbi/whop_sdk/models/member_retrieve_response.rbi +6 -6
  146. data/rbi/whop_sdk/models/membership_list_params.rbi +8 -8
  147. data/rbi/whop_sdk/models/message.rbi +2 -2
  148. data/rbi/whop_sdk/models/message_create_params.rbi +85 -32
  149. data/rbi/whop_sdk/models/message_list_response.rbi +2 -2
  150. data/rbi/whop_sdk/models/message_update_params.rbi +85 -32
  151. data/rbi/whop_sdk/models/payment.rbi +13 -3
  152. data/rbi/whop_sdk/models/payment_list_response.rbi +13 -3
  153. data/rbi/whop_sdk/models/payment_method_types.rbi +3 -1
  154. data/rbi/whop_sdk/models/plan.rbi +88 -4
  155. data/rbi/whop_sdk/models/plan_create_params.rbi +176 -34
  156. data/rbi/whop_sdk/models/plan_list_response.rbi +100 -4
  157. data/rbi/whop_sdk/models/plan_type.rbi +1 -1
  158. data/rbi/whop_sdk/models/plan_update_params.rbi +174 -32
  159. data/rbi/whop_sdk/models/product.rbi +1 -1
  160. data/rbi/whop_sdk/models/product_create_params.rbi +6 -6
  161. data/rbi/whop_sdk/models/product_list_item.rbi +1 -1
  162. data/rbi/whop_sdk/models/product_update_params.rbi +87 -43
  163. data/rbi/whop_sdk/models/promo_code.rbi +3 -3
  164. data/rbi/whop_sdk/models/promo_code_list_response.rbi +3 -3
  165. data/rbi/whop_sdk/models/transfer.rbi +8 -0
  166. data/rbi/whop_sdk/models/transfer_create_params.rbi +8 -0
  167. data/rbi/whop_sdk/models/transfer_list_response.rbi +8 -0
  168. data/rbi/whop_sdk/models.rbi +14 -0
  169. data/rbi/whop_sdk/resources/access_tokens.rbi +41 -0
  170. data/rbi/whop_sdk/resources/app_builds.rbi +15 -3
  171. data/rbi/whop_sdk/resources/apps.rbi +13 -2
  172. data/rbi/whop_sdk/resources/authorized_users.rbi +5 -1
  173. data/rbi/whop_sdk/resources/chat_channels.rbi +8 -1
  174. data/rbi/whop_sdk/resources/checkout_configurations.rbi +11 -8
  175. data/rbi/whop_sdk/resources/companies.rbi +68 -1
  176. data/rbi/whop_sdk/resources/course_chapters.rbi +11 -2
  177. data/rbi/whop_sdk/resources/course_lesson_interactions.rbi +7 -3
  178. data/rbi/whop_sdk/resources/course_lessons.rbi +62 -4
  179. data/rbi/whop_sdk/resources/course_students.rbi +69 -0
  180. data/rbi/whop_sdk/resources/courses.rbi +50 -4
  181. data/rbi/whop_sdk/resources/entries.rbi +15 -3
  182. data/rbi/whop_sdk/resources/experiences.rbi +21 -3
  183. data/rbi/whop_sdk/resources/forum_posts.rbi +18 -3
  184. data/rbi/whop_sdk/resources/forums.rbi +6 -1
  185. data/rbi/whop_sdk/resources/invoices.rbi +38 -23
  186. data/rbi/whop_sdk/resources/ledger_accounts.rbi +7 -2
  187. data/rbi/whop_sdk/resources/members.rbi +9 -5
  188. data/rbi/whop_sdk/resources/memberships.rbi +16 -5
  189. data/rbi/whop_sdk/resources/messages.rbi +18 -3
  190. data/rbi/whop_sdk/resources/payments.rbi +16 -3
  191. data/rbi/whop_sdk/resources/plans.rbi +40 -5
  192. data/rbi/whop_sdk/resources/products.rbi +21 -7
  193. data/rbi/whop_sdk/resources/promo_codes.rbi +10 -2
  194. data/rbi/whop_sdk/resources/reactions.rbi +5 -1
  195. data/rbi/whop_sdk/resources/reviews.rbi +5 -1
  196. data/rbi/whop_sdk/resources/shipments.rbi +5 -1
  197. data/rbi/whop_sdk/resources/support_channels.rbi +5 -1
  198. data/rbi/whop_sdk/resources/transfers.rbi +8 -1
  199. data/rbi/whop_sdk/resources/users.rbi +13 -2
  200. data/sig/whop_sdk/client.rbs +4 -0
  201. data/sig/whop_sdk/internal/transport/base_client.rbs +2 -0
  202. data/sig/whop_sdk/internal/transport/pooled_net_requester.rbs +4 -1
  203. data/sig/whop_sdk/models/access_token_create_params.rbs +56 -0
  204. data/sig/whop_sdk/models/access_token_create_response.rbs +15 -0
  205. data/sig/whop_sdk/models/app_build_create_params.rbs +29 -10
  206. data/sig/whop_sdk/models/app_update_params.rbs +29 -10
  207. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +72 -21
  208. data/sig/whop_sdk/models/company.rbs +5 -0
  209. data/sig/whop_sdk/models/company_create_params.rbs +41 -0
  210. data/sig/whop_sdk/models/company_list_params.rbs +51 -0
  211. data/sig/whop_sdk/models/company_list_response.rbs +109 -0
  212. data/sig/whop_sdk/models/course.rbs +13 -3
  213. data/sig/whop_sdk/models/course_create_params.rbs +49 -10
  214. data/sig/whop_sdk/models/course_lesson_create_params.rbs +46 -0
  215. data/sig/whop_sdk/models/course_lesson_list_response.rbs +25 -0
  216. data/sig/whop_sdk/models/course_lesson_update_params.rbs +162 -30
  217. data/sig/whop_sdk/models/course_list_response.rbs +13 -3
  218. data/sig/whop_sdk/models/course_student_list_params.rbs +51 -0
  219. data/sig/whop_sdk/models/course_student_list_response.rbs +64 -0
  220. data/sig/whop_sdk/models/course_student_retrieve_params.rbs +15 -0
  221. data/sig/whop_sdk/models/course_student_retrieve_response.rbs +106 -0
  222. data/sig/whop_sdk/models/course_update_params.rbs +40 -11
  223. data/sig/whop_sdk/models/course_visibilities.rbs +14 -0
  224. data/sig/whop_sdk/models/embed_type.rbs +14 -0
  225. data/sig/whop_sdk/models/experience_update_params.rbs +29 -10
  226. data/sig/whop_sdk/models/forum_post_create_params.rbs +29 -10
  227. data/sig/whop_sdk/models/forum_post_update_params.rbs +29 -10
  228. data/sig/whop_sdk/models/invoice_create_params.rbs +28 -18
  229. data/sig/whop_sdk/models/invoice_list_params.rbs +16 -33
  230. data/sig/whop_sdk/models/lesson.rbs +33 -8
  231. data/sig/whop_sdk/models/member_list_params.rbs +5 -5
  232. data/sig/whop_sdk/models/membership_list_params.rbs +5 -5
  233. data/sig/whop_sdk/models/message_create_params.rbs +29 -10
  234. data/sig/whop_sdk/models/message_update_params.rbs +29 -10
  235. data/sig/whop_sdk/models/payment.rbs +5 -0
  236. data/sig/whop_sdk/models/payment_list_response.rbs +5 -0
  237. data/sig/whop_sdk/models/payment_method_types.rbs +4 -2
  238. data/sig/whop_sdk/models/plan.rbs +32 -0
  239. data/sig/whop_sdk/models/plan_create_params.rbs +61 -10
  240. data/sig/whop_sdk/models/plan_list_response.rbs +32 -0
  241. data/sig/whop_sdk/models/plan_update_params.rbs +61 -10
  242. data/sig/whop_sdk/models/product_update_params.rbs +29 -10
  243. data/sig/whop_sdk/models/transfer.rbs +5 -0
  244. data/sig/whop_sdk/models/transfer_create_params.rbs +5 -0
  245. data/sig/whop_sdk/models/transfer_list_response.rbs +5 -0
  246. data/sig/whop_sdk/models.rbs +14 -0
  247. data/sig/whop_sdk/resources/access_tokens.rbs +15 -0
  248. data/sig/whop_sdk/resources/app_builds.rbs +1 -1
  249. data/sig/whop_sdk/resources/apps.rbs +1 -1
  250. data/sig/whop_sdk/resources/checkout_configurations.rbs +2 -2
  251. data/sig/whop_sdk/resources/companies.rbs +18 -0
  252. data/sig/whop_sdk/resources/course_lessons.rbs +10 -2
  253. data/sig/whop_sdk/resources/course_students.rbs +22 -0
  254. data/sig/whop_sdk/resources/courses.rbs +8 -2
  255. data/sig/whop_sdk/resources/experiences.rbs +1 -1
  256. data/sig/whop_sdk/resources/forum_posts.rbs +2 -2
  257. data/sig/whop_sdk/resources/invoices.rbs +8 -6
  258. data/sig/whop_sdk/resources/members.rbs +1 -1
  259. data/sig/whop_sdk/resources/memberships.rbs +1 -1
  260. data/sig/whop_sdk/resources/messages.rbs +2 -2
  261. data/sig/whop_sdk/resources/plans.rbs +4 -2
  262. data/sig/whop_sdk/resources/products.rbs +1 -1
  263. data/sig/whop_sdk/resources/transfers.rbs +1 -0
  264. metadata +41 -5
  265. data/lib/whop_sdk/models/invoice_create_response.rb +0 -27
  266. data/rbi/whop_sdk/models/invoice_create_response.rbi +0 -49
  267. data/sig/whop_sdk/models/invoice_create_response.rbs +0 -19
@@ -21,7 +21,16 @@ module WhopSDK
21
21
 
22
22
  # The attachments for this message, such as videos or images.
23
23
  sig do
24
- returns(T.nilable(T::Array[WhopSDK::MessageCreateParams::Attachment]))
24
+ returns(
25
+ T.nilable(
26
+ T::Array[
27
+ T.any(
28
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithDirectUploadID,
29
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithID
30
+ )
31
+ ]
32
+ )
33
+ )
25
34
  end
26
35
  attr_accessor :attachments
27
36
 
@@ -40,7 +49,12 @@ module WhopSDK
40
49
  content: String,
41
50
  attachments:
42
51
  T.nilable(
43
- T::Array[WhopSDK::MessageCreateParams::Attachment::OrHash]
52
+ T::Array[
53
+ T.any(
54
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithDirectUploadID::OrHash,
55
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithID::OrHash
56
+ )
57
+ ]
44
58
  ),
45
59
  poll: T.nilable(WhopSDK::MessageCreateParams::Poll::OrHash),
46
60
  request_options: WhopSDK::RequestOptions::OrHash
@@ -65,7 +79,14 @@ module WhopSDK
65
79
  channel_id: String,
66
80
  content: String,
67
81
  attachments:
68
- T.nilable(T::Array[WhopSDK::MessageCreateParams::Attachment]),
82
+ T.nilable(
83
+ T::Array[
84
+ T.any(
85
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithDirectUploadID,
86
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithID
87
+ )
88
+ ]
89
+ ),
69
90
  poll: T.nilable(WhopSDK::MessageCreateParams::Poll),
70
91
  request_options: WhopSDK::RequestOptions
71
92
  }
@@ -74,52 +95,84 @@ module WhopSDK
74
95
  def to_hash
75
96
  end
76
97
 
77
- class Attachment < WhopSDK::Internal::Type::BaseModel
78
- OrHash =
98
+ # Input for an attachment
99
+ module Attachment
100
+ extend WhopSDK::Internal::Type::Union
101
+
102
+ Variants =
79
103
  T.type_alias do
80
104
  T.any(
81
- WhopSDK::MessageCreateParams::Attachment,
82
- WhopSDK::Internal::AnyHash
105
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithDirectUploadID,
106
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithID
83
107
  )
84
108
  end
85
109
 
86
- # The ID of an existing attachment object. Use this when updating a resource and
87
- # keeping a subset of the attachments. Don't use this unless you know what you're
88
- # doing.
89
- sig { returns(T.nilable(String)) }
90
- attr_accessor :id
110
+ class AttachmentInputWithDirectUploadID < WhopSDK::Internal::Type::BaseModel
111
+ OrHash =
112
+ T.type_alias do
113
+ T.any(
114
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithDirectUploadID,
115
+ WhopSDK::Internal::AnyHash
116
+ )
117
+ end
91
118
 
92
- # This ID should be used the first time you upload an attachment. It is the ID of
93
- # the direct upload that was created when uploading the file to S3 via the
94
- # mediaDirectUpload mutation.
95
- sig { returns(T.nilable(String)) }
96
- attr_accessor :direct_upload_id
119
+ # This ID should be used the first time you upload an attachment. It is the ID of
120
+ # the direct upload that was created when uploading the file to S3 via the
121
+ # mediaDirectUpload mutation.
122
+ sig { returns(String) }
123
+ attr_accessor :direct_upload_id
97
124
 
98
- # Input for an attachment
99
- sig do
100
- params(
101
- id: T.nilable(String),
102
- direct_upload_id: T.nilable(String)
103
- ).returns(T.attached_class)
125
+ # Input for an attachment
126
+ sig { params(direct_upload_id: String).returns(T.attached_class) }
127
+ def self.new(
128
+ # This ID should be used the first time you upload an attachment. It is the ID of
129
+ # the direct upload that was created when uploading the file to S3 via the
130
+ # mediaDirectUpload mutation.
131
+ direct_upload_id:
132
+ )
133
+ end
134
+
135
+ sig { override.returns({ direct_upload_id: String }) }
136
+ def to_hash
137
+ end
104
138
  end
105
- def self.new(
139
+
140
+ class AttachmentInputWithID < WhopSDK::Internal::Type::BaseModel
141
+ OrHash =
142
+ T.type_alias do
143
+ T.any(
144
+ WhopSDK::MessageCreateParams::Attachment::AttachmentInputWithID,
145
+ WhopSDK::Internal::AnyHash
146
+ )
147
+ end
148
+
106
149
  # The ID of an existing attachment object. Use this when updating a resource and
107
150
  # keeping a subset of the attachments. Don't use this unless you know what you're
108
151
  # doing.
109
- id: nil,
110
- # This ID should be used the first time you upload an attachment. It is the ID of
111
- # the direct upload that was created when uploading the file to S3 via the
112
- # mediaDirectUpload mutation.
113
- direct_upload_id: nil
114
- )
152
+ sig { returns(String) }
153
+ attr_accessor :id
154
+
155
+ # Input for an attachment
156
+ sig { params(id: String).returns(T.attached_class) }
157
+ def self.new(
158
+ # The ID of an existing attachment object. Use this when updating a resource and
159
+ # keeping a subset of the attachments. Don't use this unless you know what you're
160
+ # doing.
161
+ id:
162
+ )
163
+ end
164
+
165
+ sig { override.returns({ id: String }) }
166
+ def to_hash
167
+ end
115
168
  end
116
169
 
117
170
  sig do
118
171
  override.returns(
119
- { id: T.nilable(String), direct_upload_id: T.nilable(String) }
172
+ T::Array[WhopSDK::MessageCreateParams::Attachment::Variants]
120
173
  )
121
174
  end
122
- def to_hash
175
+ def self.variants
123
176
  end
124
177
  end
125
178
 
@@ -11,7 +11,7 @@ module WhopSDK
11
11
  )
12
12
  end
13
13
 
14
- # The unique identifier for the entity
14
+ # The unique identifier of the resource.
15
15
  sig { returns(String) }
16
16
  attr_accessor :id
17
17
 
@@ -100,7 +100,7 @@ module WhopSDK
100
100
  ).returns(T.attached_class)
101
101
  end
102
102
  def self.new(
103
- # The unique identifier for the entity
103
+ # The unique identifier of the resource.
104
104
  id:,
105
105
  # The content of the message in Markdown format
106
106
  content:,
@@ -13,7 +13,16 @@ module WhopSDK
13
13
 
14
14
  # The attachments for this message
15
15
  sig do
16
- returns(T.nilable(T::Array[WhopSDK::MessageUpdateParams::Attachment]))
16
+ returns(
17
+ T.nilable(
18
+ T::Array[
19
+ T.any(
20
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithDirectUploadID,
21
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithID
22
+ )
23
+ ]
24
+ )
25
+ )
17
26
  end
18
27
  attr_accessor :attachments
19
28
 
@@ -29,7 +38,12 @@ module WhopSDK
29
38
  params(
30
39
  attachments:
31
40
  T.nilable(
32
- T::Array[WhopSDK::MessageUpdateParams::Attachment::OrHash]
41
+ T::Array[
42
+ T.any(
43
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithDirectUploadID::OrHash,
44
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithID::OrHash
45
+ )
46
+ ]
33
47
  ),
34
48
  content: T.nilable(String),
35
49
  is_pinned: T.nilable(T::Boolean),
@@ -51,7 +65,14 @@ module WhopSDK
51
65
  override.returns(
52
66
  {
53
67
  attachments:
54
- T.nilable(T::Array[WhopSDK::MessageUpdateParams::Attachment]),
68
+ T.nilable(
69
+ T::Array[
70
+ T.any(
71
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithDirectUploadID,
72
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithID
73
+ )
74
+ ]
75
+ ),
55
76
  content: T.nilable(String),
56
77
  is_pinned: T.nilable(T::Boolean),
57
78
  request_options: WhopSDK::RequestOptions
@@ -61,52 +82,84 @@ module WhopSDK
61
82
  def to_hash
62
83
  end
63
84
 
64
- class Attachment < WhopSDK::Internal::Type::BaseModel
65
- OrHash =
85
+ # Input for an attachment
86
+ module Attachment
87
+ extend WhopSDK::Internal::Type::Union
88
+
89
+ Variants =
66
90
  T.type_alias do
67
91
  T.any(
68
- WhopSDK::MessageUpdateParams::Attachment,
69
- WhopSDK::Internal::AnyHash
92
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithDirectUploadID,
93
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithID
70
94
  )
71
95
  end
72
96
 
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
97
+ class AttachmentInputWithDirectUploadID < WhopSDK::Internal::Type::BaseModel
98
+ OrHash =
99
+ T.type_alias do
100
+ T.any(
101
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithDirectUploadID,
102
+ WhopSDK::Internal::AnyHash
103
+ )
104
+ end
78
105
 
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
106
+ # This ID should be used the first time you upload an attachment. It is the ID of
107
+ # the direct upload that was created when uploading the file to S3 via the
108
+ # mediaDirectUpload mutation.
109
+ sig { returns(String) }
110
+ attr_accessor :direct_upload_id
84
111
 
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)
112
+ # Input for an attachment
113
+ sig { params(direct_upload_id: String).returns(T.attached_class) }
114
+ def self.new(
115
+ # This ID should be used the first time you upload an attachment. It is the ID of
116
+ # the direct upload that was created when uploading the file to S3 via the
117
+ # mediaDirectUpload mutation.
118
+ direct_upload_id:
119
+ )
120
+ end
121
+
122
+ sig { override.returns({ direct_upload_id: String }) }
123
+ def to_hash
124
+ end
91
125
  end
92
- def self.new(
126
+
127
+ class AttachmentInputWithID < WhopSDK::Internal::Type::BaseModel
128
+ OrHash =
129
+ T.type_alias do
130
+ T.any(
131
+ WhopSDK::MessageUpdateParams::Attachment::AttachmentInputWithID,
132
+ WhopSDK::Internal::AnyHash
133
+ )
134
+ end
135
+
93
136
  # The ID of an existing attachment object. Use this when updating a resource and
94
137
  # keeping a subset of the attachments. Don't use this unless you know what you're
95
138
  # 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
- )
139
+ sig { returns(String) }
140
+ attr_accessor :id
141
+
142
+ # Input for an attachment
143
+ sig { params(id: String).returns(T.attached_class) }
144
+ def self.new(
145
+ # The ID of an existing attachment object. Use this when updating a resource and
146
+ # keeping a subset of the attachments. Don't use this unless you know what you're
147
+ # doing.
148
+ id:
149
+ )
150
+ end
151
+
152
+ sig { override.returns({ id: String }) }
153
+ def to_hash
154
+ end
102
155
  end
103
156
 
104
157
  sig do
105
158
  override.returns(
106
- { id: T.nilable(String), direct_upload_id: T.nilable(String) }
159
+ T::Array[WhopSDK::MessageUpdateParams::Attachment::Variants]
107
160
  )
108
161
  end
109
- def to_hash
162
+ def self.variants
110
163
  end
111
164
  end
112
165
  end
@@ -84,6 +84,11 @@ module WhopSDK
84
84
  end
85
85
  attr_writer :membership
86
86
 
87
+ # The custom metadata stored on this payment. This will be copied the checkout
88
+ # configuration for which this payment was made
89
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
90
+ attr_accessor :metadata
91
+
87
92
  # The datetime the payment was paid
88
93
  sig { returns(T.nilable(Time)) }
89
94
  attr_accessor :paid_at
@@ -99,7 +104,7 @@ module WhopSDK
99
104
  sig { params(plan: T.nilable(WhopSDK::Payment::Plan::OrHash)).void }
100
105
  attr_writer :plan
101
106
 
102
- # The access pass attached to this payment.
107
+ # The product this payment was made for
103
108
  sig { returns(T.nilable(WhopSDK::Payment::Product)) }
104
109
  attr_reader :product
105
110
 
@@ -184,6 +189,7 @@ module WhopSDK
184
189
  last_payment_attempt: T.nilable(Time),
185
190
  member: T.nilable(WhopSDK::Payment::Member::OrHash),
186
191
  membership: T.nilable(WhopSDK::Payment::Membership::OrHash),
192
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
187
193
  paid_at: T.nilable(Time),
188
194
  payment_method_type: T.nilable(WhopSDK::PaymentMethodTypes::OrSymbol),
189
195
  plan: T.nilable(WhopSDK::Payment::Plan::OrHash),
@@ -233,13 +239,16 @@ module WhopSDK
233
239
  member:,
234
240
  # The membership attached to this payment.
235
241
  membership:,
242
+ # The custom metadata stored on this payment. This will be copied the checkout
243
+ # configuration for which this payment was made
244
+ metadata:,
236
245
  # The datetime the payment was paid
237
246
  paid_at:,
238
247
  # The different types of payment methods that can be used.
239
248
  payment_method_type:,
240
249
  # The plan attached to this payment.
241
250
  plan:,
242
- # The access pass attached to this payment.
251
+ # The product this payment was made for
243
252
  product:,
244
253
  # The promo code used for this payment.
245
254
  promo_code:,
@@ -290,6 +299,7 @@ module WhopSDK
290
299
  last_payment_attempt: T.nilable(Time),
291
300
  member: T.nilable(WhopSDK::Payment::Member),
292
301
  membership: T.nilable(WhopSDK::Payment::Membership),
302
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
293
303
  paid_at: T.nilable(Time),
294
304
  payment_method_type:
295
305
  T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol),
@@ -543,7 +553,7 @@ module WhopSDK
543
553
  sig { returns(String) }
544
554
  attr_accessor :title
545
555
 
546
- # The access pass attached to this payment.
556
+ # The product this payment was made for
547
557
  sig do
548
558
  params(id: String, route: String, title: String).returns(
549
559
  T.attached_class
@@ -109,6 +109,11 @@ module WhopSDK
109
109
  end
110
110
  attr_writer :membership
111
111
 
112
+ # The custom metadata stored on this payment. This will be copied the checkout
113
+ # configuration for which this payment was made
114
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
115
+ attr_accessor :metadata
116
+
112
117
  # The datetime the payment was paid
113
118
  sig { returns(T.nilable(Time)) }
114
119
  attr_accessor :paid_at
@@ -128,7 +133,7 @@ module WhopSDK
128
133
  end
129
134
  attr_writer :plan
130
135
 
131
- # The access pass attached to this payment.
136
+ # The product this payment was made for
132
137
  sig { returns(T.nilable(WhopSDK::Models::PaymentListResponse::Product)) }
133
138
  attr_reader :product
134
139
 
@@ -233,6 +238,7 @@ module WhopSDK
233
238
  T.nilable(WhopSDK::Models::PaymentListResponse::Member::OrHash),
234
239
  membership:
235
240
  T.nilable(WhopSDK::Models::PaymentListResponse::Membership::OrHash),
241
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
236
242
  paid_at: T.nilable(Time),
237
243
  payment_method_type: T.nilable(WhopSDK::PaymentMethodTypes::OrSymbol),
238
244
  plan: T.nilable(WhopSDK::Models::PaymentListResponse::Plan::OrHash),
@@ -284,13 +290,16 @@ module WhopSDK
284
290
  member:,
285
291
  # The membership attached to this payment.
286
292
  membership:,
293
+ # The custom metadata stored on this payment. This will be copied the checkout
294
+ # configuration for which this payment was made
295
+ metadata:,
287
296
  # The datetime the payment was paid
288
297
  paid_at:,
289
298
  # The different types of payment methods that can be used.
290
299
  payment_method_type:,
291
300
  # The plan attached to this payment.
292
301
  plan:,
293
- # The access pass attached to this payment.
302
+ # The product this payment was made for
294
303
  product:,
295
304
  # The promo code used for this payment.
296
305
  promo_code:,
@@ -343,6 +352,7 @@ module WhopSDK
343
352
  member: T.nilable(WhopSDK::Models::PaymentListResponse::Member),
344
353
  membership:
345
354
  T.nilable(WhopSDK::Models::PaymentListResponse::Membership),
355
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
346
356
  paid_at: T.nilable(Time),
347
357
  payment_method_type:
348
358
  T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol),
@@ -615,7 +625,7 @@ module WhopSDK
615
625
  sig { returns(String) }
616
626
  attr_accessor :title
617
627
 
618
- # The access pass attached to this payment.
628
+ # The product this payment was made for
619
629
  sig do
620
630
  params(id: String, route: String, title: String).returns(
621
631
  T.attached_class
@@ -100,10 +100,12 @@ module WhopSDK
100
100
  T.let(:id_bank_transfer, WhopSDK::PaymentMethodTypes::TaggedSymbol)
101
101
  DEMO_PAY = T.let(:demo_pay, WhopSDK::PaymentMethodTypes::TaggedSymbol)
102
102
  SHOP_PAY = T.let(:shop_pay, WhopSDK::PaymentMethodTypes::TaggedSymbol)
103
- APPLE = T.let(:apple, WhopSDK::PaymentMethodTypes::TaggedSymbol)
104
103
  SEZZLE = T.let(:sezzle, WhopSDK::PaymentMethodTypes::TaggedSymbol)
105
104
  COINBASE = T.let(:coinbase, WhopSDK::PaymentMethodTypes::TaggedSymbol)
106
105
  SPLITIT = T.let(:splitit, WhopSDK::PaymentMethodTypes::TaggedSymbol)
106
+ PLATFORM_BALANCE =
107
+ T.let(:platform_balance, WhopSDK::PaymentMethodTypes::TaggedSymbol)
108
+ APPLE = T.let(:apple, WhopSDK::PaymentMethodTypes::TaggedSymbol)
107
109
  UNKNOWN = T.let(:unknown, WhopSDK::PaymentMethodTypes::TaggedSymbol)
108
110
 
109
111
  sig do
@@ -63,11 +63,23 @@ module WhopSDK
63
63
  sig { returns(T.nilable(Integer)) }
64
64
  attr_accessor :member_count
65
65
 
66
+ # The explicit payment method configuration for the plan, if any.
67
+ sig { returns(T.nilable(WhopSDK::Plan::PaymentMethodConfiguration)) }
68
+ attr_reader :payment_method_configuration
69
+
70
+ sig do
71
+ params(
72
+ payment_method_configuration:
73
+ T.nilable(WhopSDK::Plan::PaymentMethodConfiguration::OrHash)
74
+ ).void
75
+ end
76
+ attr_writer :payment_method_configuration
77
+
66
78
  # Indicates if the plan is a one time payment or recurring.
67
79
  sig { returns(WhopSDK::PlanType::TaggedSymbol) }
68
80
  attr_accessor :plan_type
69
81
 
70
- # The access pass for the plan.
82
+ # The product that this plan belongs to.
71
83
  sig { returns(T.nilable(WhopSDK::Plan::Product)) }
72
84
  attr_reader :product
73
85
 
@@ -114,7 +126,9 @@ module WhopSDK
114
126
  sig { returns(WhopSDK::Visibility::TaggedSymbol) }
115
127
  attr_accessor :visibility
116
128
 
117
- # An object representing a (sanitized) plan of an access pass.
129
+ # A plan for an product. Plans define the core parameters that define a checkout
130
+ # and payment on whop. Use plans to create different ways to price your products
131
+ # (Eg renewal / one_time)
118
132
  sig do
119
133
  params(
120
134
  id: String,
@@ -130,6 +144,8 @@ module WhopSDK
130
144
  internal_notes: T.nilable(String),
131
145
  invoice: T.nilable(WhopSDK::Plan::Invoice::OrHash),
132
146
  member_count: T.nilable(Integer),
147
+ payment_method_configuration:
148
+ T.nilable(WhopSDK::Plan::PaymentMethodConfiguration::OrHash),
133
149
  plan_type: WhopSDK::PlanType::OrSymbol,
134
150
  product: T.nilable(WhopSDK::Plan::Product::OrHash),
135
151
  purchase_url: String,
@@ -171,9 +187,11 @@ module WhopSDK
171
187
  invoice:,
172
188
  # The number of members for the plan.
173
189
  member_count:,
190
+ # The explicit payment method configuration for the plan, if any.
191
+ payment_method_configuration:,
174
192
  # Indicates if the plan is a one time payment or recurring.
175
193
  plan_type:,
176
- # The access pass for the plan.
194
+ # The product that this plan belongs to.
177
195
  product:,
178
196
  # The direct link to purchase the product.
179
197
  purchase_url:,
@@ -214,6 +232,8 @@ module WhopSDK
214
232
  internal_notes: T.nilable(String),
215
233
  invoice: T.nilable(WhopSDK::Plan::Invoice),
216
234
  member_count: T.nilable(Integer),
235
+ payment_method_configuration:
236
+ T.nilable(WhopSDK::Plan::PaymentMethodConfiguration),
217
237
  plan_type: WhopSDK::PlanType::TaggedSymbol,
218
238
  product: T.nilable(WhopSDK::Plan::Product),
219
239
  purchase_url: String,
@@ -357,6 +377,70 @@ module WhopSDK
357
377
  end
358
378
  end
359
379
 
380
+ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel
381
+ OrHash =
382
+ T.type_alias do
383
+ T.any(
384
+ WhopSDK::Plan::PaymentMethodConfiguration,
385
+ WhopSDK::Internal::AnyHash
386
+ )
387
+ end
388
+
389
+ # An array of payment method identifiers that are explicitly disabled. Only
390
+ # applies if the include_platform_defaults is true.
391
+ sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) }
392
+ attr_accessor :disabled
393
+
394
+ # An array of payment method identifiers that are explicitly enabled. This means
395
+ # these payment methods will be shown on checkout. Example use case is to only
396
+ # enable a specific payment method like cashapp, or extending the platform
397
+ # defaults with additional methods.
398
+ sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) }
399
+ attr_accessor :enabled
400
+
401
+ # Whether Whop's platform default payment method enablement settings are included
402
+ # in this configuration. The full list of default payment methods can be found in
403
+ # the documentation at docs.whop.com/payments.
404
+ sig { returns(T::Boolean) }
405
+ attr_accessor :include_platform_defaults
406
+
407
+ # The explicit payment method configuration for the plan, if any.
408
+ sig do
409
+ params(
410
+ disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
411
+ enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
412
+ include_platform_defaults: T::Boolean
413
+ ).returns(T.attached_class)
414
+ end
415
+ def self.new(
416
+ # An array of payment method identifiers that are explicitly disabled. Only
417
+ # applies if the include_platform_defaults is true.
418
+ disabled:,
419
+ # An array of payment method identifiers that are explicitly enabled. This means
420
+ # these payment methods will be shown on checkout. Example use case is to only
421
+ # enable a specific payment method like cashapp, or extending the platform
422
+ # defaults with additional methods.
423
+ enabled:,
424
+ # Whether Whop's platform default payment method enablement settings are included
425
+ # in this configuration. The full list of default payment methods can be found in
426
+ # the documentation at docs.whop.com/payments.
427
+ include_platform_defaults:
428
+ )
429
+ end
430
+
431
+ sig do
432
+ override.returns(
433
+ {
434
+ disabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol],
435
+ enabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol],
436
+ include_platform_defaults: T::Boolean
437
+ }
438
+ )
439
+ end
440
+ def to_hash
441
+ end
442
+ end
443
+
360
444
  class Product < WhopSDK::Internal::Type::BaseModel
361
445
  OrHash =
362
446
  T.type_alias do
@@ -371,7 +455,7 @@ module WhopSDK
371
455
  sig { returns(String) }
372
456
  attr_accessor :title
373
457
 
374
- # The access pass for the plan.
458
+ # The product that this plan belongs to.
375
459
  sig { params(id: String, title: String).returns(T.attached_class) }
376
460
  def self.new(
377
461
  # The internal ID of the public product.