Class: Onlyfans::Resources::Fans
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Fans
- Defined in:
- lib/onlyfans/resources/fans.rb,
lib/onlyfans/resources/fans/notes.rb,
lib/onlyfans/resources/fans/summary.rb
Overview
APIs for managing OnlyFans fans (subscribers)
Defined Under Namespace
Instance Attribute Summary collapse
-
#notes ⇒ Onlyfans::Resources::Fans::Notes
readonly
APIs for managing OnlyFans fans (subscribers).
-
#summary ⇒ Onlyfans::Resources::Fans::Summary
readonly
APIs for generating and retrieving AI-powered fan profile summaries.
Instance Method Summary collapse
-
#get_subscription_history(user_id, account:, request_options: {}) ⇒ Onlyfans::Models::FanGetSubscriptionHistoryResponse
Get Subscription History for a given OnlyFans User ID.
-
#initialize(client:) ⇒ Fans
constructor
private
A new instance of Fans.
-
#list_active(account, filter: nil, limit: nil, offset: nil, query: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::FanListActiveResponse
Some parameter documentations has been truncated, see Models::FanListActiveParams for more details.
-
#list_all(account, filter: nil, limit: nil, offset: nil, query: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::FanListAllResponse
Some parameter documentations has been truncated, see Models::FanListAllParams for more details.
-
#list_expired(account, filter: nil, limit: nil, offset: nil, query: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::FanListExpiredResponse
Some parameter documentations has been truncated, see Models::FanListExpiredParams for more details.
-
#list_latest(account, end_date: nil, limit: nil, offset: nil, start_date: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::FanListLatestResponse
Some parameter documentations has been truncated, see Models::FanListLatestParams for more details.
-
#list_top(account, by: nil, end_date: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::FanListTopResponse
Some parameter documentations has been truncated, see Models::FanListTopParams for more details.
-
#set_custom_name(fan_id, account:, custom_name:, request_options: {}) ⇒ Onlyfans::Models::FanSetCustomNameResponse
Some parameter documentations has been truncated, see Models::FanSetCustomNameParams for more details.
Constructor Details
#initialize(client:) ⇒ Fans
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Fans.
257 258 259 260 261 |
# File 'lib/onlyfans/resources/fans.rb', line 257 def initialize(client:) @client = client @notes = Onlyfans::Resources::Fans::Notes.new(client: client) @summary = Onlyfans::Resources::Fans::Summary.new(client: client) end |
Instance Attribute Details
#notes ⇒ Onlyfans::Resources::Fans::Notes (readonly)
APIs for managing OnlyFans fans (subscribers)
9 10 11 |
# File 'lib/onlyfans/resources/fans.rb', line 9 def notes @notes end |
#summary ⇒ Onlyfans::Resources::Fans::Summary (readonly)
APIs for generating and retrieving AI-powered fan profile summaries
13 14 15 |
# File 'lib/onlyfans/resources/fans.rb', line 13 def summary @summary end |
Instance Method Details
#get_subscription_history(user_id, account:, request_options: {}) ⇒ Onlyfans::Models::FanGetSubscriptionHistoryResponse
Get Subscription History for a given OnlyFans User ID. This can be useful, for example, when the user’s subscribed to your account for the first time.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/onlyfans/resources/fans.rb', line 29 def get_subscription_history(user_id, params) parsed, = Onlyfans::FanGetSubscriptionHistoryParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["api/%1$s/fans/%2$s/subscriptions-history", account, user_id], model: Onlyfans::Models::FanGetSubscriptionHistoryResponse, options: ) end |
#list_active(account, filter: nil, limit: nil, offset: nil, query: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::FanListActiveResponse
Some parameter documentations has been truncated, see Models::FanListActiveParams for more details.
Get a paginated list of fans for an Account. Newest fans are first.
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/onlyfans/resources/fans.rb', line 67 def list_active(account, params = {}) parsed, = Onlyfans::FanListActiveParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/fans/active", account], query: query, model: Onlyfans::Models::FanListActiveResponse, options: ) end |
#list_all(account, filter: nil, limit: nil, offset: nil, query: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::FanListAllResponse
Some parameter documentations has been truncated, see Models::FanListAllParams for more details.
Get a paginated list of fans for an Account. Newest fans are first.
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/onlyfans/resources/fans.rb', line 103 def list_all(account, params = {}) parsed, = Onlyfans::FanListAllParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/fans/all", account], query: query, model: Onlyfans::Models::FanListAllResponse, options: ) end |
#list_expired(account, filter: nil, limit: nil, offset: nil, query: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::FanListExpiredResponse
Some parameter documentations has been truncated, see Models::FanListExpiredParams for more details.
Get a paginated list of expired fans for an Account. Newest fans are first.
139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/onlyfans/resources/fans.rb', line 139 def list_expired(account, params = {}) parsed, = Onlyfans::FanListExpiredParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/fans/expired", account], query: query, model: Onlyfans::Models::FanListExpiredResponse, options: ) end |
#list_latest(account, end_date: nil, limit: nil, offset: nil, start_date: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::FanListLatestResponse
Some parameter documentations has been truncated, see Models::FanListLatestParams for more details.
Get a paginated list fans, filterable by total, only new subscribers, or only renewals. Newest fans are first.
176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/onlyfans/resources/fans.rb', line 176 def list_latest(account, params = {}) parsed, = Onlyfans::FanListLatestParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/fans/latest", account], query: query, model: Onlyfans::Models::FanListLatestResponse, options: ) end |
#list_top(account, by: nil, end_date: nil, start_date: nil, request_options: {}) ⇒ Onlyfans::Models::FanListTopResponse
Some parameter documentations has been truncated, see Models::FanListTopParams for more details.
Get a list of top fans sorted by spending. Filterable by total, subscriptions, tips, messages, posts, or streams.
209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/onlyfans/resources/fans.rb', line 209 def list_top(account, params = {}) parsed, = Onlyfans::FanListTopParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/fans/top", account], query: query, model: Onlyfans::Models::FanListTopResponse, options: ) end |
#set_custom_name(fan_id, account:, custom_name:, request_options: {}) ⇒ Onlyfans::Models::FanSetCustomNameResponse
Some parameter documentations has been truncated, see Models::FanSetCustomNameParams for more details.
Change the Fan’s Custom Name shown in OnlyFans
239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/onlyfans/resources/fans.rb', line 239 def set_custom_name(fan_id, params) parsed, = Onlyfans::FanSetCustomNameParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :put, path: ["api/%1$s/fans/%2$s/custom-name", account, fan_id], body: parsed, model: Onlyfans::Models::FanSetCustomNameResponse, options: ) end |