Class: Onlyfans::Resources::UserLists::Users
- Inherits:
-
Object
- Object
- Onlyfans::Resources::UserLists::Users
- Defined in:
- lib/onlyfans/resources/user_lists/users.rb
Instance Method Summary collapse
-
#add(user_list_id, account:, ids:, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserAddResponse
Add multiple Users To OnlyFans User List.
-
#clear(user_list_id, account:, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserClearResponse
Remove all users from a OnlyFans User List.
-
#initialize(client:) ⇒ Users
constructor
private
A new instance of Users.
-
#list(user_list_id, account:, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserListResponse
Get all users in a OnlyFans User List.
-
#list_pinned(user_list_id, account:, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserListPinnedResponse
Get pinned users from an OnlyFans User List.
-
#pin(user_id, account:, user_list_id:, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserPinResponse
Pin a user in any OnlyFans user list.
-
#remove(user_id, account:, user_list_id:, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserRemoveResponse
Remove User from OnlyFans User List.
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.
199 200 201 |
# File 'lib/onlyfans/resources/user_lists/users.rb', line 199 def initialize(client:) @client = client end |
Instance Method Details
#add(user_list_id, account:, ids:, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserAddResponse
Add multiple Users To OnlyFans User List
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/onlyfans/resources/user_lists/users.rb', line 55 def add(user_list_id, params) parsed, = Onlyfans::UserLists::UserAddParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["api/%1$s/user-lists/%2$s/users", account, user_list_id], body: parsed, model: Onlyfans::Models::UserLists::UserAddResponse, options: ) end |
#clear(user_list_id, account:, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserClearResponse
Remove all users from a OnlyFans User List
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/onlyfans/resources/user_lists/users.rb', line 83 def clear(user_list_id, params) parsed, = Onlyfans::UserLists::UserClearParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["api/%1$s/user-lists/%2$s/users", account, user_list_id], model: Onlyfans::Models::UserLists::UserClearResponse, options: ) end |
#list(user_list_id, account:, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserListResponse
Get all users in a OnlyFans User List
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/onlyfans/resources/user_lists/users.rb', line 24 def list(user_list_id, params) parsed, = Onlyfans::UserLists::UserListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["api/%1$s/user-lists/%2$s/users", account, user_list_id], query: query, model: Onlyfans::Models::UserLists::UserListResponse, options: ) end |
#list_pinned(user_list_id, account:, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserListPinnedResponse
Get pinned users from an OnlyFans User List.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/onlyfans/resources/user_lists/users.rb', line 114 def list_pinned(user_list_id, params) parsed, = Onlyfans::UserLists::UserListPinnedParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["api/%1$s/user-lists/%2$s/users/pinned", account, user_list_id], query: query, model: Onlyfans::Models::UserLists::UserListPinnedResponse, options: ) end |
#pin(user_id, account:, user_list_id:, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserPinResponse
Pin a user in any OnlyFans user list.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/onlyfans/resources/user_lists/users.rb', line 145 def pin(user_id, params) parsed, = Onlyfans::UserLists::UserPinParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end user_list_id = parsed.delete(:user_list_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["api/%1$s/user-lists/%2$s/users/%3$s/pin", account, user_list_id, user_id], model: Onlyfans::Models::UserLists::UserPinResponse, options: ) end |
#remove(user_id, account:, user_list_id:, request_options: {}) ⇒ Onlyfans::Models::UserLists::UserRemoveResponse
Remove User from OnlyFans User List
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/onlyfans/resources/user_lists/users.rb', line 178 def remove(user_id, params) parsed, = Onlyfans::UserLists::UserRemoveParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end user_list_id = parsed.delete(:user_list_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["api/%1$s/user-lists/%2$s/users/%3$s", account, user_list_id, user_id], model: Onlyfans::Models::UserLists::UserRemoveResponse, options: ) end |