Class: Onlyfans::Resources::Accounts
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Accounts
- Defined in:
- lib/onlyfans/resources/accounts.rb
Overview
Endpoints for your linked accounts
Instance Method Summary collapse
-
#disconnect(id, request_options: {}) ⇒ Hash{Symbol=>Object}?
Disconnect an OnlyFans account.
-
#initialize(client:) ⇒ Accounts
constructor
private
A new instance of Accounts.
-
#list(onlyfans_email: nil, onlyfans_id: nil, onlyfans_username: nil, request_options: {}) ⇒ Array<Onlyfans::Models::AccountListResponseItem>
List all connected OnlyFans accounts.
Constructor Details
#initialize(client:) ⇒ Accounts
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 Accounts.
57 58 59 |
# File 'lib/onlyfans/resources/accounts.rb', line 57 def initialize(client:) @client = client end |
Instance Method Details
#disconnect(id, request_options: {}) ⇒ Hash{Symbol=>Object}?
Disconnect an OnlyFans account.
45 46 47 48 49 50 51 52 |
# File 'lib/onlyfans/resources/accounts.rb', line 45 def disconnect(id, params = {}) @client.request( method: :delete, path: ["api/accounts/%1$s", id], model: Onlyfans::Internal::Type::HashOf[Onlyfans::Internal::Type::Unknown], options: params[:request_options] ) end |
#list(onlyfans_email: nil, onlyfans_id: nil, onlyfans_username: nil, request_options: {}) ⇒ Array<Onlyfans::Models::AccountListResponseItem>
List all connected OnlyFans accounts.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/onlyfans/resources/accounts.rb', line 22 def list(params = {}) parsed, = Onlyfans::AccountListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/accounts", query: query, model: Onlyfans::Internal::Type::ArrayOf[Onlyfans::Models::AccountListResponseItem], options: ) end |