Class: Onlyfans::Resources::Statistics
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Statistics
- Defined in:
- lib/onlyfans/resources/statistics.rb,
lib/onlyfans/resources/statistics/reach.rb,
lib/onlyfans/resources/statistics/statements.rb
Defined Under Namespace
Classes: Reach, Statements
Instance Attribute Summary collapse
- #reach ⇒ Onlyfans::Resources::Statistics::Reach readonly
- #statements ⇒ Onlyfans::Resources::Statistics::Statements readonly
Instance Method Summary collapse
-
#calculate_total_transactions(account, end_date:, start_date:, request_options: {}) ⇒ Onlyfans::Models::StatisticCalculateTotalTransactionsResponse
Calculate the total transactions and amounts.
-
#get_overview(account, end_date: nil, start_date: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::StatisticGetOverviewResponse
Some parameter documentations has been truncated, see Models::StatisticGetOverviewParams for more details.
-
#get_subscriber_metrics(account, end_date:, start_date:, detailed: nil, request_options: {}) ⇒ Onlyfans::Models::StatisticGetSubscriberMetricsResponse
Some parameter documentations has been truncated, see Models::StatisticGetSubscriberMetricsParams for more details.
-
#initialize(client:) ⇒ Statistics
constructor
private
A new instance of Statistics.
Constructor Details
#initialize(client:) ⇒ Statistics
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 Statistics.
108 109 110 111 112 |
# File 'lib/onlyfans/resources/statistics.rb', line 108 def initialize(client:) @client = client @statements = Onlyfans::Resources::Statistics::Statements.new(client: client) @reach = Onlyfans::Resources::Statistics::Reach.new(client: client) end |
Instance Attribute Details
#reach ⇒ Onlyfans::Resources::Statistics::Reach (readonly)
10 11 12 |
# File 'lib/onlyfans/resources/statistics.rb', line 10 def reach @reach end |
#statements ⇒ Onlyfans::Resources::Statistics::Statements (readonly)
7 8 9 |
# File 'lib/onlyfans/resources/statistics.rb', line 7 def statements @statements end |
Instance Method Details
#calculate_total_transactions(account, end_date:, start_date:, request_options: {}) ⇒ Onlyfans::Models::StatisticCalculateTotalTransactionsResponse
Calculate the total transactions and amounts.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/onlyfans/resources/statistics.rb', line 27 def calculate_total_transactions(account, params) parsed, = Onlyfans::StatisticCalculateTotalTransactionsParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/statistics/total-transactions", account], query: query, model: Onlyfans::Models::StatisticCalculateTotalTransactionsResponse, options: ) end |
#get_overview(account, end_date: nil, start_date: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::StatisticGetOverviewResponse
Some parameter documentations has been truncated, see Models::StatisticGetOverviewParams for more details.
Get an overview of statistics for fans, visitors, posts, or general.
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/onlyfans/resources/statistics.rb', line 59 def get_overview(account, params = {}) parsed, = Onlyfans::StatisticGetOverviewParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/statistics/overview", account], query: query, model: Onlyfans::Models::StatisticGetOverviewResponse, options: ) end |
#get_subscriber_metrics(account, end_date:, start_date:, detailed: nil, request_options: {}) ⇒ Onlyfans::Models::StatisticGetSubscriberMetricsResponse
Some parameter documentations has been truncated, see Models::StatisticGetSubscriberMetricsParams for more details.
Get subscriber metrics including total, new, renewed, paid, and free subscriptions for a specified timeframe. ‘unknown_subscriptions` indicates deleted fan accounts.
93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/onlyfans/resources/statistics.rb', line 93 def get_subscriber_metrics(account, params) parsed, = Onlyfans::StatisticGetSubscriberMetricsParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/statistics/subscriber-metrics", account], query: query, model: Onlyfans::Models::StatisticGetSubscriberMetricsResponse, options: ) end |