Class: Onlyfans::Resources::Fans::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/fans/summary.rb

Overview

APIs for generating and retrieving AI-powered fan profile summaries

Instance Method Summary collapse

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.

Parameters:



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`.

Parameters:

  • fan_id (String)

    Path param: Fan’s OnlyFans ID

  • account (String)

    Path param: The Account ID

  • regenerate (Boolean)

    Body param: Set to true to regenerate an existing completed summary.

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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, options = Onlyfans::Fans::SummaryGenerateSummaryParams.dump_request(params)
   =
    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", , fan_id],
    body: parsed,
    model: Onlyfans::Models::Fans::SummaryGenerateSummaryResponse,
    options: 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.

Parameters:

  • fan_id (String)

    Fan’s OnlyFans ID

  • account (String)

    The Account ID

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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, options = Onlyfans::Fans::SummaryGetSummaryParams.dump_request(params)
   =
    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", , fan_id],
    model: Onlyfans::Models::Fans::SummaryGetSummaryResponse,
    options: options
  )
end