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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +10 -1
- data/lib/whop_sdk/client.rb +12 -0
- data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +12 -10
- data/lib/whop_sdk/internal/util.rb +7 -2
- data/lib/whop_sdk/models/lead_create_params.rb +58 -0
- data/lib/whop_sdk/models/lead_create_response.rb +149 -0
- data/lib/whop_sdk/models/lead_list_params.rb +78 -0
- data/lib/whop_sdk/models/lead_list_response.rb +149 -0
- data/lib/whop_sdk/models/lead_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/lead_retrieve_response.rb +149 -0
- data/lib/whop_sdk/models/lead_update_params.rb +30 -0
- data/lib/whop_sdk/models/lead_update_response.rb +149 -0
- data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +106 -1
- data/lib/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rb +53 -0
- data/lib/whop_sdk/models/membership_status.rb +1 -0
- data/lib/whop_sdk/models/payment.rb +3 -3
- data/lib/whop_sdk/models/payment_create_params.rb +9 -1
- data/lib/whop_sdk/models/payment_list_fees_response.rb +1 -0
- data/lib/whop_sdk/models/payment_list_response.rb +3 -3
- data/lib/whop_sdk/models/payment_method_list_params.rb +16 -8
- data/lib/whop_sdk/models/payment_method_retrieve_params.rb +13 -5
- data/lib/whop_sdk/models/payout_method_created_webhook_event.rb +168 -0
- data/lib/whop_sdk/models/payout_method_list_response.rb +31 -1
- data/lib/whop_sdk/models/payout_method_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/payout_method_retrieve_response.rb +125 -0
- data/lib/whop_sdk/models/support_channel_create_params.rb +2 -2
- data/lib/whop_sdk/models/topup_create_params.rb +46 -0
- data/lib/whop_sdk/models/topup_create_response.rb +67 -0
- data/lib/whop_sdk/models/unwrap_webhook_event.rb +8 -1
- data/lib/whop_sdk/models/verification_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/verification_retrieve_response.rb +99 -0
- data/lib/whop_sdk/models/verification_succeeded_webhook_event.rb +142 -0
- data/lib/whop_sdk/models.rb +21 -0
- data/lib/whop_sdk/resources/leads.rb +158 -0
- data/lib/whop_sdk/resources/payment_methods.rb +12 -8
- data/lib/whop_sdk/resources/payments.rb +3 -1
- data/lib/whop_sdk/resources/payout_methods.rb +24 -0
- data/lib/whop_sdk/resources/support_channels.rb +1 -1
- data/lib/whop_sdk/resources/topups.rb +46 -0
- data/lib/whop_sdk/resources/verifications.rb +38 -0
- data/lib/whop_sdk/resources/webhooks.rb +1 -1
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +20 -0
- data/rbi/whop_sdk/client.rbi +9 -0
- data/rbi/whop_sdk/models/lead_create_params.rbi +77 -0
- data/rbi/whop_sdk/models/lead_create_response.rbi +234 -0
- data/rbi/whop_sdk/models/lead_list_params.rbi +99 -0
- data/rbi/whop_sdk/models/lead_list_response.rbi +230 -0
- data/rbi/whop_sdk/models/lead_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/lead_retrieve_response.rbi +238 -0
- data/rbi/whop_sdk/models/lead_update_params.rbi +51 -0
- data/rbi/whop_sdk/models/lead_update_response.rbi +234 -0
- data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +318 -0
- data/rbi/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbi +77 -0
- data/rbi/whop_sdk/models/membership_status.rbi +1 -0
- data/rbi/whop_sdk/models/payment.rbi +4 -4
- data/rbi/whop_sdk/models/payment_create_params.rbi +8 -0
- data/rbi/whop_sdk/models/payment_list_fees_response.rbi +5 -0
- data/rbi/whop_sdk/models/payment_list_response.rbi +4 -4
- data/rbi/whop_sdk/models/payment_method_list_params.rbi +16 -8
- data/rbi/whop_sdk/models/payment_method_retrieve_params.rbi +17 -6
- data/rbi/whop_sdk/models/payout_method_created_webhook_event.rbi +340 -0
- data/rbi/whop_sdk/models/payout_method_list_response.rbi +58 -0
- data/rbi/whop_sdk/models/payout_method_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/payout_method_retrieve_response.rbi +262 -0
- data/rbi/whop_sdk/models/support_channel_create_params.rbi +2 -2
- data/rbi/whop_sdk/models/topup_create_params.rbi +67 -0
- data/rbi/whop_sdk/models/topup_create_response.rbi +89 -0
- data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +4 -1
- data/rbi/whop_sdk/models/verification_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/verification_retrieve_response.rbi +290 -0
- data/rbi/whop_sdk/models/verification_succeeded_webhook_event.rbi +367 -0
- data/rbi/whop_sdk/models.rbi +23 -0
- data/rbi/whop_sdk/resources/leads.rbi +138 -0
- data/rbi/whop_sdk/resources/payment_methods.rbi +13 -7
- data/rbi/whop_sdk/resources/payments.rbi +3 -0
- data/rbi/whop_sdk/resources/payout_methods.rbi +18 -0
- data/rbi/whop_sdk/resources/support_channels.rbi +1 -1
- data/rbi/whop_sdk/resources/topups.rbi +39 -0
- data/rbi/whop_sdk/resources/verifications.rbi +30 -0
- data/rbi/whop_sdk/resources/webhooks.rbi +4 -1
- data/sig/whop_sdk/client.rbs +6 -0
- data/sig/whop_sdk/models/lead_create_params.rbs +46 -0
- data/sig/whop_sdk/models/lead_create_response.rbs +104 -0
- data/sig/whop_sdk/models/lead_list_params.rbs +61 -0
- data/sig/whop_sdk/models/lead_list_response.rbs +104 -0
- data/sig/whop_sdk/models/lead_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/lead_retrieve_response.rbs +104 -0
- data/sig/whop_sdk/models/lead_update_params.rbs +28 -0
- data/sig/whop_sdk/models/lead_update_response.rbs +104 -0
- data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +119 -0
- data/sig/whop_sdk/models/membership_cancel_at_period_end_changed_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/membership_status.rbs +2 -0
- data/sig/whop_sdk/models/payment_create_params.rbs +5 -0
- data/sig/whop_sdk/models/payment_list_fees_response.rbs +2 -0
- data/sig/whop_sdk/models/payment_method_list_params.rbs +11 -6
- data/sig/whop_sdk/models/payment_method_retrieve_params.rbs +9 -4
- data/sig/whop_sdk/models/payout_method_created_webhook_event.rbs +140 -0
- data/sig/whop_sdk/models/payout_method_list_response.rbs +20 -0
- data/sig/whop_sdk/models/payout_method_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/payout_method_retrieve_response.rbs +103 -0
- data/sig/whop_sdk/models/topup_create_params.rbs +41 -0
- data/sig/whop_sdk/models/topup_create_response.rbs +50 -0
- data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
- data/sig/whop_sdk/models/verification_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/verification_retrieve_response.rbs +117 -0
- data/sig/whop_sdk/models/verification_succeeded_webhook_event.rbs +154 -0
- data/sig/whop_sdk/models.rbs +20 -0
- data/sig/whop_sdk/resources/leads.rbs +40 -0
- data/sig/whop_sdk/resources/payment_methods.rbs +4 -2
- data/sig/whop_sdk/resources/payments.rbs +1 -0
- data/sig/whop_sdk/resources/payout_methods.rbs +5 -0
- data/sig/whop_sdk/resources/topups.rbs +15 -0
- data/sig/whop_sdk/resources/verifications.rbs +12 -0
- data/sig/whop_sdk/resources/webhooks.rbs +4 -1
- metadata +62 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5d4384baf9f2ca929ff3e9da3833e53f8f6f883077854ba2b60ec38791b74aea
|
|
4
|
+
data.tar.gz: c7da0131492cefa7548eeaaf4f2718189cad00ef94bcf4f1aa92463bc4348e07
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
+
[](https://cursor.com/en-US/install-mcp?name=%40whop%2Fmcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3aG9wL21jcCJdfQ)
|
|
12
|
+
[](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.
|
|
29
|
+
gem "whop_sdk", "~> 0.0.22"
|
|
21
30
|
```
|
|
22
31
|
|
|
23
32
|
<!-- x-release-please-end -->
|
data/lib/whop_sdk/client.rb
CHANGED
|
@@ -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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
|
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
|