Class: Onlyfans::Resources::SharedTrialLinks::Tags

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

Overview

APIs for Free Trial Links that other OF creators have shared with this account. Revenue, cost, and spender data are not available for shared 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:



102
103
104
# File 'lib/onlyfans/resources/shared_trial_links/tags.rb', line 102

def initialize(client:)
  @client = client
end

Instance Method Details

#add(shared_trial_link_id, account:, tags:, request_options: {}) ⇒ Onlyfans::Models::SharedTrialLinks::TagAddResponse

Add tags to a shared Free Trial Link. Existing tags are preserved. Tag namespace is shared with owned Free Trial Links. This is a free endpoint.

Parameters:

  • shared_trial_link_id (Integer) —

    Path param: The OnlyFans-side ID of the shared trial link

  • account (String) —

    Path param: The Account ID

  • tags (Array<String>) —

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

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

Returns:

See Also:



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

def add(shared_trial_link_id, params)
  parsed, options = Onlyfans::SharedTrialLinks::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/shared-trial-links/%2$s/tags", , shared_trial_link_id],
    body: parsed,
    model: Onlyfans::Models::SharedTrialLinks::TagAddResponse,
    options: options
  )
end

#list(shared_trial_link_id, account:, request_options: {}) ⇒ Onlyfans::Models::SharedTrialLinks::TagListResponse

Get tags for a specific shared Free Trial Link. Tag namespace is shared with owned Free Trial Links. This is a free endpoint.

Parameters:

  • shared_trial_link_id (Integer) —

    The OnlyFans-side ID of the shared trial link

  • account (String) —

    The Account ID

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

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/onlyfans/resources/shared_trial_links/tags.rb', line 23

def list(shared_trial_link_id, params)
  parsed, options = Onlyfans::SharedTrialLinks::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/shared-trial-links/%2$s/tags", , shared_trial_link_id],
    model: Onlyfans::Models::SharedTrialLinks::TagListResponse,
    options: options
  )
end

#remove(shared_trial_link_id, account:, tags:, request_options: {}) ⇒ Onlyfans::Models::SharedTrialLinks::TagRemoveResponse

Remove tags from a shared Free Trial Link. Tag namespace is shared with owned Free Trial Links. This is a free endpoint.

Parameters:

  • shared_trial_link_id (Integer) —

    Path param: The OnlyFans-side ID of the shared trial link

  • account (String) —

    Path param: The Account ID

  • tags (Array<String>) —

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

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

Returns:

See Also:



84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/onlyfans/resources/shared_trial_links/tags.rb', line 84

def remove(shared_trial_link_id, params)
  parsed, options = Onlyfans::SharedTrialLinks::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/shared-trial-links/%2$s/tags", , shared_trial_link_id],
    body: parsed,
    model: Onlyfans::Models::SharedTrialLinks::TagRemoveResponse,
    options: options
  )
end