Class: Onlyfans::Resources::Users
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Users
- Defined in:
- lib/onlyfans/resources/users.rb,
lib/onlyfans/resources/users/block.rb,
lib/onlyfans/resources/users/restrict.rb,
lib/onlyfans/resources/users/subscribe.rb
Overview
APIs for fetching OnlyFans users
Defined Under Namespace
Classes: Block, Restrict, Subscribe
Instance Attribute Summary collapse
-
#block ⇒ Onlyfans::Resources::Users::Block
readonly
APIs for fetching OnlyFans users.
-
#restrict ⇒ Onlyfans::Resources::Users::Restrict
readonly
APIs for fetching OnlyFans users.
-
#subscribe ⇒ Onlyfans::Resources::Users::Subscribe
readonly
APIs for fetching OnlyFans users.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Users
constructor
private
A new instance of Users.
-
#list(account, ids:, request_options: {}) ⇒ Onlyfans::Models::UserListResponse
Save on credits by getting up to 10 user details with a single request.
-
#retrieve(username, account:, request_options: {}) ⇒ Onlyfans::Models::UserRetrieveResponse
Get OnlyFans Profile details for a given username.
Constructor Details
#initialize(client:) ⇒ Users
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 Users.
79 80 81 82 83 84 |
# File 'lib/onlyfans/resources/users.rb', line 79 def initialize(client:) @client = client @restrict = Onlyfans::Resources::Users::Restrict.new(client: client) @block = Onlyfans::Resources::Users::Block.new(client: client) @subscribe = Onlyfans::Resources::Users::Subscribe.new(client: client) end |
Instance Attribute Details
#block ⇒ Onlyfans::Resources::Users::Block (readonly)
APIs for fetching OnlyFans users
13 14 15 |
# File 'lib/onlyfans/resources/users.rb', line 13 def block @block end |
#restrict ⇒ Onlyfans::Resources::Users::Restrict (readonly)
APIs for fetching OnlyFans users
9 10 11 |
# File 'lib/onlyfans/resources/users.rb', line 9 def restrict @restrict end |
#subscribe ⇒ Onlyfans::Resources::Users::Subscribe (readonly)
APIs for fetching OnlyFans users
17 18 19 |
# File 'lib/onlyfans/resources/users.rb', line 17 def subscribe @subscribe end |
Instance Method Details
#list(account, ids:, request_options: {}) ⇒ Onlyfans::Models::UserListResponse
Save on credits by getting up to 10 user details with a single request. User details are retrieved using the current ‘account` so fields like `subscribedOnData` which include potential subscription details will be included.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/onlyfans/resources/users.rb', line 64 def list(account, params) parsed, = Onlyfans::UserListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/users/list", account], query: query, model: Onlyfans::Models::UserListResponse, options: ) end |
#retrieve(username, account:, request_options: {}) ⇒ Onlyfans::Models::UserRetrieveResponse
Get OnlyFans Profile details for a given username. User details are retrieved using the current ‘account` so fields like `subscribedOnData` which include potential subscription details will be included.
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/onlyfans/resources/users.rb', line 34 def retrieve(username, params) parsed, = Onlyfans::UserRetrieveParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["api/%1$s/users/%2$s", account, username], model: Onlyfans::Models::UserRetrieveResponse, options: ) end |