module Mastodon::REST::Lists

Public Instance Methods

add_accounts_to_list(id, account_ids = []) click to toggle source

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_list(params = {}) click to toggle source

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_list(id) click to toggle source

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
list(id) click to toggle source

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
list_accounts(id, options = {}) click to toggle source

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
lists(options = {}) click to toggle source

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(id, account_ids = []) click to toggle source

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_list(id, params = {}) click to toggle source

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