Class: Onlyfans::Resources::SharedTrialLinks

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

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.

Defined Under Namespace

Classes: Tags

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SharedTrialLinks

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

Parameters:



79
80
81
82
# File 'lib/onlyfans/resources/shared_trial_links.rb', line 79

def initialize(client:)
  @client = client
  @tags = Onlyfans::Resources::SharedTrialLinks::Tags.new(client: client)
end

Instance Attribute Details

#tagsOnlyfans::Resources::SharedTrialLinks::Tags (readonly)

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.



11
12
13
# File 'lib/onlyfans/resources/shared_trial_links.rb', line 11

def tags
  @tags
end

Instance Method Details

#list(account, limit: nil, offset: nil, synchronous: nil, request_options: {}) ⇒ Onlyfans::Models::SharedTrialLinkListResponse

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

List all Free Trial Links shared with the account by other OF creators. Calls OnlyFans live and syncs to our cache.

background. *

Parameters:

  • account (String)

    The Account ID

  • limit (Integer)

    The number of shared trial links to return. Default ‘10`

  • offset (Integer)

    The offset used for pagination. Default ‘0`

  • synchronous (Boolean, nil)

    Wait for the database sync to finish, instead of running it in the

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

Returns:

See Also:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/onlyfans/resources/shared_trial_links.rb', line 35

def list(, params = {})
  parsed, options = Onlyfans::SharedTrialLinkListParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/shared-trial-links", ],
    query: query,
    model: Onlyfans::Models::SharedTrialLinkListResponse,
    options: options
  )
end

#revoke_access(shared_trial_link_id, account:, request_options: {}) ⇒ Onlyfans::Models::SharedTrialLinkRevokeAccessResponse

Revoke the account’s access to a shared Free Trial Link. Calls OnlyFans ‘DELETE /trials/share-access`, then removes the local cache row. The owner keeps the link.

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:



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/onlyfans/resources/shared_trial_links.rb', line 62

def revoke_access(shared_trial_link_id, params)
  parsed, options = Onlyfans::SharedTrialLinkRevokeAccessParams.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", , shared_trial_link_id],
    model: Onlyfans::Models::SharedTrialLinkRevokeAccessResponse,
    options: options
  )
end