whop_sdk 0.0.4 → 0.0.6

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 (233) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +4 -7
  4. data/lib/whop_sdk/client.rb +21 -6
  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/checkout_configuration_create_params.rb +4 -4
  12. data/lib/whop_sdk/models/company.rb +1 -0
  13. data/lib/whop_sdk/models/course.rb +18 -1
  14. data/lib/whop_sdk/models/course_create_params.rb +20 -1
  15. data/lib/whop_sdk/models/course_lesson_create_params.rb +77 -1
  16. data/lib/whop_sdk/models/course_lesson_list_response.rb +43 -1
  17. data/lib/whop_sdk/models/course_lesson_update_params.rb +77 -1
  18. data/lib/whop_sdk/models/course_list_response.rb +18 -1
  19. data/lib/whop_sdk/models/course_update_params.rb +19 -1
  20. data/lib/whop_sdk/models/course_visibilities.rb +17 -0
  21. data/lib/whop_sdk/models/dispute.rb +672 -0
  22. data/lib/whop_sdk/models/dispute_created_webhook_event.rb +48 -0
  23. data/lib/whop_sdk/models/dispute_list_params.rb +62 -0
  24. data/lib/whop_sdk/models/dispute_list_response.rb +187 -0
  25. data/lib/whop_sdk/models/dispute_retrieve_params.rb +14 -0
  26. data/lib/whop_sdk/models/dispute_statuses.rb +23 -0
  27. data/lib/whop_sdk/models/dispute_submit_evidence_params.rb +14 -0
  28. data/lib/whop_sdk/models/dispute_update_evidence_params.rb +342 -0
  29. data/lib/whop_sdk/models/dispute_updated_webhook_event.rb +48 -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/forum_post.rb +2 -2
  35. data/lib/whop_sdk/models/forum_post_list_response.rb +2 -2
  36. data/lib/whop_sdk/models/global_affiliate_status.rb +1 -1
  37. data/lib/whop_sdk/models/invoice_create_params.rb +2 -2
  38. data/lib/whop_sdk/models/invoice_list_params.rb +27 -40
  39. data/lib/whop_sdk/models/lesson.rb +43 -1
  40. data/lib/whop_sdk/models/member_list_params.rb +11 -11
  41. data/lib/whop_sdk/models/member_list_response.rb +3 -3
  42. data/lib/whop_sdk/models/member_retrieve_response.rb +3 -3
  43. data/lib/whop_sdk/models/membership_list_params.rb +9 -9
  44. data/lib/whop_sdk/models/message.rb +2 -2
  45. data/lib/whop_sdk/models/message_list_response.rb +2 -2
  46. data/lib/whop_sdk/models/notification_create_params.rb +88 -0
  47. data/lib/whop_sdk/models/notification_create_response.rb +19 -0
  48. data/lib/whop_sdk/models/payment.rb +3 -3
  49. data/lib/whop_sdk/models/payment_list_response.rb +3 -3
  50. data/lib/whop_sdk/models/plan.rb +6 -4
  51. data/lib/whop_sdk/models/plan_create_params.rb +2 -2
  52. data/lib/whop_sdk/models/plan_list_response.rb +6 -4
  53. data/lib/whop_sdk/models/plan_type.rb +1 -1
  54. data/lib/whop_sdk/models/product.rb +1 -1
  55. data/lib/whop_sdk/models/product_create_params.rb +6 -6
  56. data/lib/whop_sdk/models/product_list_item.rb +1 -1
  57. data/lib/whop_sdk/models/product_update_params.rb +4 -4
  58. data/lib/whop_sdk/models/promo_code.rb +3 -3
  59. data/lib/whop_sdk/models/promo_code_list_response.rb +3 -3
  60. data/lib/whop_sdk/models/unwrap_webhook_event.rb +5 -1
  61. data/lib/whop_sdk/models.rb +24 -0
  62. data/lib/whop_sdk/resources/access_tokens.rb +46 -0
  63. data/lib/whop_sdk/resources/app_builds.rb +4 -2
  64. data/lib/whop_sdk/resources/apps.rb +3 -2
  65. data/lib/whop_sdk/resources/authorized_users.rb +2 -1
  66. data/lib/whop_sdk/resources/chat_channels.rb +9 -2
  67. data/lib/whop_sdk/resources/checkout_configurations.rb +2 -1
  68. data/lib/whop_sdk/resources/companies.rb +2 -1
  69. data/lib/whop_sdk/resources/course_chapters.rb +5 -3
  70. data/lib/whop_sdk/resources/course_lesson_interactions.rb +2 -1
  71. data/lib/whop_sdk/resources/course_lessons.rb +19 -5
  72. data/lib/whop_sdk/resources/course_students.rb +2 -1
  73. data/lib/whop_sdk/resources/courses.rb +15 -5
  74. data/lib/whop_sdk/resources/disputes.rb +182 -0
  75. data/lib/whop_sdk/resources/entries.rb +6 -3
  76. data/lib/whop_sdk/resources/experiences.rb +8 -6
  77. data/lib/whop_sdk/resources/forum_posts.rb +3 -2
  78. data/lib/whop_sdk/resources/forums.rb +3 -2
  79. data/lib/whop_sdk/resources/invoices.rb +11 -5
  80. data/lib/whop_sdk/resources/ledger_accounts.rb +6 -2
  81. data/lib/whop_sdk/resources/members.rb +6 -5
  82. data/lib/whop_sdk/resources/memberships.rb +10 -8
  83. data/lib/whop_sdk/resources/messages.rb +3 -2
  84. data/lib/whop_sdk/resources/notifications.rb +53 -0
  85. data/lib/whop_sdk/resources/payments.rb +7 -4
  86. data/lib/whop_sdk/resources/plans.rb +6 -4
  87. data/lib/whop_sdk/resources/products.rb +9 -7
  88. data/lib/whop_sdk/resources/promo_codes.rb +4 -2
  89. data/lib/whop_sdk/resources/reactions.rb +2 -1
  90. data/lib/whop_sdk/resources/reviews.rb +2 -1
  91. data/lib/whop_sdk/resources/shipments.rb +2 -1
  92. data/lib/whop_sdk/resources/support_channels.rb +2 -1
  93. data/lib/whop_sdk/resources/transfers.rb +2 -1
  94. data/lib/whop_sdk/resources/users.rb +9 -3
  95. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  96. data/lib/whop_sdk/version.rb +1 -1
  97. data/lib/whop_sdk.rb +19 -0
  98. data/manifest.yaml +1 -0
  99. data/rbi/whop_sdk/client.rbi +14 -2
  100. data/rbi/whop_sdk/internal/transport/base_client.rbi +5 -0
  101. data/rbi/whop_sdk/internal/transport/pooled_net_requester.rbi +6 -2
  102. data/rbi/whop_sdk/internal/type/base_model.rbi +8 -4
  103. data/rbi/whop_sdk/models/access_level.rbi +1 -1
  104. data/rbi/whop_sdk/models/access_pass_type.rbi +2 -1
  105. data/rbi/whop_sdk/models/access_token_create_params.rbi +126 -0
  106. data/rbi/whop_sdk/models/access_token_create_response.rbi +37 -0
  107. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +4 -4
  108. data/rbi/whop_sdk/models/company.rbi +2 -0
  109. data/rbi/whop_sdk/models/course.rbi +21 -3
  110. data/rbi/whop_sdk/models/course_create_params.rbi +22 -0
  111. data/rbi/whop_sdk/models/course_lesson_create_params.rbi +126 -0
  112. data/rbi/whop_sdk/models/course_lesson_list_response.rbi +68 -0
  113. data/rbi/whop_sdk/models/course_lesson_update_params.rbi +126 -0
  114. data/rbi/whop_sdk/models/course_list_response.rbi +21 -3
  115. data/rbi/whop_sdk/models/course_update_params.rbi +20 -0
  116. data/rbi/whop_sdk/models/course_visibilities.rbi +23 -0
  117. data/rbi/whop_sdk/models/dispute.rbi +938 -0
  118. data/rbi/whop_sdk/models/dispute_created_webhook_event.rbi +72 -0
  119. data/rbi/whop_sdk/models/dispute_list_params.rbi +83 -0
  120. data/rbi/whop_sdk/models/dispute_list_response.rbi +287 -0
  121. data/rbi/whop_sdk/models/dispute_retrieve_params.rbi +27 -0
  122. data/rbi/whop_sdk/models/dispute_statuses.rbi +32 -0
  123. data/rbi/whop_sdk/models/dispute_submit_evidence_params.rbi +30 -0
  124. data/rbi/whop_sdk/models/dispute_update_evidence_params.rbi +566 -0
  125. data/rbi/whop_sdk/models/dispute_updated_webhook_event.rbi +72 -0
  126. data/rbi/whop_sdk/models/embed_type.rbi +20 -0
  127. data/rbi/whop_sdk/models/entry.rbi +3 -3
  128. data/rbi/whop_sdk/models/entry_list_response.rbi +3 -3
  129. data/rbi/whop_sdk/models/experience.rbi +7 -9
  130. data/rbi/whop_sdk/models/forum_post.rbi +2 -2
  131. data/rbi/whop_sdk/models/forum_post_list_response.rbi +2 -2
  132. data/rbi/whop_sdk/models/global_affiliate_status.rbi +1 -1
  133. data/rbi/whop_sdk/models/invoice_create_params.rbi +2 -2
  134. data/rbi/whop_sdk/models/invoice_list_params.rbi +26 -71
  135. data/rbi/whop_sdk/models/lesson.rbi +54 -0
  136. data/rbi/whop_sdk/models/member_list_params.rbi +10 -10
  137. data/rbi/whop_sdk/models/member_list_response.rbi +6 -6
  138. data/rbi/whop_sdk/models/member_retrieve_response.rbi +6 -6
  139. data/rbi/whop_sdk/models/membership_list_params.rbi +8 -8
  140. data/rbi/whop_sdk/models/message.rbi +2 -2
  141. data/rbi/whop_sdk/models/message_list_response.rbi +2 -2
  142. data/rbi/whop_sdk/models/notification_create_params.rbi +113 -0
  143. data/rbi/whop_sdk/models/notification_create_response.rbi +31 -0
  144. data/rbi/whop_sdk/models/payment.rbi +3 -3
  145. data/rbi/whop_sdk/models/payment_list_response.rbi +3 -3
  146. data/rbi/whop_sdk/models/plan.rbi +6 -4
  147. data/rbi/whop_sdk/models/plan_create_params.rbi +2 -2
  148. data/rbi/whop_sdk/models/plan_list_response.rbi +6 -4
  149. data/rbi/whop_sdk/models/plan_type.rbi +1 -1
  150. data/rbi/whop_sdk/models/product.rbi +1 -1
  151. data/rbi/whop_sdk/models/product_create_params.rbi +6 -6
  152. data/rbi/whop_sdk/models/product_list_item.rbi +1 -1
  153. data/rbi/whop_sdk/models/product_update_params.rbi +4 -4
  154. data/rbi/whop_sdk/models/promo_code.rbi +3 -3
  155. data/rbi/whop_sdk/models/promo_code_list_response.rbi +3 -3
  156. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -1
  157. data/rbi/whop_sdk/models.rbi +24 -0
  158. data/rbi/whop_sdk/resources/access_tokens.rbi +41 -0
  159. data/rbi/whop_sdk/resources/app_builds.rbi +10 -2
  160. data/rbi/whop_sdk/resources/apps.rbi +6 -1
  161. data/rbi/whop_sdk/resources/authorized_users.rbi +5 -1
  162. data/rbi/whop_sdk/resources/chat_channels.rbi +8 -1
  163. data/rbi/whop_sdk/resources/checkout_configurations.rbi +5 -1
  164. data/rbi/whop_sdk/resources/companies.rbi +5 -1
  165. data/rbi/whop_sdk/resources/course_chapters.rbi +11 -2
  166. data/rbi/whop_sdk/resources/course_lesson_interactions.rbi +5 -1
  167. data/rbi/whop_sdk/resources/course_lessons.rbi +41 -2
  168. data/rbi/whop_sdk/resources/course_students.rbi +5 -1
  169. data/rbi/whop_sdk/resources/courses.rbi +28 -2
  170. data/rbi/whop_sdk/resources/disputes.rbi +194 -0
  171. data/rbi/whop_sdk/resources/entries.rbi +15 -3
  172. data/rbi/whop_sdk/resources/experiences.rbi +14 -2
  173. data/rbi/whop_sdk/resources/forum_posts.rbi +6 -1
  174. data/rbi/whop_sdk/resources/forums.rbi +6 -1
  175. data/rbi/whop_sdk/resources/invoices.rbi +20 -5
  176. data/rbi/whop_sdk/resources/ledger_accounts.rbi +7 -2
  177. data/rbi/whop_sdk/resources/members.rbi +9 -5
  178. data/rbi/whop_sdk/resources/memberships.rbi +16 -5
  179. data/rbi/whop_sdk/resources/messages.rbi +6 -1
  180. data/rbi/whop_sdk/resources/notifications.rbi +54 -0
  181. data/rbi/whop_sdk/resources/payments.rbi +16 -3
  182. data/rbi/whop_sdk/resources/plans.rbi +12 -3
  183. data/rbi/whop_sdk/resources/products.rbi +15 -6
  184. data/rbi/whop_sdk/resources/promo_codes.rbi +10 -2
  185. data/rbi/whop_sdk/resources/reactions.rbi +5 -1
  186. data/rbi/whop_sdk/resources/reviews.rbi +5 -1
  187. data/rbi/whop_sdk/resources/shipments.rbi +5 -1
  188. data/rbi/whop_sdk/resources/support_channels.rbi +5 -1
  189. data/rbi/whop_sdk/resources/transfers.rbi +5 -1
  190. data/rbi/whop_sdk/resources/users.rbi +13 -2
  191. data/rbi/whop_sdk/resources/webhooks.rbi +3 -1
  192. data/sig/whop_sdk/client.rbs +7 -1
  193. data/sig/whop_sdk/internal/transport/base_client.rbs +2 -0
  194. data/sig/whop_sdk/internal/transport/pooled_net_requester.rbs +4 -1
  195. data/sig/whop_sdk/models/access_token_create_params.rbs +56 -0
  196. data/sig/whop_sdk/models/access_token_create_response.rbs +15 -0
  197. data/sig/whop_sdk/models/company.rbs +2 -0
  198. data/sig/whop_sdk/models/course.rbs +13 -3
  199. data/sig/whop_sdk/models/course_create_params.rbs +11 -1
  200. data/sig/whop_sdk/models/course_lesson_create_params.rbs +46 -0
  201. data/sig/whop_sdk/models/course_lesson_list_response.rbs +25 -0
  202. data/sig/whop_sdk/models/course_lesson_update_params.rbs +46 -0
  203. data/sig/whop_sdk/models/course_list_response.rbs +13 -3
  204. data/sig/whop_sdk/models/course_update_params.rbs +11 -1
  205. data/sig/whop_sdk/models/course_visibilities.rbs +14 -0
  206. data/sig/whop_sdk/models/dispute.rbs +437 -0
  207. data/sig/whop_sdk/models/dispute_created_webhook_event.rbs +40 -0
  208. data/sig/whop_sdk/models/dispute_list_params.rbs +51 -0
  209. data/sig/whop_sdk/models/dispute_list_response.rbs +124 -0
  210. data/sig/whop_sdk/models/dispute_retrieve_params.rbs +15 -0
  211. data/sig/whop_sdk/models/dispute_statuses.rbs +30 -0
  212. data/sig/whop_sdk/models/dispute_submit_evidence_params.rbs +15 -0
  213. data/sig/whop_sdk/models/dispute_update_evidence_params.rbs +215 -0
  214. data/sig/whop_sdk/models/dispute_updated_webhook_event.rbs +40 -0
  215. data/sig/whop_sdk/models/embed_type.rbs +14 -0
  216. data/sig/whop_sdk/models/invoice_list_params.rbs +16 -33
  217. data/sig/whop_sdk/models/lesson.rbs +25 -0
  218. data/sig/whop_sdk/models/member_list_params.rbs +5 -5
  219. data/sig/whop_sdk/models/membership_list_params.rbs +5 -5
  220. data/sig/whop_sdk/models/notification_create_params.rbs +61 -0
  221. data/sig/whop_sdk/models/notification_create_response.rbs +13 -0
  222. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +2 -0
  223. data/sig/whop_sdk/models.rbs +24 -0
  224. data/sig/whop_sdk/resources/access_tokens.rbs +15 -0
  225. data/sig/whop_sdk/resources/course_lessons.rbs +6 -0
  226. data/sig/whop_sdk/resources/courses.rbs +4 -0
  227. data/sig/whop_sdk/resources/disputes.rbs +46 -0
  228. data/sig/whop_sdk/resources/invoices.rbs +3 -1
  229. data/sig/whop_sdk/resources/members.rbs +1 -1
  230. data/sig/whop_sdk/resources/memberships.rbs +1 -1
  231. data/sig/whop_sdk/resources/notifications.rbs +19 -0
  232. data/sig/whop_sdk/resources/webhooks.rbs +3 -1
  233. metadata +56 -2
@@ -3,7 +3,7 @@
3
3
  module WhopSDK
4
4
  module Resources
5
5
  class LedgerAccounts
6
- # Retrieves a ledger account by ID
6
+ # Retrieves a ledger account by its ID, company ID or user ID
7
7
  #
8
8
  # Required permissions:
9
9
  #
@@ -14,7 +14,12 @@ module WhopSDK
14
14
  request_options: WhopSDK::RequestOptions::OrHash
15
15
  ).returns(WhopSDK::Models::LedgerAccountRetrieveResponse)
16
16
  end
17
- def retrieve(id, request_options: {})
17
+ def retrieve(
18
+ # Either a User ID, Company ID, or LedgerAccount ID (user_xxx, biz_xxx, or
19
+ # ldgr_xxx)
20
+ id,
21
+ request_options: {}
22
+ )
18
23
  end
19
24
 
20
25
  # @api private
@@ -16,7 +16,11 @@ module WhopSDK
16
16
  request_options: WhopSDK::RequestOptions::OrHash
17
17
  ).returns(WhopSDK::Models::MemberRetrieveResponse)
18
18
  end
19
- def retrieve(id, request_options: {})
19
+ def retrieve(
20
+ # The ID of the member
21
+ id,
22
+ request_options: {}
23
+ )
20
24
  end
21
25
 
22
26
  # List the members of a company
@@ -30,7 +34,6 @@ module WhopSDK
30
34
  params(
31
35
  company_id: String,
32
36
  access_level: T.nilable(WhopSDK::AccessLevel::OrSymbol),
33
- access_pass_ids: T.nilable(T::Array[String]),
34
37
  after: T.nilable(String),
35
38
  before: T.nilable(String),
36
39
  created_after: T.nilable(Time),
@@ -42,6 +45,7 @@ module WhopSDK
42
45
  T.nilable(T::Array[WhopSDK::MemberMostRecentActions::OrSymbol]),
43
46
  order: T.nilable(WhopSDK::MemberListParams::Order::OrSymbol),
44
47
  plan_ids: T.nilable(T::Array[String]),
48
+ product_ids: T.nilable(T::Array[String]),
45
49
  promo_code_ids: T.nilable(T::Array[String]),
46
50
  query: T.nilable(String),
47
51
  statuses: T.nilable(T::Array[WhopSDK::MemberStatuses::OrSymbol]),
@@ -54,10 +58,8 @@ module WhopSDK
54
58
  def list(
55
59
  # The ID of the company to list members for
56
60
  company_id:,
57
- # The access level a given user (or company) has to an access pass or company.
61
+ # The access level a given user (or company) has to a product or company.
58
62
  access_level: nil,
59
- # The access pass IDs to filter the members by
60
- access_pass_ids: nil,
61
63
  # Returns the elements in the list that come after the specified cursor.
62
64
  after: nil,
63
65
  # Returns the elements in the list that come before the specified cursor.
@@ -78,6 +80,8 @@ module WhopSDK
78
80
  order: nil,
79
81
  # The plan IDs to filter the members by
80
82
  plan_ids: nil,
83
+ # The product IDs to filter the members by
84
+ product_ids: nil,
81
85
  # The promo code IDs to filter the members by
82
86
  promo_code_ids: nil,
83
87
  # The name, username, or email to filter the members by. The email filter will
@@ -14,7 +14,11 @@ module WhopSDK
14
14
  request_options: WhopSDK::RequestOptions::OrHash
15
15
  ).returns(WhopSDK::Membership)
16
16
  end
17
- def retrieve(id, request_options: {})
17
+ def retrieve(
18
+ # The ID of the membership or a license key
19
+ id,
20
+ request_options: {}
21
+ )
18
22
  end
19
23
 
20
24
  # Update a membership
@@ -31,6 +35,7 @@ module WhopSDK
31
35
  ).returns(WhopSDK::Membership)
32
36
  end
33
37
  def update(
38
+ # The ID of the membership.
34
39
  id,
35
40
  # The metadata to update the membership with.
36
41
  metadata: nil,
@@ -45,7 +50,6 @@ module WhopSDK
45
50
  # - `member:basic:read`
46
51
  sig do
47
52
  params(
48
- access_pass_ids: T.nilable(T::Array[String]),
49
53
  after: T.nilable(String),
50
54
  before: T.nilable(String),
51
55
  cancel_options:
@@ -60,6 +64,7 @@ module WhopSDK
60
64
  last: T.nilable(Integer),
61
65
  order: T.nilable(WhopSDK::MembershipListParams::Order::OrSymbol),
62
66
  plan_ids: T.nilable(T::Array[String]),
67
+ product_ids: T.nilable(T::Array[String]),
63
68
  promo_code_ids: T.nilable(T::Array[String]),
64
69
  statuses: T.nilable(T::Array[WhopSDK::MembershipStatus::OrSymbol]),
65
70
  user_ids: T.nilable(T::Array[String]),
@@ -69,8 +74,6 @@ module WhopSDK
69
74
  )
70
75
  end
71
76
  def list(
72
- # The access pass IDs to filter the memberships by
73
- access_pass_ids: nil,
74
77
  # Returns the elements in the list that come after the specified cursor.
75
78
  after: nil,
76
79
  # Returns the elements in the list that come before the specified cursor.
@@ -93,6 +96,8 @@ module WhopSDK
93
96
  order: nil,
94
97
  # The plan IDs to filter the memberships by
95
98
  plan_ids: nil,
99
+ # The product IDs to filter the memberships by
100
+ product_ids: nil,
96
101
  # The promo code IDs to filter the memberships by
97
102
  promo_code_ids: nil,
98
103
  # The membership status to filter the memberships by
@@ -121,6 +126,7 @@ module WhopSDK
121
126
  ).returns(WhopSDK::Membership)
122
127
  end
123
128
  def cancel(
129
+ # The ID of the membership.
124
130
  id,
125
131
  # The mode of cancellation for a membership
126
132
  cancellation_mode: nil,
@@ -142,6 +148,7 @@ module WhopSDK
142
148
  ).returns(WhopSDK::Membership)
143
149
  end
144
150
  def pause(
151
+ # The ID of the membership you want to pause.
145
152
  id,
146
153
  # Whether to void past_due payments associated with the membership to prevent
147
154
  # future payment attempts.
@@ -162,7 +169,11 @@ module WhopSDK
162
169
  request_options: WhopSDK::RequestOptions::OrHash
163
170
  ).returns(WhopSDK::Membership)
164
171
  end
165
- def resume(id, request_options: {})
172
+ def resume(
173
+ # The ID of the membership you want to resume.
174
+ id,
175
+ request_options: {}
176
+ )
166
177
  end
167
178
 
168
179
  # @api private
@@ -49,7 +49,11 @@ module WhopSDK
49
49
  request_options: WhopSDK::RequestOptions::OrHash
50
50
  ).returns(WhopSDK::Message)
51
51
  end
52
- def retrieve(id, request_options: {})
52
+ def retrieve(
53
+ # The ID of the message
54
+ id,
55
+ request_options: {}
56
+ )
53
57
  end
54
58
 
55
59
  # Updates an existing message
@@ -71,6 +75,7 @@ module WhopSDK
71
75
  ).returns(WhopSDK::Message)
72
76
  end
73
77
  def update(
78
+ # The ID of the message to update
74
79
  id,
75
80
  # The attachments for this message
76
81
  attachments: nil,
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Resources
5
+ class Notifications
6
+ # Queues a notification to be sent to users in an experience or company team
7
+ sig do
8
+ params(
9
+ company_id: String,
10
+ content: String,
11
+ title: String,
12
+ experience_id: String,
13
+ icon_user_id: T.nilable(String),
14
+ rest_path: T.nilable(String),
15
+ subtitle: T.nilable(String),
16
+ user_ids: T.nilable(T::Array[String]),
17
+ request_options: WhopSDK::RequestOptions::OrHash
18
+ ).returns(WhopSDK::Models::NotificationCreateResponse)
19
+ end
20
+ def create(
21
+ # The id of the company to target. Only team members of this company will receive
22
+ # the notification. When clicked will take the user to your dashboard app view.
23
+ company_id:,
24
+ # The content of the notification
25
+ content:,
26
+ # The title of the notification
27
+ title:,
28
+ # The id of the experience to target. All users with access to this experience
29
+ # (customers and admins) will receive the notification. When clicked, open your
30
+ # experience view.
31
+ experience_id:,
32
+ # Optional: ID of a Whop user whose profile picture will be used as the
33
+ # notification icon. If not provided, defaults to the experience or company
34
+ # avatar.
35
+ icon_user_id: nil,
36
+ # The rest path to append to the generated deep link that opens your app. Use
37
+ # [restPath] in your app path in the dashboard to read this parameter.
38
+ rest_path: nil,
39
+ # The subtitle of the notification
40
+ subtitle: nil,
41
+ # If provided, this will only send to these users if they are also in the main
42
+ # scope (experience or company)
43
+ user_ids: nil,
44
+ request_options: {}
45
+ )
46
+ end
47
+
48
+ # @api private
49
+ sig { params(client: WhopSDK::Client).returns(T.attached_class) }
50
+ def self.new(client:)
51
+ end
52
+ end
53
+ end
54
+ end
@@ -20,7 +20,11 @@ module WhopSDK
20
20
  request_options: WhopSDK::RequestOptions::OrHash
21
21
  ).returns(WhopSDK::Payment)
22
22
  end
23
- def retrieve(id, request_options: {})
23
+ def retrieve(
24
+ # The ID of the payment
25
+ id,
26
+ request_options: {}
27
+ )
24
28
  end
25
29
 
26
30
  # Lists payments
@@ -115,6 +119,7 @@ module WhopSDK
115
119
  ).returns(WhopSDK::Payment)
116
120
  end
117
121
  def refund(
122
+ # The ID of the payment you want to update or take action upon.
118
123
  id,
119
124
  # An amount if the refund is supposed to be partial.
120
125
  partial_amount: nil,
@@ -139,7 +144,11 @@ module WhopSDK
139
144
  request_options: WhopSDK::RequestOptions::OrHash
140
145
  ).returns(WhopSDK::Payment)
141
146
  end
142
- def retry_(id, request_options: {})
147
+ def retry_(
148
+ # The ID of the payment
149
+ id,
150
+ request_options: {}
151
+ )
143
152
  end
144
153
 
145
154
  # Voids a payment
@@ -159,7 +168,11 @@ module WhopSDK
159
168
  request_options: WhopSDK::RequestOptions::OrHash
160
169
  ).returns(WhopSDK::Payment)
161
170
  end
162
- def void(id, request_options: {})
171
+ def void(
172
+ # The ID of the payment you want to void.
173
+ id,
174
+ request_options: {}
175
+ )
163
176
  end
164
177
 
165
178
  # @api private
@@ -76,7 +76,7 @@ module WhopSDK
76
76
  # The explicit payment method configuration for the plan. If not provided, the
77
77
  # platform or company's defaults will apply.
78
78
  payment_method_configuration: nil,
79
- # The type of plan that can be attached to an access pass
79
+ # The type of plan that can be attached to a product
80
80
  plan_type: nil,
81
81
  # The methods of how a plan can be released.
82
82
  release_method: nil,
@@ -114,7 +114,11 @@ module WhopSDK
114
114
  request_options: WhopSDK::RequestOptions::OrHash
115
115
  ).returns(WhopSDK::Plan)
116
116
  end
117
- def retrieve(id, request_options: {})
117
+ def retrieve(
118
+ # The ID of the plan
119
+ id,
120
+ request_options: {}
121
+ )
118
122
  end
119
123
 
120
124
  # Update an existing Plan
@@ -160,6 +164,7 @@ module WhopSDK
160
164
  ).returns(WhopSDK::Plan)
161
165
  end
162
166
  def update(
167
+ # The ID
163
168
  id,
164
169
  # The interval at which the plan charges (renewal plans).
165
170
  billing_period: nil,
@@ -270,7 +275,11 @@ module WhopSDK
270
275
  request_options: WhopSDK::RequestOptions::OrHash
271
276
  ).returns(T::Boolean)
272
277
  end
273
- def delete(id, request_options: {})
278
+ def delete(
279
+ # The ID of the plan to delete.
280
+ id,
281
+ request_options: {}
282
+ )
274
283
  end
275
284
 
276
285
  # @api private
@@ -64,7 +64,7 @@ module WhopSDK
64
64
  experience_ids: nil,
65
65
  # The percentage of the revenue that goes to the global affiliate program.
66
66
  global_affiliate_percentage: nil,
67
- # The different statuses of the global affiliate program for an access pass.
67
+ # The different statuses of the global affiliate program for a product.
68
68
  global_affiliate_status: nil,
69
69
  # The headline of the product.
70
70
  headline: nil,
@@ -72,7 +72,7 @@ module WhopSDK
72
72
  industry_type: nil,
73
73
  # The percentage of the revenue that goes to the member affiliate program.
74
74
  member_affiliate_percentage: nil,
75
- # The different statuses of the global affiliate program for an access pass.
75
+ # The different statuses of the global affiliate program for a product.
76
76
  member_affiliate_status: nil,
77
77
  # The details to assign an autogenerated plan.
78
78
  plan_options: nil,
@@ -101,7 +101,11 @@ module WhopSDK
101
101
  request_options: WhopSDK::RequestOptions::OrHash
102
102
  ).returns(WhopSDK::Product)
103
103
  end
104
- def retrieve(id, request_options: {})
104
+ def retrieve(
105
+ # The ID or route of the product
106
+ id,
107
+ request_options: {}
108
+ )
105
109
  end
106
110
 
107
111
  # Updates an existing Product
@@ -145,6 +149,7 @@ module WhopSDK
145
149
  ).returns(WhopSDK::Product)
146
150
  end
147
151
  def update(
152
+ # The ID (tag) of the product
148
153
  id,
149
154
  # A banner image for the product in png, jpeg format
150
155
  banner_image: nil,
@@ -164,7 +169,7 @@ module WhopSDK
164
169
  description: nil,
165
170
  # The percentage of the revenue that goes to the global affiliate program.
166
171
  global_affiliate_percentage: nil,
167
- # The different statuses of the global affiliate program for an access pass.
172
+ # The different statuses of the global affiliate program for a product.
168
173
  global_affiliate_status: nil,
169
174
  # The headline of the product.
170
175
  headline: nil,
@@ -172,7 +177,7 @@ module WhopSDK
172
177
  industry_type: nil,
173
178
  # The percentage of the revenue that goes to the member affiliate program.
174
179
  member_affiliate_percentage: nil,
175
- # The different statuses of the global affiliate program for an access pass.
180
+ # The different statuses of the global affiliate program for a product.
176
181
  member_affiliate_status: nil,
177
182
  # The ID of the product tax code to apply to this product.
178
183
  product_tax_code_id: nil,
@@ -244,7 +249,11 @@ module WhopSDK
244
249
  request_options: WhopSDK::RequestOptions::OrHash
245
250
  ).returns(T::Boolean)
246
251
  end
247
- def delete(id, request_options: {})
252
+ def delete(
253
+ # The internal ID (tag) of the product to delete.
254
+ id,
255
+ request_options: {}
256
+ )
248
257
  end
249
258
 
250
259
  # @api private
@@ -79,7 +79,11 @@ module WhopSDK
79
79
  request_options: WhopSDK::RequestOptions::OrHash
80
80
  ).returns(WhopSDK::PromoCode)
81
81
  end
82
- def retrieve(id, request_options: {})
82
+ def retrieve(
83
+ # The ID of the promo code to retrieve
84
+ id,
85
+ request_options: {}
86
+ )
83
87
  end
84
88
 
85
89
  # Lists promo codes for a company
@@ -135,7 +139,11 @@ module WhopSDK
135
139
  request_options: WhopSDK::RequestOptions::OrHash
136
140
  ).returns(T::Boolean)
137
141
  end
138
- def delete(id, request_options: {})
142
+ def delete(
143
+ # The internal ID of the promo code to archive.
144
+ id,
145
+ request_options: {}
146
+ )
139
147
  end
140
148
 
141
149
  # @api private
@@ -36,7 +36,11 @@ module WhopSDK
36
36
  request_options: WhopSDK::RequestOptions::OrHash
37
37
  ).returns(WhopSDK::Reaction)
38
38
  end
39
- def retrieve(id, request_options: {})
39
+ def retrieve(
40
+ # The ID of the reaction
41
+ id,
42
+ request_options: {}
43
+ )
40
44
  end
41
45
 
42
46
  # Lists reactions for a post or a message
@@ -10,7 +10,11 @@ module WhopSDK
10
10
  request_options: WhopSDK::RequestOptions::OrHash
11
11
  ).returns(WhopSDK::Models::ReviewRetrieveResponse)
12
12
  end
13
- def retrieve(id, request_options: {})
13
+ def retrieve(
14
+ # The ID of the review
15
+ id,
16
+ request_options: {}
17
+ )
14
18
  end
15
19
 
16
20
  # List all reviews
@@ -40,7 +40,11 @@ module WhopSDK
40
40
  request_options: WhopSDK::RequestOptions::OrHash
41
41
  ).returns(WhopSDK::Shipment)
42
42
  end
43
- def retrieve(id, request_options: {})
43
+ def retrieve(
44
+ # The ID of the shipment
45
+ id,
46
+ request_options: {}
47
+ )
44
48
  end
45
49
 
46
50
  # Lists shipments for a payment
@@ -36,7 +36,11 @@ module WhopSDK
36
36
  request_options: WhopSDK::RequestOptions::OrHash
37
37
  ).returns(WhopSDK::SupportChannel)
38
38
  end
39
- def retrieve(id, request_options: {})
39
+ def retrieve(
40
+ # The ID of the support channel to fetch
41
+ id,
42
+ request_options: {}
43
+ )
40
44
  end
41
45
 
42
46
  # Lists chat channels inside a company
@@ -52,7 +52,11 @@ module WhopSDK
52
52
  request_options: WhopSDK::RequestOptions::OrHash
53
53
  ).returns(WhopSDK::Transfer)
54
54
  end
55
- def retrieve(id, request_options: {})
55
+ def retrieve(
56
+ # The ID of the transfer
57
+ id,
58
+ request_options: {}
59
+ )
56
60
  end
57
61
 
58
62
  # Lists transfers
@@ -10,7 +10,11 @@ module WhopSDK
10
10
  request_options: WhopSDK::RequestOptions::OrHash
11
11
  ).returns(WhopSDK::Models::UserRetrieveResponse)
12
12
  end
13
- def retrieve(id, request_options: {})
13
+ def retrieve(
14
+ # The ID (user_xxx) or username of the user
15
+ id,
16
+ request_options: {}
17
+ )
14
18
  end
15
19
 
16
20
  # Check if a user has access (and their access level) to a resource
@@ -21,7 +25,14 @@ module WhopSDK
21
25
  request_options: WhopSDK::RequestOptions::OrHash
22
26
  ).returns(WhopSDK::Models::UserCheckAccessResponse)
23
27
  end
24
- def check_access(resource_id, id:, request_options: {})
28
+ def check_access(
29
+ # The ID of the resource. Can be a company (biz_xxx), product (prod_xxx), or
30
+ # experience (exp_xxx)
31
+ resource_id,
32
+ # The ID (user_xxx) or username of the user
33
+ id:,
34
+ request_options: {}
35
+ )
25
36
  end
26
37
 
27
38
  # @api private
@@ -19,7 +19,9 @@ module WhopSDK
19
19
  WhopSDK::CourseLessonInteractionCompletedWebhookEvent,
20
20
  WhopSDK::PaymentSucceededWebhookEvent,
21
21
  WhopSDK::PaymentFailedWebhookEvent,
22
- WhopSDK::PaymentPendingWebhookEvent
22
+ WhopSDK::PaymentPendingWebhookEvent,
23
+ WhopSDK::DisputeCreatedWebhookEvent,
24
+ WhopSDK::DisputeUpdatedWebhookEvent
23
25
  )
24
26
  )
25
27
  end
@@ -10,7 +10,7 @@ module WhopSDK
10
10
 
11
11
  attr_reader api_key: String
12
12
 
13
- attr_reader app_id: String
13
+ attr_reader app_id: String?
14
14
 
15
15
  attr_reader apps: WhopSDK::Resources::Apps
16
16
 
@@ -74,6 +74,12 @@ module WhopSDK
74
74
 
75
75
  attr_reader course_students: WhopSDK::Resources::CourseStudents
76
76
 
77
+ attr_reader access_tokens: WhopSDK::Resources::AccessTokens
78
+
79
+ attr_reader notifications: WhopSDK::Resources::Notifications
80
+
81
+ attr_reader disputes: WhopSDK::Resources::Disputes
82
+
77
83
  private def auth_headers: -> ::Hash[String, String]
78
84
 
79
85
  def initialize: (
@@ -87,6 +87,8 @@ module WhopSDK
87
87
 
88
88
  private def auth_headers: -> ::Hash[String, String]
89
89
 
90
+ private def user_agent: -> String
91
+
90
92
  private def generate_idempotency_key: -> String
91
93
 
92
94
  private def build_request: (
@@ -17,7 +17,10 @@ module WhopSDK
17
17
 
18
18
  DEFAULT_MAX_CONNECTIONS: Integer
19
19
 
20
- def self.connect: (URI::Generic url) -> top
20
+ def self.connect: (
21
+ cert_store: OpenSSL::X509::Store,
22
+ url: URI::Generic
23
+ ) -> top
21
24
 
22
25
  def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
23
26
 
@@ -0,0 +1,56 @@
1
+ module WhopSDK
2
+ module Models
3
+ type access_token_create_params =
4
+ {
5
+ scoped_actions: ::Array[String],
6
+ target_resource_id: String,
7
+ target_resource_type: WhopSDK::Models::AccessTokenCreateParams::target_resource_type,
8
+ expires_at: Time?
9
+ }
10
+ & WhopSDK::Internal::Type::request_parameters
11
+
12
+ class AccessTokenCreateParams < WhopSDK::Internal::Type::BaseModel
13
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
14
+ include WhopSDK::Internal::Type::RequestParameters
15
+
16
+ attr_accessor scoped_actions: ::Array[String]
17
+
18
+ attr_accessor target_resource_id: String
19
+
20
+ attr_accessor target_resource_type: WhopSDK::Models::AccessTokenCreateParams::target_resource_type
21
+
22
+ attr_accessor expires_at: Time?
23
+
24
+ def initialize: (
25
+ scoped_actions: ::Array[String],
26
+ target_resource_id: String,
27
+ target_resource_type: WhopSDK::Models::AccessTokenCreateParams::target_resource_type,
28
+ ?expires_at: Time?,
29
+ ?request_options: WhopSDK::request_opts
30
+ ) -> void
31
+
32
+ def to_hash: -> {
33
+ scoped_actions: ::Array[String],
34
+ target_resource_id: String,
35
+ target_resource_type: WhopSDK::Models::AccessTokenCreateParams::target_resource_type,
36
+ expires_at: Time?,
37
+ request_options: WhopSDK::RequestOptions
38
+ }
39
+
40
+ type target_resource_type =
41
+ :company | :product | :experience | :app | :user
42
+
43
+ module TargetResourceType
44
+ extend WhopSDK::Internal::Type::Enum
45
+
46
+ COMPANY: :company
47
+ PRODUCT: :product
48
+ EXPERIENCE: :experience
49
+ APP: :app
50
+ USER: :user
51
+
52
+ def self?.values: -> ::Array[WhopSDK::Models::AccessTokenCreateParams::target_resource_type]
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,15 @@
1
+ module WhopSDK
2
+ module Models
3
+ type access_token_create_response = { token: String, expires_at: Time }
4
+
5
+ class AccessTokenCreateResponse < WhopSDK::Internal::Type::BaseModel
6
+ attr_accessor token: String
7
+
8
+ attr_accessor expires_at: Time
9
+
10
+ def initialize: (token: String, expires_at: Time) -> void
11
+
12
+ def to_hash: -> { token: String, expires_at: Time }
13
+ end
14
+ end
15
+ end
@@ -145,6 +145,7 @@ module WhopSDK
145
145
  | :linkedin
146
146
  | :twitch
147
147
  | :website
148
+ | :custom
148
149
 
149
150
  module Website
150
151
  extend WhopSDK::Internal::Type::Enum
@@ -157,6 +158,7 @@ module WhopSDK
157
158
  LINKEDIN: :linkedin
158
159
  TWITCH: :twitch
159
160
  WEBSITE: :website
161
+ CUSTOM: :custom
160
162
 
161
163
  def self?.values: -> ::Array[WhopSDK::Models::Company::SocialLink::website]
162
164
  end