Class: Onlyfans::Resources::Profiles

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Profiles

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

Parameters:



37
38
39
# File 'lib/onlyfans/resources/profiles.rb', line 37

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(username, fresh: nil, request_options: {}) ⇒ Onlyfans::Models::ProfileRetrieveResponse

Some parameter documentations has been truncated, see Models::ProfileRetrieveParams for more details.

Get profile details by username.

Parameters:

  • username (String)

    The username of the profile to get

  • fresh (Boolean, nil)

    If ‘true` then OnlyFansAPI will always return the real time information about pr

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

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/onlyfans/resources/profiles.rb', line 22

def retrieve(username, params = {})
  parsed, options = Onlyfans::ProfileRetrieveParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/profiles/%1$s", username],
    query: query,
    model: Onlyfans::Models::ProfileRetrieveResponse,
    options: options
  )
end