Class: Onlyfans::Resources::UserLists
- Inherits:
-
Object
- Object
- Onlyfans::Resources::UserLists
- Defined in:
- lib/onlyfans/resources/user_lists.rb,
lib/onlyfans/resources/user_lists/users.rb
Defined Under Namespace
Classes: Users
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(account, name:, request_options: {}) ⇒ Onlyfans::Models::UserListCreateResponse
Create a OnlyFans User List.
-
#delete(user_list_id, account:, request_options: {}) ⇒ Onlyfans::Models::UserListDeleteResponse
Delete a OnlyFans User List.
-
#initialize(client:) ⇒ UserLists
constructor
private
A new instance of UserLists.
-
#list(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::UserListListResponse
Some parameter documentations has been truncated, see Models::UserListListParams for more details.
-
#retrieve(user_list_id, account:, request_options: {}) ⇒ Onlyfans::Models::UserListRetrieveResponse
Get a user list.
-
#update(user_list_id, account:, name:, is_pinned_to_feed: nil, request_options: {}) ⇒ Onlyfans::Models::UserListUpdateResponse
Some parameter documentations has been truncated, see Models::UserListUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ UserLists
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 UserLists.
155 156 157 158 |
# File 'lib/onlyfans/resources/user_lists.rb', line 155 def initialize(client:) @client = client @users = Onlyfans::Resources::UserLists::Users.new(client: client) end |
Instance Attribute Details
#users ⇒ Onlyfans::Resources::UserLists::Users (readonly)
7 8 9 |
# File 'lib/onlyfans/resources/user_lists.rb', line 7 def users @users end |
Instance Method Details
#create(account, name:, request_options: {}) ⇒ Onlyfans::Models::UserListCreateResponse
Create a OnlyFans User List
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/onlyfans/resources/user_lists.rb', line 22 def create(account, params) parsed, = Onlyfans::UserListCreateParams.dump_request(params) @client.request( method: :post, path: ["api/%1$s/user-lists", account], body: parsed, model: Onlyfans::Models::UserListCreateResponse, options: ) end |
#delete(user_list_id, account:, request_options: {}) ⇒ Onlyfans::Models::UserListDeleteResponse
Delete a OnlyFans User List
138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/onlyfans/resources/user_lists.rb', line 138 def delete(user_list_id, params) parsed, = Onlyfans::UserListDeleteParams.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", account, user_list_id], model: Onlyfans::Models::UserListDeleteResponse, options: ) end |
#list(account, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::UserListListResponse
Some parameter documentations has been truncated, see Models::UserListListParams for more details.
Get a list of OnlyFans Collections - User Lists
113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/onlyfans/resources/user_lists.rb', line 113 def list(account, params = {}) parsed, = Onlyfans::UserListListParams.dump_request(params) query = Onlyfans::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/%1$s/user-lists", account], query: query, model: Onlyfans::Models::UserListListResponse, options: ) end |
#retrieve(user_list_id, account:, request_options: {}) ⇒ Onlyfans::Models::UserListRetrieveResponse
Get a user list
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/onlyfans/resources/user_lists.rb', line 46 def retrieve(user_list_id, params) parsed, = Onlyfans::UserListRetrieveParams.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/user-lists/%2$s", account, user_list_id], model: Onlyfans::Models::UserListRetrieveResponse, options: ) end |
#update(user_list_id, account:, name:, is_pinned_to_feed: nil, request_options: {}) ⇒ Onlyfans::Models::UserListUpdateResponse
Some parameter documentations has been truncated, see Models::UserListUpdateParams for more details.
Update a OnlyFans User List
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/onlyfans/resources/user_lists.rb', line 80 def update(user_list_id, params) parsed, = Onlyfans::UserListUpdateParams.dump_request(params) account = parsed.delete(:account) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :put, path: ["api/%1$s/user-lists/%2$s", account, user_list_id], body: parsed, model: Onlyfans::Models::UserListUpdateResponse, options: ) end |