Class: Onlyfans::Resources::Fans::Summary
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Fans::Summary
- Defined in:
- lib/onlyfans/resources/fans/summary.rb
Overview
APIs for generating and retrieving AI-powered fan profile summaries
Instance Method Summary collapse
-
#generate_summary(fan_id, account:, regenerate: nil, request_options: {}) ⇒ Onlyfans::Models::Fans::SummaryGenerateSummaryResponse
Queue generation or regeneration of an AI profile summary for a fan.
-
#get_summary(fan_id, account:, request_options: {}) ⇒ Onlyfans::Models::Fans::SummaryGetSummaryResponse
Retrieve the AI profile summary for a fan.
-
#initialize(client:) ⇒ Summary
constructor
private
A new instance of Summary.
Constructor Details
#initialize(client:) ⇒ Summary
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 Summary.
71 72 73 |
# File 'lib/onlyfans/resources/fans/summary.rb', line 71 def initialize(client:) @client = client end |
Instance Method Details
#generate_summary(fan_id, account:, regenerate: nil, request_options: {}) ⇒ Onlyfans::Models::Fans::SummaryGenerateSummaryResponse
Queue generation or regeneration of an AI profile summary for a fan. Costs 200 credits (charged on completion). Use the GET endpoint to poll for results. To regenerate an existing summary, pass ‘regenerate: true`.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/onlyfans/resources/fans/summary.rb', line 25 def generate_summary(fan_id, params) parsed, = Onlyfans::Fans::SummaryGenerateSummaryParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["api/%1$s/fans/%2$s/summary", account, fan_id], body: parsed, model: Onlyfans::Models::Fans::SummaryGenerateSummaryResponse, options: ) end |
#get_summary(fan_id, account:, request_options: {}) ⇒ Onlyfans::Models::Fans::SummaryGetSummaryResponse
Retrieve the AI profile summary for a fan. Poll this endpoint after triggering a generation to check for completion.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/onlyfans/resources/fans/summary.rb', line 54 def get_summary(fan_id, params) parsed, = Onlyfans::Fans::SummaryGetSummaryParams.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/summary", account, fan_id], model: Onlyfans::Models::Fans::SummaryGetSummaryResponse, options: ) end |