Module: Mattermost::Endpoint::Preferences

Included in:
Mattermost::Endpoint
Defined in:
lib/mattermost/endpoint/preferences.rb

Instance Method Summary collapse

Instance Method Details

#delete_user_preferences(user_id, preferences = []) ⇒ Object



15
16
17
# File 'lib/mattermost/endpoint/preferences.rb', line 15

def delete_user_preferences(user_id, preferences = [])
	post("/users/#{user_id}/preferences/delete", :body => JSON.generate(preferences))
end

#get_user_preference(user_id, category, preference_name) ⇒ Object



23
24
25
# File 'lib/mattermost/endpoint/preferences.rb', line 23

def get_user_preference(user_id, category, preference_name)
	get("/users/#{user_id}/preferences/#{category}/name/#{preference_name}")
end

#get_user_preferences(user_id) ⇒ Object



7
8
9
# File 'lib/mattermost/endpoint/preferences.rb', line 7

def get_user_preferences(user_id)
	get("/users/#{user_id}/preferences")
end

#list_user_preferences_by_category(user_id, category) ⇒ Object



19
20
21
# File 'lib/mattermost/endpoint/preferences.rb', line 19

def list_user_preferences_by_category(user_id, category)
	get("/users/#{user_id}/preferences/#{category}")
end

#save_user_perferences(user_id, preferences = []) ⇒ Object



11
12
13
# File 'lib/mattermost/endpoint/preferences.rb', line 11

def save_user_perferences(user_id, preferences = [])
	put("/users/#{user_id}/preferences", :body => JSON.generate(preferences))
end