whop_sdk 0.0.20 → 0.0.22

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 (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +10 -1
  4. data/lib/whop_sdk/client.rb +12 -0
  5. data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +12 -10
  6. data/lib/whop_sdk/internal/util.rb +7 -2
  7. data/lib/whop_sdk/models/lead_create_params.rb +58 -0
  8. data/lib/whop_sdk/models/lead_create_response.rb +149 -0
  9. data/lib/whop_sdk/models/lead_list_params.rb +78 -0
  10. data/lib/whop_sdk/models/lead_list_response.rb +149 -0
  11. data/lib/whop_sdk/models/lead_retrieve_params.rb +14 -0
  12. data/lib/whop_sdk/models/lead_retrieve_response.rb +149 -0
  13. data/lib/whop_sdk/models/lead_update_params.rb +30 -0
  14. data/lib/whop_sdk/models/lead_update_response.rb +149 -0
  15. data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +106 -1
  16. data/lib/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rb +53 -0
  17. data/lib/whop_sdk/models/membership_status.rb +1 -0
  18. data/lib/whop_sdk/models/payment.rb +3 -3
  19. data/lib/whop_sdk/models/payment_create_params.rb +9 -1
  20. data/lib/whop_sdk/models/payment_list_fees_response.rb +1 -0
  21. data/lib/whop_sdk/models/payment_list_response.rb +3 -3
  22. data/lib/whop_sdk/models/payment_method_list_params.rb +16 -8
  23. data/lib/whop_sdk/models/payment_method_retrieve_params.rb +13 -5
  24. data/lib/whop_sdk/models/payout_method_created_webhook_event.rb +168 -0
  25. data/lib/whop_sdk/models/payout_method_list_response.rb +31 -1
  26. data/lib/whop_sdk/models/payout_method_retrieve_params.rb +14 -0
  27. data/lib/whop_sdk/models/payout_method_retrieve_response.rb +125 -0
  28. data/lib/whop_sdk/models/support_channel_create_params.rb +2 -2
  29. data/lib/whop_sdk/models/topup_create_params.rb +46 -0
  30. data/lib/whop_sdk/models/topup_create_response.rb +67 -0
  31. data/lib/whop_sdk/models/unwrap_webhook_event.rb +8 -1
  32. data/lib/whop_sdk/models/verification_retrieve_params.rb +14 -0
  33. data/lib/whop_sdk/models/verification_retrieve_response.rb +99 -0
  34. data/lib/whop_sdk/models/verification_succeeded_webhook_event.rb +142 -0
  35. data/lib/whop_sdk/models.rb +21 -0
  36. data/lib/whop_sdk/resources/leads.rb +158 -0
  37. data/lib/whop_sdk/resources/payment_methods.rb +12 -8
  38. data/lib/whop_sdk/resources/payments.rb +3 -1
  39. data/lib/whop_sdk/resources/payout_methods.rb +24 -0
  40. data/lib/whop_sdk/resources/support_channels.rb +1 -1
  41. data/lib/whop_sdk/resources/topups.rb +46 -0
  42. data/lib/whop_sdk/resources/verifications.rb +38 -0
  43. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  44. data/lib/whop_sdk/version.rb +1 -1
  45. data/lib/whop_sdk.rb +20 -0
  46. data/rbi/whop_sdk/client.rbi +9 -0
  47. data/rbi/whop_sdk/models/lead_create_params.rbi +77 -0
  48. data/rbi/whop_sdk/models/lead_create_response.rbi +234 -0
  49. data/rbi/whop_sdk/models/lead_list_params.rbi +99 -0
  50. data/rbi/whop_sdk/models/lead_list_response.rbi +230 -0
  51. data/rbi/whop_sdk/models/lead_retrieve_params.rbi +27 -0
  52. data/rbi/whop_sdk/models/lead_retrieve_response.rbi +238 -0
  53. data/rbi/whop_sdk/models/lead_update_params.rbi +51 -0
  54. data/rbi/whop_sdk/models/lead_update_response.rbi +234 -0
  55. data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +318 -0
  56. data/rbi/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbi +77 -0
  57. data/rbi/whop_sdk/models/membership_status.rbi +1 -0
  58. data/rbi/whop_sdk/models/payment.rbi +4 -4
  59. data/rbi/whop_sdk/models/payment_create_params.rbi +8 -0
  60. data/rbi/whop_sdk/models/payment_list_fees_response.rbi +5 -0
  61. data/rbi/whop_sdk/models/payment_list_response.rbi +4 -4
  62. data/rbi/whop_sdk/models/payment_method_list_params.rbi +16 -8
  63. data/rbi/whop_sdk/models/payment_method_retrieve_params.rbi +17 -6
  64. data/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi +340 -0
  65. data/rbi/whop_sdk/models/payout_method_list_response.rbi +58 -0
  66. data/rbi/whop_sdk/models/payout_method_retrieve_params.rbi +27 -0
  67. data/rbi/whop_sdk/models/payout_method_retrieve_response.rbi +262 -0
  68. data/rbi/whop_sdk/models/support_channel_create_params.rbi +2 -2
  69. data/rbi/whop_sdk/models/topup_create_params.rbi +67 -0
  70. data/rbi/whop_sdk/models/topup_create_response.rbi +89 -0
  71. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +4 -1
  72. data/rbi/whop_sdk/models/verification_retrieve_params.rbi +27 -0
  73. data/rbi/whop_sdk/models/verification_retrieve_response.rbi +290 -0
  74. data/rbi/whop_sdk/models/verification_succeeded_webhook_event.rbi +367 -0
  75. data/rbi/whop_sdk/models.rbi +23 -0
  76. data/rbi/whop_sdk/resources/leads.rbi +138 -0
  77. data/rbi/whop_sdk/resources/payment_methods.rbi +13 -7
  78. data/rbi/whop_sdk/resources/payments.rbi +3 -0
  79. data/rbi/whop_sdk/resources/payout_methods.rbi +18 -0
  80. data/rbi/whop_sdk/resources/support_channels.rbi +1 -1
  81. data/rbi/whop_sdk/resources/topups.rbi +39 -0
  82. data/rbi/whop_sdk/resources/verifications.rbi +30 -0
  83. data/rbi/whop_sdk/resources/webhooks.rbi +4 -1
  84. data/sig/whop_sdk/client.rbs +6 -0
  85. data/sig/whop_sdk/models/lead_create_params.rbs +46 -0
  86. data/sig/whop_sdk/models/lead_create_response.rbs +104 -0
  87. data/sig/whop_sdk/models/lead_list_params.rbs +61 -0
  88. data/sig/whop_sdk/models/lead_list_response.rbs +104 -0
  89. data/sig/whop_sdk/models/lead_retrieve_params.rbs +15 -0
  90. data/sig/whop_sdk/models/lead_retrieve_response.rbs +104 -0
  91. data/sig/whop_sdk/models/lead_update_params.rbs +28 -0
  92. data/sig/whop_sdk/models/lead_update_response.rbs +104 -0
  93. data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +119 -0
  94. data/sig/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbs +40 -0
  95. data/sig/whop_sdk/models/membership_status.rbs +2 -0
  96. data/sig/whop_sdk/models/payment_create_params.rbs +5 -0
  97. data/sig/whop_sdk/models/payment_list_fees_response.rbs +2 -0
  98. data/sig/whop_sdk/models/payment_method_list_params.rbs +11 -6
  99. data/sig/whop_sdk/models/payment_method_retrieve_params.rbs +9 -4
  100. data/sig/whop_sdk/models/payout_method_created_webhook_event.rbs +140 -0
  101. data/sig/whop_sdk/models/payout_method_list_response.rbs +20 -0
  102. data/sig/whop_sdk/models/payout_method_retrieve_params.rbs +15 -0
  103. data/sig/whop_sdk/models/payout_method_retrieve_response.rbs +103 -0
  104. data/sig/whop_sdk/models/topup_create_params.rbs +41 -0
  105. data/sig/whop_sdk/models/topup_create_response.rbs +50 -0
  106. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
  107. data/sig/whop_sdk/models/verification_retrieve_params.rbs +15 -0
  108. data/sig/whop_sdk/models/verification_retrieve_response.rbs +117 -0
  109. data/sig/whop_sdk/models/verification_succeeded_webhook_event.rbs +154 -0
  110. data/sig/whop_sdk/models.rbs +20 -0
  111. data/sig/whop_sdk/resources/leads.rbs +40 -0
  112. data/sig/whop_sdk/resources/payment_methods.rbs +4 -2
  113. data/sig/whop_sdk/resources/payments.rbs +1 -0
  114. data/sig/whop_sdk/resources/payout_methods.rbs +5 -0
  115. data/sig/whop_sdk/resources/topups.rbs +15 -0
  116. data/sig/whop_sdk/resources/verifications.rbs +12 -0
  117. data/sig/whop_sdk/resources/webhooks.rbs +4 -1
  118. metadata +62 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d32dcd76f73b594a7fb102d804def660554a926905cf81c5ad81a2835721a71
4
- data.tar.gz: 0b65615f3d8e3eaf643936cae943966f0351d2728d0882fbafa16ea33cd0c9f4
3
+ metadata.gz: 5d4384baf9f2ca929ff3e9da3833e53f8f6f883077854ba2b60ec38791b74aea
4
+ data.tar.gz: c7da0131492cefa7548eeaaf4f2718189cad00ef94bcf4f1aa92463bc4348e07
5
5
  SHA512:
6
- metadata.gz: f2a29382fe7f2ab33548b34e2ce073daf549a99081e436b5e985fdd5b10357918f81f995f58c468ea22897ecb8672384f112d53922a06b1a3930915d7b57eac4
7
- data.tar.gz: 74cb5af4f78fc63f224055e5059b6470f94aff83886ff98307312d10a0efc3be3ac3c1b29a609c25e159dae0a6de5ba2db25bbfac3ac4367c5cc653f05222cb8
6
+ metadata.gz: 8a2dad739f9b63d468256036bcb91fcaaeb888f8ac890a85b3080fc4575b0d4e36e7630b45d72b9cb2c3306aac64c3c390d956dd9b2e5e6305412a75147c7dfc
7
+ data.tar.gz: b5506c707b60c326f1ac2b08eef97eb9d90054a6bfd49c0dfd55715f63ffbf5376b405854cd8b91e4592766df1efa9dd8592636e0344394ac3b0e8939e42c740
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.22 (2026-01-07)
4
+
5
+ Full Changelog: [v0.0.20...v0.0.22](https://github.com/whopio/whopsdk-ruby/compare/v0.0.20...v0.0.22)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([3632c09](https://github.com/whopio/whopsdk-ruby/commit/3632c093586872857f605313dc80935152ceb2b4))
10
+ * **api:** api update ([1369d6a](https://github.com/whopio/whopsdk-ruby/commit/1369d6a6a970fda437f47d398f14fdbd240326ba))
11
+ * **api:** api update ([185c3ca](https://github.com/whopio/whopsdk-ruby/commit/185c3cad5d43af42c98004dfb6320bba79a4eb37))
12
+ * **api:** api update ([7b79b5e](https://github.com/whopio/whopsdk-ruby/commit/7b79b5ecb10e297b2b40c6e9bcd8710486738370))
13
+ * **api:** api update ([6b01cd6](https://github.com/whopio/whopsdk-ruby/commit/6b01cd6184c20f7b58f6b290afce78daf4fcb4ef))
14
+ * **api:** api update ([f6a40eb](https://github.com/whopio/whopsdk-ruby/commit/f6a40eb1748db6b849c3857c8dd80ea2c2ce2402))
15
+ * **api:** api update ([131ef7d](https://github.com/whopio/whopsdk-ruby/commit/131ef7d9396af31afbbc4cedb3f62835453cd4ca))
16
+ * **api:** api update ([789ca6d](https://github.com/whopio/whopsdk-ruby/commit/789ca6d43533a22f94370de9c05c4ecf9714a044))
17
+ * **api:** api update ([d165256](https://github.com/whopio/whopsdk-ruby/commit/d16525653fc3bb992650b120b2b63f3bac07dd77))
18
+ * **api:** api update ([fe37424](https://github.com/whopio/whopsdk-ruby/commit/fe37424c5fd9a258bea07a1c003148ab6fbd02bd))
19
+ * **api:** api update ([43788a0](https://github.com/whopio/whopsdk-ruby/commit/43788a0bdefecbcd1bea6393fb6959cf082a1b44))
20
+ * **api:** api update ([72d8b00](https://github.com/whopio/whopsdk-ruby/commit/72d8b0022e186f3e9e3235fb95cbbe353e3a73a9))
21
+ * **api:** manual updates ([6e8e692](https://github.com/whopio/whopsdk-ruby/commit/6e8e692bef8870ba11108e1febdefdeb70e9edbd))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * calling `break` out of streams should be instantaneous ([7503ef5](https://github.com/whopio/whopsdk-ruby/commit/7503ef5800775d0c158500da07554f6f4e3e8d95))
27
+ * issue where json.parse errors when receiving HTTP 204 with nobody ([919e4e1](https://github.com/whopio/whopsdk-ruby/commit/919e4e1a8a9dcada6957cbf07884c5cba26663fa))
28
+
29
+
30
+ ### Documentation
31
+
32
+ * prominently feature MCP server setup in root SDK readmes ([8a808ef](https://github.com/whopio/whopsdk-ruby/commit/8a808ef1e408cc29afcdfce17d03dd828c09d7cb))
33
+
3
34
  ## 0.0.20 (2025-12-16)
4
35
 
5
36
  Full Changelog: [v0.0.19...v0.0.20](https://github.com/whopio/whopsdk-ruby/compare/v0.0.19...v0.0.20)
data/README.md CHANGED
@@ -4,6 +4,15 @@ The Whop Ruby library provides convenient access to the Whop REST API from any R
4
4
 
5
5
  It is generated with [Stainless](https://www.stainless.com/).
6
6
 
7
+ ## MCP Server
8
+
9
+ Use the Whop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
10
+
11
+ [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40whop%2Fmcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3aG9wL21jcCJdfQ)
12
+ [![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40whop%2Fmcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40whop%2Fmcp%22%5D%7D)
13
+
14
+ > Note: You may need to set environment variables in your MCP client.
15
+
7
16
  ## Documentation
8
17
 
9
18
  Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/whop_sdk).
@@ -17,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
17
26
  <!-- x-release-please-start-version -->
18
27
 
19
28
  ```ruby
20
- gem "whop_sdk", "~> 0.0.20"
29
+ gem "whop_sdk", "~> 0.0.22"
21
30
  ```
22
31
 
23
32
  <!-- x-release-please-end -->
@@ -147,6 +147,15 @@ module WhopSDK
147
147
  # @return [WhopSDK::Resources::PayoutMethods]
148
148
  attr_reader :payout_methods
149
149
 
150
+ # @return [WhopSDK::Resources::Verifications]
151
+ attr_reader :verifications
152
+
153
+ # @return [WhopSDK::Resources::Leads]
154
+ attr_reader :leads
155
+
156
+ # @return [WhopSDK::Resources::Topups]
157
+ attr_reader :topups
158
+
150
159
  # @api private
151
160
  #
152
161
  # @return [Hash{String=>String}]
@@ -245,6 +254,9 @@ module WhopSDK
245
254
  @payment_methods = WhopSDK::Resources::PaymentMethods.new(client: self)
246
255
  @fee_markups = WhopSDK::Resources::FeeMarkups.new(client: self)
247
256
  @payout_methods = WhopSDK::Resources::PayoutMethods.new(client: self)
257
+ @verifications = WhopSDK::Resources::Verifications.new(client: self)
258
+ @leads = WhopSDK::Resources::Leads.new(client: self)
259
+ @topups = WhopSDK::Resources::Topups.new(client: self)
248
260
  end
249
261
 
250
262
  # Verifies a Whop user token
@@ -153,17 +153,19 @@ module WhopSDK
153
153
  end
154
154
 
155
155
  self.class.calibrate_socket_timeout(conn, deadline)
156
- conn.request(req) do |rsp|
157
- y << [req, rsp]
158
- break if finished
159
-
160
- rsp.read_body do |bytes|
161
- y << bytes.force_encoding(Encoding::BINARY)
162
- break if finished
163
-
164
- self.class.calibrate_socket_timeout(conn, deadline)
156
+ ::Kernel.catch(:jump) do
157
+ conn.request(req) do |rsp|
158
+ y << [req, rsp]
159
+ ::Kernel.throw(:jump) if finished
160
+
161
+ rsp.read_body do |bytes|
162
+ y << bytes.force_encoding(Encoding::BINARY)
163
+ ::Kernel.throw(:jump) if finished
164
+
165
+ self.class.calibrate_socket_timeout(conn, deadline)
166
+ end
167
+ eof = true
165
168
  end
166
- eof = true
167
169
  end
168
170
  end
169
171
  ensure
@@ -657,7 +657,8 @@ module WhopSDK
657
657
  def decode_content(headers, stream:, suppress_error: false)
658
658
  case (content_type = headers["content-type"])
659
659
  in WhopSDK::Internal::Util::JSON_CONTENT
660
- json = stream.to_a.join
660
+ return nil if (json = stream.to_a.join).empty?
661
+
661
662
  begin
662
663
  JSON.parse(json, symbolize_names: true)
663
664
  rescue JSON::ParserError => e
@@ -667,7 +668,11 @@ module WhopSDK
667
668
  in WhopSDK::Internal::Util::JSONL_CONTENT
668
669
  lines = decode_lines(stream)
669
670
  chain_fused(lines) do |y|
670
- lines.each { y << JSON.parse(_1, symbolize_names: true) }
671
+ lines.each do
672
+ next if _1.empty?
673
+
674
+ y << JSON.parse(_1, symbolize_names: true)
675
+ end
671
676
  end
672
677
  in %r{^text/event-stream}
673
678
  lines = decode_lines(stream)
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Leads#create
6
+ class LeadCreateParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute company_id
11
+ # The ID of the company to create a lead for.
12
+ #
13
+ # @return [String]
14
+ required :company_id, String
15
+
16
+ # @!attribute metadata
17
+ # Custom metadata for the lead.
18
+ #
19
+ # @return [Hash{Symbol=>Object}, nil]
20
+ optional :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true
21
+
22
+ # @!attribute product_id
23
+ # The ID of the product the lead is interested in.
24
+ #
25
+ # @return [String, nil]
26
+ optional :product_id, String, nil?: true
27
+
28
+ # @!attribute referrer
29
+ # The url referrer of the lead, if any.
30
+ #
31
+ # @return [String, nil]
32
+ optional :referrer, String, nil?: true
33
+
34
+ # @!attribute user_id
35
+ # The ID of the user to create a lead for. If the request is made by a user, that
36
+ # user will be used.
37
+ #
38
+ # @return [String, nil]
39
+ optional :user_id, String, nil?: true
40
+
41
+ # @!method initialize(company_id:, metadata: nil, product_id: nil, referrer: nil, user_id: nil, request_options: {})
42
+ # Some parameter documentations has been truncated, see
43
+ # {WhopSDK::Models::LeadCreateParams} for more details.
44
+ #
45
+ # @param company_id [String] The ID of the company to create a lead for.
46
+ #
47
+ # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead.
48
+ #
49
+ # @param product_id [String, nil] The ID of the product the lead is interested in.
50
+ #
51
+ # @param referrer [String, nil] The url referrer of the lead, if any.
52
+ #
53
+ # @param user_id [String, nil] The ID of the user to create a lead for. If the request is made by a user, that
54
+ #
55
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,149 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Leads#create
6
+ class LeadCreateResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The ID of the lead.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute created_at
14
+ # The timestamp of when the lead was created.
15
+ #
16
+ # @return [Time]
17
+ required :created_at, Time
18
+
19
+ # @!attribute member
20
+ # The converted member, if any.
21
+ #
22
+ # @return [WhopSDK::Models::LeadCreateResponse::Member, nil]
23
+ required :member, -> { WhopSDK::Models::LeadCreateResponse::Member }, nil?: true
24
+
25
+ # @!attribute metadata
26
+ # Custom metadata for the lead.
27
+ #
28
+ # @return [Hash{Symbol=>Object}, nil]
29
+ required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true
30
+
31
+ # @!attribute product
32
+ # The access pass the lead is interested in, if available.
33
+ #
34
+ # @return [WhopSDK::Models::LeadCreateResponse::Product, nil]
35
+ required :product, -> { WhopSDK::Models::LeadCreateResponse::Product }, nil?: true
36
+
37
+ # @!attribute referrer
38
+ # The referrer URL that brought this lead.
39
+ #
40
+ # @return [String, nil]
41
+ required :referrer, String, nil?: true
42
+
43
+ # @!attribute updated_at
44
+ # The timestamp of when the lead was last updated.
45
+ #
46
+ # @return [Time]
47
+ required :updated_at, Time
48
+
49
+ # @!attribute user
50
+ # The user who is the lead.
51
+ #
52
+ # @return [WhopSDK::Models::LeadCreateResponse::User]
53
+ required :user, -> { WhopSDK::Models::LeadCreateResponse::User }
54
+
55
+ # @!method initialize(id:, created_at:, member:, metadata:, product:, referrer:, updated_at:, user:)
56
+ # An object representing a lead (someone who is interested in a whop).
57
+ #
58
+ # @param id [String] The ID of the lead.
59
+ #
60
+ # @param created_at [Time] The timestamp of when the lead was created.
61
+ #
62
+ # @param member [WhopSDK::Models::LeadCreateResponse::Member, nil] The converted member, if any.
63
+ #
64
+ # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead.
65
+ #
66
+ # @param product [WhopSDK::Models::LeadCreateResponse::Product, nil] The access pass the lead is interested in, if available.
67
+ #
68
+ # @param referrer [String, nil] The referrer URL that brought this lead.
69
+ #
70
+ # @param updated_at [Time] The timestamp of when the lead was last updated.
71
+ #
72
+ # @param user [WhopSDK::Models::LeadCreateResponse::User] The user who is the lead.
73
+
74
+ # @see WhopSDK::Models::LeadCreateResponse#member
75
+ class Member < WhopSDK::Internal::Type::BaseModel
76
+ # @!attribute id
77
+ # The ID of the member
78
+ #
79
+ # @return [String]
80
+ required :id, String
81
+
82
+ # @!method initialize(id:)
83
+ # The converted member, if any.
84
+ #
85
+ # @param id [String] The ID of the member
86
+ end
87
+
88
+ # @see WhopSDK::Models::LeadCreateResponse#product
89
+ class Product < WhopSDK::Internal::Type::BaseModel
90
+ # @!attribute id
91
+ # The internal ID of the public product.
92
+ #
93
+ # @return [String]
94
+ required :id, String
95
+
96
+ # @!attribute title
97
+ # The title of the product. Use for Whop 4.0.
98
+ #
99
+ # @return [String]
100
+ required :title, String
101
+
102
+ # @!method initialize(id:, title:)
103
+ # The access pass the lead is interested in, if available.
104
+ #
105
+ # @param id [String] The internal ID of the public product.
106
+ #
107
+ # @param title [String] The title of the product. Use for Whop 4.0.
108
+ end
109
+
110
+ # @see WhopSDK::Models::LeadCreateResponse#user
111
+ class User < WhopSDK::Internal::Type::BaseModel
112
+ # @!attribute id
113
+ # The internal ID of the user.
114
+ #
115
+ # @return [String]
116
+ required :id, String
117
+
118
+ # @!attribute email
119
+ # The email of the user
120
+ #
121
+ # @return [String, nil]
122
+ required :email, String, nil?: true
123
+
124
+ # @!attribute name
125
+ # The name of the user from their Whop account.
126
+ #
127
+ # @return [String, nil]
128
+ required :name, String, nil?: true
129
+
130
+ # @!attribute username
131
+ # The username of the user from their Whop account.
132
+ #
133
+ # @return [String]
134
+ required :username, String
135
+
136
+ # @!method initialize(id:, email:, name:, username:)
137
+ # The user who is the lead.
138
+ #
139
+ # @param id [String] The internal ID of the user.
140
+ #
141
+ # @param email [String, nil] The email of the user
142
+ #
143
+ # @param name [String, nil] The name of the user from their Whop account.
144
+ #
145
+ # @param username [String] The username of the user from their Whop account.
146
+ end
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Leads#list
6
+ class LeadListParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute company_id
11
+ # The ID of the company to list leads for
12
+ #
13
+ # @return [String]
14
+ required :company_id, String
15
+
16
+ # @!attribute after
17
+ # Returns the elements in the list that come after the specified cursor.
18
+ #
19
+ # @return [String, nil]
20
+ optional :after, String, nil?: true
21
+
22
+ # @!attribute before
23
+ # Returns the elements in the list that come before the specified cursor.
24
+ #
25
+ # @return [String, nil]
26
+ optional :before, String, nil?: true
27
+
28
+ # @!attribute created_after
29
+ # The minimum creation date to filter by
30
+ #
31
+ # @return [Time, nil]
32
+ optional :created_after, Time, nil?: true
33
+
34
+ # @!attribute created_before
35
+ # The maximum creation date to filter by
36
+ #
37
+ # @return [Time, nil]
38
+ optional :created_before, Time, nil?: true
39
+
40
+ # @!attribute first
41
+ # Returns the first _n_ elements from the list.
42
+ #
43
+ # @return [Integer, nil]
44
+ optional :first, Integer, nil?: true
45
+
46
+ # @!attribute last
47
+ # Returns the last _n_ elements from the list.
48
+ #
49
+ # @return [Integer, nil]
50
+ optional :last, Integer, nil?: true
51
+
52
+ # @!attribute product_ids
53
+ # The product IDs to filter the leads by
54
+ #
55
+ # @return [Array<String>, nil]
56
+ optional :product_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true
57
+
58
+ # @!method initialize(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, first: nil, last: nil, product_ids: nil, request_options: {})
59
+ # @param company_id [String] The ID of the company to list leads for
60
+ #
61
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
62
+ #
63
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
64
+ #
65
+ # @param created_after [Time, nil] The minimum creation date to filter by
66
+ #
67
+ # @param created_before [Time, nil] The maximum creation date to filter by
68
+ #
69
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
70
+ #
71
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
72
+ #
73
+ # @param product_ids [Array<String>, nil] The product IDs to filter the leads by
74
+ #
75
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,149 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Leads#list
6
+ class LeadListResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The ID of the lead.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute created_at
14
+ # The timestamp of when the lead was created.
15
+ #
16
+ # @return [Time]
17
+ required :created_at, Time
18
+
19
+ # @!attribute member
20
+ # The converted member, if any.
21
+ #
22
+ # @return [WhopSDK::Models::LeadListResponse::Member, nil]
23
+ required :member, -> { WhopSDK::Models::LeadListResponse::Member }, nil?: true
24
+
25
+ # @!attribute metadata
26
+ # Custom metadata for the lead.
27
+ #
28
+ # @return [Hash{Symbol=>Object}, nil]
29
+ required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true
30
+
31
+ # @!attribute product
32
+ # The access pass the lead is interested in, if available.
33
+ #
34
+ # @return [WhopSDK::Models::LeadListResponse::Product, nil]
35
+ required :product, -> { WhopSDK::Models::LeadListResponse::Product }, nil?: true
36
+
37
+ # @!attribute referrer
38
+ # The referrer URL that brought this lead.
39
+ #
40
+ # @return [String, nil]
41
+ required :referrer, String, nil?: true
42
+
43
+ # @!attribute updated_at
44
+ # The timestamp of when the lead was last updated.
45
+ #
46
+ # @return [Time]
47
+ required :updated_at, Time
48
+
49
+ # @!attribute user
50
+ # The user who is the lead.
51
+ #
52
+ # @return [WhopSDK::Models::LeadListResponse::User]
53
+ required :user, -> { WhopSDK::Models::LeadListResponse::User }
54
+
55
+ # @!method initialize(id:, created_at:, member:, metadata:, product:, referrer:, updated_at:, user:)
56
+ # An object representing a lead (someone who is interested in a whop).
57
+ #
58
+ # @param id [String] The ID of the lead.
59
+ #
60
+ # @param created_at [Time] The timestamp of when the lead was created.
61
+ #
62
+ # @param member [WhopSDK::Models::LeadListResponse::Member, nil] The converted member, if any.
63
+ #
64
+ # @param metadata [Hash{Symbol=>Object}, nil] Custom metadata for the lead.
65
+ #
66
+ # @param product [WhopSDK::Models::LeadListResponse::Product, nil] The access pass the lead is interested in, if available.
67
+ #
68
+ # @param referrer [String, nil] The referrer URL that brought this lead.
69
+ #
70
+ # @param updated_at [Time] The timestamp of when the lead was last updated.
71
+ #
72
+ # @param user [WhopSDK::Models::LeadListResponse::User] The user who is the lead.
73
+
74
+ # @see WhopSDK::Models::LeadListResponse#member
75
+ class Member < WhopSDK::Internal::Type::BaseModel
76
+ # @!attribute id
77
+ # The ID of the member
78
+ #
79
+ # @return [String]
80
+ required :id, String
81
+
82
+ # @!method initialize(id:)
83
+ # The converted member, if any.
84
+ #
85
+ # @param id [String] The ID of the member
86
+ end
87
+
88
+ # @see WhopSDK::Models::LeadListResponse#product
89
+ class Product < WhopSDK::Internal::Type::BaseModel
90
+ # @!attribute id
91
+ # The internal ID of the public product.
92
+ #
93
+ # @return [String]
94
+ required :id, String
95
+
96
+ # @!attribute title
97
+ # The title of the product. Use for Whop 4.0.
98
+ #
99
+ # @return [String]
100
+ required :title, String
101
+
102
+ # @!method initialize(id:, title:)
103
+ # The access pass the lead is interested in, if available.
104
+ #
105
+ # @param id [String] The internal ID of the public product.
106
+ #
107
+ # @param title [String] The title of the product. Use for Whop 4.0.
108
+ end
109
+
110
+ # @see WhopSDK::Models::LeadListResponse#user
111
+ class User < WhopSDK::Internal::Type::BaseModel
112
+ # @!attribute id
113
+ # The internal ID of the user.
114
+ #
115
+ # @return [String]
116
+ required :id, String
117
+
118
+ # @!attribute email
119
+ # The email of the user
120
+ #
121
+ # @return [String, nil]
122
+ required :email, String, nil?: true
123
+
124
+ # @!attribute name
125
+ # The name of the user from their Whop account.
126
+ #
127
+ # @return [String, nil]
128
+ required :name, String, nil?: true
129
+
130
+ # @!attribute username
131
+ # The username of the user from their Whop account.
132
+ #
133
+ # @return [String]
134
+ required :username, String
135
+
136
+ # @!method initialize(id:, email:, name:, username:)
137
+ # The user who is the lead.
138
+ #
139
+ # @param id [String] The internal ID of the user.
140
+ #
141
+ # @param email [String, nil] The email of the user
142
+ #
143
+ # @param name [String, nil] The name of the user from their Whop account.
144
+ #
145
+ # @param username [String] The username of the user from their Whop account.
146
+ end
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Leads#retrieve
6
+ class LeadRetrieveParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end