Class: Onlyfans::Resources::SavedForLater::Posts

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/saved_for_later/posts.rb,
lib/onlyfans/resources/saved_for_later/posts/settings.rb

Defined Under Namespace

Classes: Settings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Posts

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

Parameters:



40
41
42
43
# File 'lib/onlyfans/resources/saved_for_later/posts.rb', line 40

def initialize(client:)
  @client = client
  @settings = Onlyfans::Resources::SavedForLater::Posts::Settings.new(client: client)
end

Instance Attribute Details

#settingsOnlyfans::Resources::SavedForLater::Posts::Settings (readonly)



8
9
10
# File 'lib/onlyfans/resources/saved_for_later/posts.rb', line 8

def settings
  @settings
end

Instance Method Details

#list(account, limit:, offset:, request_options: {}) ⇒ Onlyfans::Models::SavedForLater::PostListResponse

List all posts that are marked as “Save For Later”.

Parameters:

  • account (String)

    The Account ID

  • limit (Integer)

    Maximum number of posts to return (default = 10)

  • offset (Integer)

    Offset for pagination (default = 0)

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

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/onlyfans/resources/saved_for_later/posts.rb', line 25

def list(, params)
  parsed, options = Onlyfans::SavedForLater::PostListParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/saved-for-later/posts", ],
    query: query,
    model: Onlyfans::Models::SavedForLater::PostListResponse,
    options: options
  )
end