whop_sdk 0.0.34 → 0.0.35
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 +16 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +5 -0
- data/lib/whop_sdk/models/affiliate.rb +180 -0
- data/lib/whop_sdk/models/affiliate_archive_params.rb +20 -0
- data/lib/whop_sdk/models/affiliate_archive_response.rb +8 -0
- data/lib/whop_sdk/models/affiliate_create_params.rb +30 -0
- data/lib/whop_sdk/models/affiliate_list_params.rb +99 -0
- data/lib/whop_sdk/models/affiliate_list_response.rb +180 -0
- data/lib/whop_sdk/models/affiliate_retrieve_params.rb +20 -0
- data/lib/whop_sdk/models/affiliate_unarchive_params.rb +20 -0
- data/lib/whop_sdk/models/affiliate_unarchive_response.rb +8 -0
- data/lib/whop_sdk/models/affiliates/affiliate_applies_to_payments.rb +20 -0
- data/lib/whop_sdk/models/affiliates/affiliate_applies_to_products.rb +20 -0
- data/lib/whop_sdk/models/affiliates/affiliate_override_roles.rb +20 -0
- data/lib/whop_sdk/models/affiliates/affiliate_payout_types.rb +20 -0
- data/lib/whop_sdk/models/affiliates/affiliate_revenue_bases.rb +20 -0
- data/lib/whop_sdk/models/affiliates/override_create_params.rb +153 -0
- data/lib/whop_sdk/models/affiliates/override_create_response.rb +121 -0
- data/lib/whop_sdk/models/affiliates/override_delete_params.rb +28 -0
- data/lib/whop_sdk/models/affiliates/override_delete_response.rb +10 -0
- data/lib/whop_sdk/models/affiliates/override_list_params.rb +63 -0
- data/lib/whop_sdk/models/affiliates/override_list_response.rb +121 -0
- data/lib/whop_sdk/models/affiliates/override_retrieve_params.rb +28 -0
- data/lib/whop_sdk/models/affiliates/override_retrieve_response.rb +121 -0
- data/lib/whop_sdk/models/affiliates/override_update_params.rb +66 -0
- data/lib/whop_sdk/models/affiliates/override_update_response.rb +121 -0
- data/lib/whop_sdk/models/ai_chat.rb +10 -1
- data/lib/whop_sdk/models/ai_chat_list_response.rb +10 -1
- data/lib/whop_sdk/models/ai_chat_update_params.rb +9 -1
- data/lib/whop_sdk/models/card_brands.rb +1 -0
- data/lib/whop_sdk/models/notification_preferences.rb +16 -0
- data/lib/whop_sdk/models/payment.rb +1 -0
- data/lib/whop_sdk/models/setup_intent.rb +71 -1
- data/lib/whop_sdk/models/setup_intent_list_response.rb +73 -1
- data/lib/whop_sdk/models/status.rb +17 -0
- data/lib/whop_sdk/models.rb +18 -0
- data/lib/whop_sdk/resources/affiliates/overrides.rb +188 -0
- data/lib/whop_sdk/resources/affiliates.rb +165 -0
- data/lib/whop_sdk/resources/ai_chats.rb +5 -2
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +28 -0
- data/rbi/whop_sdk/client.rbi +4 -0
- data/rbi/whop_sdk/models/affiliate.rbi +224 -0
- data/rbi/whop_sdk/models/affiliate_archive_params.rbi +35 -0
- data/rbi/whop_sdk/models/affiliate_archive_response.rbi +8 -0
- data/rbi/whop_sdk/models/affiliate_create_params.rbi +51 -0
- data/rbi/whop_sdk/models/affiliate_list_params.rbi +138 -0
- data/rbi/whop_sdk/models/affiliate_list_response.rbi +241 -0
- data/rbi/whop_sdk/models/affiliate_retrieve_params.rbi +35 -0
- data/rbi/whop_sdk/models/affiliate_unarchive_params.rbi +35 -0
- data/rbi/whop_sdk/models/affiliate_unarchive_response.rbi +8 -0
- data/rbi/whop_sdk/models/affiliates/affiliate_applies_to_payments.rbi +41 -0
- data/rbi/whop_sdk/models/affiliates/affiliate_applies_to_products.rbi +41 -0
- data/rbi/whop_sdk/models/affiliates/affiliate_override_roles.rbi +39 -0
- data/rbi/whop_sdk/models/affiliates/affiliate_payout_types.rbi +39 -0
- data/rbi/whop_sdk/models/affiliates/affiliate_revenue_bases.rbi +39 -0
- data/rbi/whop_sdk/models/affiliates/override_create_params.rbi +282 -0
- data/rbi/whop_sdk/models/affiliates/override_create_response.rbi +171 -0
- data/rbi/whop_sdk/models/affiliates/override_delete_params.rbi +48 -0
- data/rbi/whop_sdk/models/affiliates/override_delete_response.rbi +10 -0
- data/rbi/whop_sdk/models/affiliates/override_list_params.rbi +94 -0
- data/rbi/whop_sdk/models/affiliates/override_list_response.rbi +171 -0
- data/rbi/whop_sdk/models/affiliates/override_retrieve_params.rbi +48 -0
- data/rbi/whop_sdk/models/affiliates/override_retrieve_response.rbi +171 -0
- data/rbi/whop_sdk/models/affiliates/override_update_params.rbi +106 -0
- data/rbi/whop_sdk/models/affiliates/override_update_response.rbi +171 -0
- data/rbi/whop_sdk/models/ai_chat.rbi +11 -0
- data/rbi/whop_sdk/models/ai_chat_list_response.rbi +11 -0
- data/rbi/whop_sdk/models/ai_chat_update_params.rbi +10 -0
- data/rbi/whop_sdk/models/card_brands.rbi +1 -0
- data/rbi/whop_sdk/models/notification_preferences.rbi +25 -0
- data/rbi/whop_sdk/models/payment.rbi +5 -0
- data/rbi/whop_sdk/models/setup_intent.rbi +110 -0
- data/rbi/whop_sdk/models/setup_intent_list_response.rbi +114 -0
- data/rbi/whop_sdk/models/status.rbi +21 -0
- data/rbi/whop_sdk/models.rbi +18 -0
- data/rbi/whop_sdk/resources/affiliates/overrides.rbi +159 -0
- data/rbi/whop_sdk/resources/affiliates.rbi +137 -0
- data/rbi/whop_sdk/resources/ai_chats.rbi +6 -1
- data/sig/whop_sdk/client.rbs +2 -0
- data/sig/whop_sdk/models/affiliate.rbs +111 -0
- data/sig/whop_sdk/models/affiliate_archive_params.rbs +20 -0
- data/sig/whop_sdk/models/affiliate_archive_response.rbs +5 -0
- data/sig/whop_sdk/models/affiliate_create_params.rbs +28 -0
- data/sig/whop_sdk/models/affiliate_list_params.rbs +80 -0
- data/sig/whop_sdk/models/affiliate_list_response.rbs +111 -0
- data/sig/whop_sdk/models/affiliate_retrieve_params.rbs +20 -0
- data/sig/whop_sdk/models/affiliate_unarchive_params.rbs +20 -0
- data/sig/whop_sdk/models/affiliate_unarchive_response.rbs +5 -0
- data/sig/whop_sdk/models/affiliates/affiliate_applies_to_payments.rbs +18 -0
- data/sig/whop_sdk/models/affiliates/affiliate_applies_to_products.rbs +18 -0
- data/sig/whop_sdk/models/affiliates/affiliate_override_roles.rbs +18 -0
- data/sig/whop_sdk/models/affiliates/affiliate_payout_types.rbs +18 -0
- data/sig/whop_sdk/models/affiliates/affiliate_revenue_bases.rbs +18 -0
- data/sig/whop_sdk/models/affiliates/override_create_params.rbs +127 -0
- data/sig/whop_sdk/models/affiliates/override_create_response.rbs +77 -0
- data/sig/whop_sdk/models/affiliates/override_delete_params.rbs +30 -0
- data/sig/whop_sdk/models/affiliates/override_delete_response.rbs +7 -0
- data/sig/whop_sdk/models/affiliates/override_list_params.rbs +53 -0
- data/sig/whop_sdk/models/affiliates/override_list_response.rbs +77 -0
- data/sig/whop_sdk/models/affiliates/override_retrieve_params.rbs +30 -0
- data/sig/whop_sdk/models/affiliates/override_retrieve_response.rbs +77 -0
- data/sig/whop_sdk/models/affiliates/override_update_params.rbs +53 -0
- data/sig/whop_sdk/models/affiliates/override_update_response.rbs +77 -0
- data/sig/whop_sdk/models/ai_chat.rbs +5 -0
- data/sig/whop_sdk/models/ai_chat_list_response.rbs +5 -0
- data/sig/whop_sdk/models/ai_chat_update_params.rbs +10 -1
- data/sig/whop_sdk/models/card_brands.rbs +2 -0
- data/sig/whop_sdk/models/notification_preferences.rbs +14 -0
- data/sig/whop_sdk/models/payment.rbs +2 -0
- data/sig/whop_sdk/models/setup_intent.rbs +52 -0
- data/sig/whop_sdk/models/setup_intent_list_response.rbs +52 -0
- data/sig/whop_sdk/models/status.rbs +15 -0
- data/sig/whop_sdk/models.rbs +18 -0
- data/sig/whop_sdk/resources/affiliates/overrides.rbs +47 -0
- data/sig/whop_sdk/resources/affiliates.rbs +40 -0
- data/sig/whop_sdk/resources/ai_chats.rbs +1 -0
- metadata +86 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fddb394e971ab399942415bc62f4bcadf4ee8bbf2428fd11d26e321e05df35fd
|
|
4
|
+
data.tar.gz: ca5954656215f367af5cd21d03206848291ae486087e1c0398806a21c8b42c6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e12b295d17a57b34f78b364befffb0b2fafc1ec462f7161ec3a34341f3848057db1a063e65141082129aa7c87760733f196ebf113005005d651bbc9e6481e47
|
|
7
|
+
data.tar.gz: 120ffc673f55a2ab0483ec22eb8deafd87a343d5b46593694b0e937b857ed88ab708408af9c231db9a1a2afc9d42a5c321ce95d6043fc73779dfcbe64e0a8330
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.35 (2026-03-18)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.0.34...v0.0.35](https://github.com/whopio/whopsdk-ruby/compare/v0.0.34...v0.0.35)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([2a05f14](https://github.com/whopio/whopsdk-ruby/commit/2a05f143df7f46588438bd0233e3c65985831bf2))
|
|
10
|
+
* **api:** api update ([624451c](https://github.com/whopio/whopsdk-ruby/commit/624451ce95b25a90562c30261d7a1801a480260a))
|
|
11
|
+
* **api:** api update ([74adc68](https://github.com/whopio/whopsdk-ruby/commit/74adc68f5191b01622fa5f8cdde57c8bc42e27ca))
|
|
12
|
+
* **api:** manual updates ([c6920ab](https://github.com/whopio/whopsdk-ruby/commit/c6920ab5da4563867990f3c24af2798a15c9211c))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Chores
|
|
16
|
+
|
|
17
|
+
* **internal:** tweak CI branches ([26a8138](https://github.com/whopio/whopsdk-ruby/commit/26a813830154e9704907af52c2c747af6bdf6a11))
|
|
18
|
+
|
|
3
19
|
## 0.0.34 (2026-03-13)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.0.33...v0.0.34](https://github.com/whopio/whopsdk-ruby/compare/v0.0.33...v0.0.34)
|
data/README.md
CHANGED
data/lib/whop_sdk/client.rb
CHANGED
|
@@ -237,6 +237,10 @@ module WhopSDK
|
|
|
237
237
|
# @return [WhopSDK::Resources::PayoutAccounts]
|
|
238
238
|
attr_reader :payout_accounts
|
|
239
239
|
|
|
240
|
+
# Affiliates
|
|
241
|
+
# @return [WhopSDK::Resources::Affiliates]
|
|
242
|
+
attr_reader :affiliates
|
|
243
|
+
|
|
240
244
|
# @api private
|
|
241
245
|
#
|
|
242
246
|
# @return [Hash{String=>String}]
|
|
@@ -351,6 +355,7 @@ module WhopSDK
|
|
|
351
355
|
@dispute_alerts = WhopSDK::Resources::DisputeAlerts.new(client: self)
|
|
352
356
|
@resolution_center_cases = WhopSDK::Resources::ResolutionCenterCases.new(client: self)
|
|
353
357
|
@payout_accounts = WhopSDK::Resources::PayoutAccounts.new(client: self)
|
|
358
|
+
@affiliates = WhopSDK::Resources::Affiliates.new(client: self)
|
|
354
359
|
end
|
|
355
360
|
|
|
356
361
|
# Verifies a Whop user token
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::Affiliates#create
|
|
6
|
+
class Affiliate < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique identifier for the affiliate.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute active_members_count
|
|
14
|
+
# The total active members of the affiliate
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :active_members_count, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute company
|
|
20
|
+
# The company attached to this affiliate
|
|
21
|
+
#
|
|
22
|
+
# @return [WhopSDK::Models::Affiliate::Company]
|
|
23
|
+
required :company, -> { WhopSDK::Affiliate::Company }
|
|
24
|
+
|
|
25
|
+
# @!attribute created_at
|
|
26
|
+
# The datetime the affiliate was created.
|
|
27
|
+
#
|
|
28
|
+
# @return [Time]
|
|
29
|
+
required :created_at, Time
|
|
30
|
+
|
|
31
|
+
# @!attribute customer_retention_rate
|
|
32
|
+
# How many referrals have remained since they joined as members
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
required :customer_retention_rate, String
|
|
36
|
+
|
|
37
|
+
# @!attribute customer_retention_rate_ninety_days
|
|
38
|
+
# A rolling 90-day retention rate for this affiliate
|
|
39
|
+
#
|
|
40
|
+
# @return [String]
|
|
41
|
+
required :customer_retention_rate_ninety_days, String
|
|
42
|
+
|
|
43
|
+
# @!attribute monthly_recurring_revenue_usd
|
|
44
|
+
# The total MRR of the affiliate
|
|
45
|
+
#
|
|
46
|
+
# @return [String]
|
|
47
|
+
required :monthly_recurring_revenue_usd, String
|
|
48
|
+
|
|
49
|
+
# @!attribute status
|
|
50
|
+
# Statuses for resources
|
|
51
|
+
#
|
|
52
|
+
# @return [Symbol, WhopSDK::Models::Status, nil]
|
|
53
|
+
required :status, enum: -> { WhopSDK::Status }, nil?: true
|
|
54
|
+
|
|
55
|
+
# @!attribute total_overrides_count
|
|
56
|
+
# The total count of all overrides for this affiliate
|
|
57
|
+
#
|
|
58
|
+
# @return [Integer]
|
|
59
|
+
required :total_overrides_count, Integer
|
|
60
|
+
|
|
61
|
+
# @!attribute total_referral_earnings_usd
|
|
62
|
+
# The total earnings of the affiliate from the users they referred
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :total_referral_earnings_usd, String
|
|
66
|
+
|
|
67
|
+
# @!attribute total_referrals_count
|
|
68
|
+
# The total referrals of the affiliate
|
|
69
|
+
#
|
|
70
|
+
# @return [Integer]
|
|
71
|
+
required :total_referrals_count, Integer
|
|
72
|
+
|
|
73
|
+
# @!attribute total_revenue_usd
|
|
74
|
+
# The total revenue of the affiliate from their referrals
|
|
75
|
+
#
|
|
76
|
+
# @return [String]
|
|
77
|
+
required :total_revenue_usd, String
|
|
78
|
+
|
|
79
|
+
# @!attribute updated_at
|
|
80
|
+
# The datetime the affiliate was last updated.
|
|
81
|
+
#
|
|
82
|
+
# @return [Time]
|
|
83
|
+
required :updated_at, Time
|
|
84
|
+
|
|
85
|
+
# @!attribute user
|
|
86
|
+
# The user attached to this affiliate
|
|
87
|
+
#
|
|
88
|
+
# @return [WhopSDK::Models::Affiliate::User]
|
|
89
|
+
required :user, -> { WhopSDK::Affiliate::User }
|
|
90
|
+
|
|
91
|
+
# @!method initialize(id:, active_members_count:, company:, created_at:, customer_retention_rate:, customer_retention_rate_ninety_days:, monthly_recurring_revenue_usd:, status:, total_overrides_count:, total_referral_earnings_usd:, total_referrals_count:, total_revenue_usd:, updated_at:, user:)
|
|
92
|
+
# An affiliate of a company or a global affiliate
|
|
93
|
+
#
|
|
94
|
+
# @param id [String] The unique identifier for the affiliate.
|
|
95
|
+
#
|
|
96
|
+
# @param active_members_count [Integer] The total active members of the affiliate
|
|
97
|
+
#
|
|
98
|
+
# @param company [WhopSDK::Models::Affiliate::Company] The company attached to this affiliate
|
|
99
|
+
#
|
|
100
|
+
# @param created_at [Time] The datetime the affiliate was created.
|
|
101
|
+
#
|
|
102
|
+
# @param customer_retention_rate [String] How many referrals have remained since they joined as members
|
|
103
|
+
#
|
|
104
|
+
# @param customer_retention_rate_ninety_days [String] A rolling 90-day retention rate for this affiliate
|
|
105
|
+
#
|
|
106
|
+
# @param monthly_recurring_revenue_usd [String] The total MRR of the affiliate
|
|
107
|
+
#
|
|
108
|
+
# @param status [Symbol, WhopSDK::Models::Status, nil] Statuses for resources
|
|
109
|
+
#
|
|
110
|
+
# @param total_overrides_count [Integer] The total count of all overrides for this affiliate
|
|
111
|
+
#
|
|
112
|
+
# @param total_referral_earnings_usd [String] The total earnings of the affiliate from the users they referred
|
|
113
|
+
#
|
|
114
|
+
# @param total_referrals_count [Integer] The total referrals of the affiliate
|
|
115
|
+
#
|
|
116
|
+
# @param total_revenue_usd [String] The total revenue of the affiliate from their referrals
|
|
117
|
+
#
|
|
118
|
+
# @param updated_at [Time] The datetime the affiliate was last updated.
|
|
119
|
+
#
|
|
120
|
+
# @param user [WhopSDK::Models::Affiliate::User] The user attached to this affiliate
|
|
121
|
+
|
|
122
|
+
# @see WhopSDK::Models::Affiliate#company
|
|
123
|
+
class Company < WhopSDK::Internal::Type::BaseModel
|
|
124
|
+
# @!attribute id
|
|
125
|
+
# The unique identifier for the company.
|
|
126
|
+
#
|
|
127
|
+
# @return [String]
|
|
128
|
+
required :id, String
|
|
129
|
+
|
|
130
|
+
# @!attribute title
|
|
131
|
+
# The written name of the company.
|
|
132
|
+
#
|
|
133
|
+
# @return [String]
|
|
134
|
+
required :title, String
|
|
135
|
+
|
|
136
|
+
# @!method initialize(id:, title:)
|
|
137
|
+
# The company attached to this affiliate
|
|
138
|
+
#
|
|
139
|
+
# @param id [String] The unique identifier for the company.
|
|
140
|
+
#
|
|
141
|
+
# @param title [String] The written name of the company.
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# @see WhopSDK::Models::Affiliate#user
|
|
145
|
+
class User < WhopSDK::Internal::Type::BaseModel
|
|
146
|
+
# @!attribute id
|
|
147
|
+
# The unique identifier for the user.
|
|
148
|
+
#
|
|
149
|
+
# @return [String]
|
|
150
|
+
required :id, String
|
|
151
|
+
|
|
152
|
+
# @!attribute name
|
|
153
|
+
# The display name set on the user's Whop profile. Null if the user has not set a
|
|
154
|
+
# name.
|
|
155
|
+
#
|
|
156
|
+
# @return [String, nil]
|
|
157
|
+
required :name, String, nil?: true
|
|
158
|
+
|
|
159
|
+
# @!attribute username
|
|
160
|
+
# The unique username chosen by the user for their Whop profile. Null if the user
|
|
161
|
+
# has not set a username.
|
|
162
|
+
#
|
|
163
|
+
# @return [String, nil]
|
|
164
|
+
required :username, String, nil?: true
|
|
165
|
+
|
|
166
|
+
# @!method initialize(id:, name:, username:)
|
|
167
|
+
# Some parameter documentations has been truncated, see
|
|
168
|
+
# {WhopSDK::Models::Affiliate::User} for more details.
|
|
169
|
+
#
|
|
170
|
+
# The user attached to this affiliate
|
|
171
|
+
#
|
|
172
|
+
# @param id [String] The unique identifier for the user.
|
|
173
|
+
#
|
|
174
|
+
# @param name [String, nil] The display name set on the user's Whop profile. Null if the user has not set a
|
|
175
|
+
#
|
|
176
|
+
# @param username [String, nil] The unique username chosen by the user for their Whop profile. Null if the user
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::Affiliates#archive
|
|
6
|
+
class AffiliateArchiveParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(id:, request_options: {})
|
|
16
|
+
# @param id [String]
|
|
17
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::Affiliates#create
|
|
6
|
+
class AffiliateCreateParams < 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 the affiliate for.
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :company_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute user_identifier
|
|
17
|
+
# The user identifier (username, email, user ID, or Discord ID).
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
required :user_identifier, String
|
|
21
|
+
|
|
22
|
+
# @!method initialize(company_id:, user_identifier:, request_options: {})
|
|
23
|
+
# @param company_id [String] The ID of the company to create the affiliate for.
|
|
24
|
+
#
|
|
25
|
+
# @param user_identifier [String] The user identifier (username, email, user ID, or Discord ID).
|
|
26
|
+
#
|
|
27
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::Affiliates#list
|
|
6
|
+
class AffiliateListParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute company_id
|
|
11
|
+
# The unique identifier of the company to list affiliates 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 direction
|
|
29
|
+
# The direction of the sort.
|
|
30
|
+
#
|
|
31
|
+
# @return [Symbol, WhopSDK::Models::Direction, nil]
|
|
32
|
+
optional :direction, enum: -> { WhopSDK::Direction }, nil?: true
|
|
33
|
+
|
|
34
|
+
# @!attribute first
|
|
35
|
+
# Returns the first _n_ elements from the list.
|
|
36
|
+
#
|
|
37
|
+
# @return [Integer, nil]
|
|
38
|
+
optional :first, Integer, nil?: true
|
|
39
|
+
|
|
40
|
+
# @!attribute last
|
|
41
|
+
# Returns the last _n_ elements from the list.
|
|
42
|
+
#
|
|
43
|
+
# @return [Integer, nil]
|
|
44
|
+
optional :last, Integer, nil?: true
|
|
45
|
+
|
|
46
|
+
# @!attribute order
|
|
47
|
+
# Which columns can be used to sort.
|
|
48
|
+
#
|
|
49
|
+
# @return [Symbol, WhopSDK::Models::AffiliateListParams::Order, nil]
|
|
50
|
+
optional :order, enum: -> { WhopSDK::AffiliateListParams::Order }, nil?: true
|
|
51
|
+
|
|
52
|
+
# @!attribute query
|
|
53
|
+
# Search affiliates by username.
|
|
54
|
+
#
|
|
55
|
+
# @return [String, nil]
|
|
56
|
+
optional :query, String, nil?: true
|
|
57
|
+
|
|
58
|
+
# @!attribute status
|
|
59
|
+
# Statuses for resources
|
|
60
|
+
#
|
|
61
|
+
# @return [Symbol, WhopSDK::Models::Status, nil]
|
|
62
|
+
optional :status, enum: -> { WhopSDK::Status }, nil?: true
|
|
63
|
+
|
|
64
|
+
# @!method initialize(company_id:, after: nil, before: nil, direction: nil, first: nil, last: nil, order: nil, query: nil, status: nil, request_options: {})
|
|
65
|
+
# @param company_id [String] The unique identifier of the company to list affiliates for.
|
|
66
|
+
#
|
|
67
|
+
# @param after [String, nil] Returns the elements in the list that come after the specified cursor.
|
|
68
|
+
#
|
|
69
|
+
# @param before [String, nil] Returns the elements in the list that come before the specified cursor.
|
|
70
|
+
#
|
|
71
|
+
# @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort.
|
|
72
|
+
#
|
|
73
|
+
# @param first [Integer, nil] Returns the first _n_ elements from the list.
|
|
74
|
+
#
|
|
75
|
+
# @param last [Integer, nil] Returns the last _n_ elements from the list.
|
|
76
|
+
#
|
|
77
|
+
# @param order [Symbol, WhopSDK::Models::AffiliateListParams::Order, nil] Which columns can be used to sort.
|
|
78
|
+
#
|
|
79
|
+
# @param query [String, nil] Search affiliates by username.
|
|
80
|
+
#
|
|
81
|
+
# @param status [Symbol, WhopSDK::Models::Status, nil] Statuses for resources
|
|
82
|
+
#
|
|
83
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
84
|
+
|
|
85
|
+
# Which columns can be used to sort.
|
|
86
|
+
module Order
|
|
87
|
+
extend WhopSDK::Internal::Type::Enum
|
|
88
|
+
|
|
89
|
+
ID = :id
|
|
90
|
+
CREATED_AT = :created_at
|
|
91
|
+
CACHED_TOTAL_REFERRALS = :cached_total_referrals
|
|
92
|
+
CACHED_TOTAL_REWARDS = :cached_total_rewards
|
|
93
|
+
|
|
94
|
+
# @!method self.values
|
|
95
|
+
# @return [Array<Symbol>]
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::Affiliates#list
|
|
6
|
+
class AffiliateListResponse < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique identifier for the affiliate.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute active_members_count
|
|
14
|
+
# The total active members of the affiliate
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :active_members_count, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute company
|
|
20
|
+
# The company attached to this affiliate
|
|
21
|
+
#
|
|
22
|
+
# @return [WhopSDK::Models::AffiliateListResponse::Company]
|
|
23
|
+
required :company, -> { WhopSDK::Models::AffiliateListResponse::Company }
|
|
24
|
+
|
|
25
|
+
# @!attribute created_at
|
|
26
|
+
# The datetime the affiliate was created.
|
|
27
|
+
#
|
|
28
|
+
# @return [Time]
|
|
29
|
+
required :created_at, Time
|
|
30
|
+
|
|
31
|
+
# @!attribute customer_retention_rate
|
|
32
|
+
# How many referrals have remained since they joined as members
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
required :customer_retention_rate, String
|
|
36
|
+
|
|
37
|
+
# @!attribute customer_retention_rate_ninety_days
|
|
38
|
+
# A rolling 90-day retention rate for this affiliate
|
|
39
|
+
#
|
|
40
|
+
# @return [String]
|
|
41
|
+
required :customer_retention_rate_ninety_days, String
|
|
42
|
+
|
|
43
|
+
# @!attribute monthly_recurring_revenue_usd
|
|
44
|
+
# The total MRR of the affiliate
|
|
45
|
+
#
|
|
46
|
+
# @return [String]
|
|
47
|
+
required :monthly_recurring_revenue_usd, String
|
|
48
|
+
|
|
49
|
+
# @!attribute status
|
|
50
|
+
# Statuses for resources
|
|
51
|
+
#
|
|
52
|
+
# @return [Symbol, WhopSDK::Models::Status, nil]
|
|
53
|
+
required :status, enum: -> { WhopSDK::Status }, nil?: true
|
|
54
|
+
|
|
55
|
+
# @!attribute total_overrides_count
|
|
56
|
+
# The total count of all overrides for this affiliate
|
|
57
|
+
#
|
|
58
|
+
# @return [Integer]
|
|
59
|
+
required :total_overrides_count, Integer
|
|
60
|
+
|
|
61
|
+
# @!attribute total_referral_earnings_usd
|
|
62
|
+
# The total earnings of the affiliate from the users they referred
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :total_referral_earnings_usd, String
|
|
66
|
+
|
|
67
|
+
# @!attribute total_referrals_count
|
|
68
|
+
# The total referrals of the affiliate
|
|
69
|
+
#
|
|
70
|
+
# @return [Integer]
|
|
71
|
+
required :total_referrals_count, Integer
|
|
72
|
+
|
|
73
|
+
# @!attribute total_revenue_usd
|
|
74
|
+
# The total revenue of the affiliate from their referrals
|
|
75
|
+
#
|
|
76
|
+
# @return [String]
|
|
77
|
+
required :total_revenue_usd, String
|
|
78
|
+
|
|
79
|
+
# @!attribute updated_at
|
|
80
|
+
# The datetime the affiliate was last updated.
|
|
81
|
+
#
|
|
82
|
+
# @return [Time]
|
|
83
|
+
required :updated_at, Time
|
|
84
|
+
|
|
85
|
+
# @!attribute user
|
|
86
|
+
# The user attached to this affiliate
|
|
87
|
+
#
|
|
88
|
+
# @return [WhopSDK::Models::AffiliateListResponse::User]
|
|
89
|
+
required :user, -> { WhopSDK::Models::AffiliateListResponse::User }
|
|
90
|
+
|
|
91
|
+
# @!method initialize(id:, active_members_count:, company:, created_at:, customer_retention_rate:, customer_retention_rate_ninety_days:, monthly_recurring_revenue_usd:, status:, total_overrides_count:, total_referral_earnings_usd:, total_referrals_count:, total_revenue_usd:, updated_at:, user:)
|
|
92
|
+
# An affiliate of a company or a global affiliate
|
|
93
|
+
#
|
|
94
|
+
# @param id [String] The unique identifier for the affiliate.
|
|
95
|
+
#
|
|
96
|
+
# @param active_members_count [Integer] The total active members of the affiliate
|
|
97
|
+
#
|
|
98
|
+
# @param company [WhopSDK::Models::AffiliateListResponse::Company] The company attached to this affiliate
|
|
99
|
+
#
|
|
100
|
+
# @param created_at [Time] The datetime the affiliate was created.
|
|
101
|
+
#
|
|
102
|
+
# @param customer_retention_rate [String] How many referrals have remained since they joined as members
|
|
103
|
+
#
|
|
104
|
+
# @param customer_retention_rate_ninety_days [String] A rolling 90-day retention rate for this affiliate
|
|
105
|
+
#
|
|
106
|
+
# @param monthly_recurring_revenue_usd [String] The total MRR of the affiliate
|
|
107
|
+
#
|
|
108
|
+
# @param status [Symbol, WhopSDK::Models::Status, nil] Statuses for resources
|
|
109
|
+
#
|
|
110
|
+
# @param total_overrides_count [Integer] The total count of all overrides for this affiliate
|
|
111
|
+
#
|
|
112
|
+
# @param total_referral_earnings_usd [String] The total earnings of the affiliate from the users they referred
|
|
113
|
+
#
|
|
114
|
+
# @param total_referrals_count [Integer] The total referrals of the affiliate
|
|
115
|
+
#
|
|
116
|
+
# @param total_revenue_usd [String] The total revenue of the affiliate from their referrals
|
|
117
|
+
#
|
|
118
|
+
# @param updated_at [Time] The datetime the affiliate was last updated.
|
|
119
|
+
#
|
|
120
|
+
# @param user [WhopSDK::Models::AffiliateListResponse::User] The user attached to this affiliate
|
|
121
|
+
|
|
122
|
+
# @see WhopSDK::Models::AffiliateListResponse#company
|
|
123
|
+
class Company < WhopSDK::Internal::Type::BaseModel
|
|
124
|
+
# @!attribute id
|
|
125
|
+
# The unique identifier for the company.
|
|
126
|
+
#
|
|
127
|
+
# @return [String]
|
|
128
|
+
required :id, String
|
|
129
|
+
|
|
130
|
+
# @!attribute title
|
|
131
|
+
# The written name of the company.
|
|
132
|
+
#
|
|
133
|
+
# @return [String]
|
|
134
|
+
required :title, String
|
|
135
|
+
|
|
136
|
+
# @!method initialize(id:, title:)
|
|
137
|
+
# The company attached to this affiliate
|
|
138
|
+
#
|
|
139
|
+
# @param id [String] The unique identifier for the company.
|
|
140
|
+
#
|
|
141
|
+
# @param title [String] The written name of the company.
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# @see WhopSDK::Models::AffiliateListResponse#user
|
|
145
|
+
class User < WhopSDK::Internal::Type::BaseModel
|
|
146
|
+
# @!attribute id
|
|
147
|
+
# The unique identifier for the user.
|
|
148
|
+
#
|
|
149
|
+
# @return [String]
|
|
150
|
+
required :id, String
|
|
151
|
+
|
|
152
|
+
# @!attribute name
|
|
153
|
+
# The display name set on the user's Whop profile. Null if the user has not set a
|
|
154
|
+
# name.
|
|
155
|
+
#
|
|
156
|
+
# @return [String, nil]
|
|
157
|
+
required :name, String, nil?: true
|
|
158
|
+
|
|
159
|
+
# @!attribute username
|
|
160
|
+
# The unique username chosen by the user for their Whop profile. Null if the user
|
|
161
|
+
# has not set a username.
|
|
162
|
+
#
|
|
163
|
+
# @return [String, nil]
|
|
164
|
+
required :username, String, nil?: true
|
|
165
|
+
|
|
166
|
+
# @!method initialize(id:, name:, username:)
|
|
167
|
+
# Some parameter documentations has been truncated, see
|
|
168
|
+
# {WhopSDK::Models::AffiliateListResponse::User} for more details.
|
|
169
|
+
#
|
|
170
|
+
# The user attached to this affiliate
|
|
171
|
+
#
|
|
172
|
+
# @param id [String] The unique identifier for the user.
|
|
173
|
+
#
|
|
174
|
+
# @param name [String, nil] The display name set on the user's Whop profile. Null if the user has not set a
|
|
175
|
+
#
|
|
176
|
+
# @param username [String, nil] The unique username chosen by the user for their Whop profile. Null if the user
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::Affiliates#retrieve
|
|
6
|
+
class AffiliateRetrieveParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(id:, request_options: {})
|
|
16
|
+
# @param id [String]
|
|
17
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::Affiliates#unarchive
|
|
6
|
+
class AffiliateUnarchiveParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(id:, request_options: {})
|
|
16
|
+
# @param id [String]
|
|
17
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
module Affiliates
|
|
6
|
+
# Whether the affiliate commission applies to the first payment or all payments
|
|
7
|
+
module AffiliateAppliesToPayments
|
|
8
|
+
extend WhopSDK::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
FIRST_PAYMENT = :first_payment
|
|
11
|
+
ALL_PAYMENTS = :all_payments
|
|
12
|
+
|
|
13
|
+
# @!method self.values
|
|
14
|
+
# @return [Array<Symbol>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
AffiliateAppliesToPayments = Affiliates::AffiliateAppliesToPayments
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
module Affiliates
|
|
6
|
+
# Whether a rev-share override applies to a single product or all products
|
|
7
|
+
module AffiliateAppliesToProducts
|
|
8
|
+
extend WhopSDK::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
SINGLE_PRODUCT = :single_product
|
|
11
|
+
ALL_PRODUCTS = :all_products
|
|
12
|
+
|
|
13
|
+
# @!method self.values
|
|
14
|
+
# @return [Array<Symbol>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
AffiliateAppliesToProducts = Affiliates::AffiliateAppliesToProducts
|
|
19
|
+
end
|
|
20
|
+
end
|