Class: Onlyfans::Resources::Media::Vault::Lists::Media

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/media/vault/lists/media.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Media

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

Parameters:



72
73
74
# File 'lib/onlyfans/resources/media/vault/lists/media.rb', line 72

def initialize(client:)
  @client = client
end

Instance Method Details

#add(list_id, account:, media_ids:, request_options: {}) ⇒ Onlyfans::Models::Media::Vault::Lists::MediaAddResponse

Add one or multiple media to a list.

Parameters:

  • list_id (String)

    Path param: The ID of the list.

  • account (String)

    Path param: The Account ID

  • media_ids (Array<String>)

    Body param: Array of media IDs to add.

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

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/onlyfans/resources/media/vault/lists/media.rb', line 24

def add(list_id, params)
  parsed, options = Onlyfans::Media::Vault::Lists::MediaAddParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["api/%1$s/media/vault/lists/%2$s/media", , list_id],
    body: parsed,
    model: Onlyfans::Models::Media::Vault::Lists::MediaAddResponse,
    options: options
  )
end

#remove(list_id, account:, media_ids:, request_options: {}) ⇒ Onlyfans::Models::Media::Vault::Lists::MediaRemoveResponse

Remove one or multiple media from a list.

Parameters:

  • list_id (String)

    Path param: The ID of the list.

  • account (String)

    Path param: The Account ID

  • media_ids (Array<String>)

    Body param: Array of media IDs to delete.

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

Returns:

See Also:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/onlyfans/resources/media/vault/lists/media.rb', line 54

def remove(list_id, params)
  parsed, options = Onlyfans::Media::Vault::Lists::MediaRemoveParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["api/%1$s/media/vault/lists/%2$s/media", , list_id],
    body: parsed,
    model: Onlyfans::Models::Media::Vault::Lists::MediaRemoveResponse,
    options: options
  )
end