Class: Onlyfans::Resources::TrialLinks::Tags

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/trial_links/tags.rb,
sig/onlyfans/resources/trial_links/tags.rbs

Overview

APIs for managing Free Trial Links

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Tags

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

Parameters:



99
100
101
# File 'lib/onlyfans/resources/trial_links/tags.rb', line 99

def initialize(client:)
  @client = client
end

Instance Method Details

#add(trial_link_id, account:, tags:, request_options: {}) ⇒ Onlyfans::Models::TrialLinks::TagAddResponse

Add tags to a specific free trial link. Existing tags are preserved. This is a free endpoint.

Parameters:

  • trial_link_id (Integer) —

    Path param: The ID of the trial link

  • account (String) —

    Path param: The Account ID

  • tags (Array<String>) —

    Body param: Array of tag names to add to the trial link.

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

Returns:

See Also:



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/onlyfans/resources/trial_links/tags.rb', line 51

def add(trial_link_id, params)
  parsed, options = Onlyfans::TrialLinks::TagAddParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["api/%1$s/trial-links/%2$s/tags", , trial_link_id],
    body: parsed,
    model: Onlyfans::Models::TrialLinks::TagAddResponse,
    options: options
  )
end

#list(trial_link_id, account:, request_options: {}) ⇒ Onlyfans::Models::TrialLinks::TagListResponse

Get tags for a specific free trial link. This is a free endpoint.

Parameters:

  • trial_link_id (Integer) —

    The ID of the trial link

  • account (String) —

    The Account ID

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

Returns:

See Also:



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

def list(trial_link_id, params)
  parsed, options = Onlyfans::TrialLinks::TagListParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["api/%1$s/trial-links/%2$s/tags", , trial_link_id],
    model: Onlyfans::Models::TrialLinks::TagListResponse,
    options: options
  )
end

#remove(trial_link_id, account:, tags:, request_options: {}) ⇒ Onlyfans::Models::TrialLinks::TagRemoveResponse

Remove tags from a specific free trial link. This is a free endpoint.

Parameters:

  • trial_link_id (Integer) —

    Path param: The ID of the trial link

  • account (String) —

    Path param: The Account ID

  • tags (Array<String>) —

    Body param: Array of tag names to remove from the trial link.

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

Returns:

See Also:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/onlyfans/resources/trial_links/tags.rb', line 81

def remove(trial_link_id, params)
  parsed, options = Onlyfans::TrialLinks::TagRemoveParams.dump_request(params)
   =
    parsed.delete(:account) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["api/%1$s/trial-links/%2$s/tags", , trial_link_id],
    body: parsed,
    model: Onlyfans::Models::TrialLinks::TagRemoveResponse,
    options: options
  )
end