module Mastodon::REST::Lists
Public Instance Methods
Add accounts to a list @param id [Integer] @param account_ids [Array<Integer>]
# File lib/mastodon/rest/lists.rb, line 65 def add_accounts_to_list(id, account_ids = []) perform_request(:post, "/api/v1/lists/#{id}/accounts", { 'account_ids[]': account_ids }) end
Create a list @param params [Hash] @option params :title @return [Mastodon::List]
# File lib/mastodon/rest/lists.rb, line 31 def create_list(params = {}) perform_request_with_object(:post, '/api/v1/lists/', params, Mastodon::List) end
Delete a list @param id [Integer]
# File lib/mastodon/rest/lists.rb, line 46 def delete_list(id) perform_request(:delete, "/api/v1/lists/#{id}") end
Retrieve a list @param id [Integer] @return [Mastodon::List]
# File lib/mastodon/rest/lists.rb, line 23 def list(id) perform_request_with_object(:get, "/api/v1/lists/#{id}", {}, Mastodon::List) end
Get a list of accounts on the list @param id [Integer] @param options [Hash] @option options :max_id [Integer] @option options :since_id [Integer] @option options :min_id [Integer] @option options :limit [Integer] @return [Mastodon::Collection<Mastodon::Account>]
# File lib/mastodon/rest/lists.rb, line 58 def list_accounts(id, options = {}) perform_request_with_collection(:get, "/api/v1/lists/#{id}/accounts", options, Mastodon::Account) end
Get a list of your lists @param options [Hash] @option options :max_id [Integer] @option options :since_id [Integer] @option options :limit [Integer] @return [Mastodon::Collection<Mastodon::List>]
# File lib/mastodon/rest/lists.rb, line 16 def lists(options = {}) perform_request_with_collection(:get, '/api/v1/lists', options, Mastodon::List) end
Remove accounts from list @param id [Integer] @param account_ids [Array<Integer>]
# File lib/mastodon/rest/lists.rb, line 72 def remove_accounts_from_list(id, account_ids = []) perform_request(:delete, "/api/v1/lists/#{id}/accounts", { 'account_ids[]': account_ids }) end
Update a list @param id [Integer] @param params [Hash] @option params :title @return [Mastodon::List]
# File lib/mastodon/rest/lists.rb, line 40 def update_list(id, params = {}) perform_request_with_object(:put, "/api/v1/lists/#{id}", params, Mastodon::List) end