module Mattermost::Endpoint::Posts
Public Instance Methods
create_post(post)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 6 def create_post(post) post("/posts", :body => post.to_json) end
delete_post(post_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 14 def delete_post(post_id) delete("/posts/#{post_id}") end
get_file_info_for_post(post_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 34 def get_file_info_for_post(post_id) get("/posts/#{post_id}/files/info") end
get_flagged_posts(user_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 30 def get_flagged_posts(user_id) get("/posts/#{user_id}/posts/flagged") end
get_post(post_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 10 def get_post(post_id) get("/posts/#{post_id}") end
get_posts_for_channel(channel_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 38 def get_posts_for_channel(channel_id) get("/channels/#{channel_id}/posts") end
get_thread(post_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 26 def get_thread(post_id) get("/posts/#{post_id}/thread") end
patch_post(post_id, patch)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 22 def patch_post(post_id, patch) put("/posts/#{post_id}", :body => patch.to_json) end
perform_post_action(post_id, action_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 57 def perform_post_action(post_id, action_id) post("/posts/#{post_id}/actions/#{action_id}") end
pin_post(post_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 49 def pin_post(post_id) post("/posts/#{post_id}/pin") end
search_team_posts(team_id, terms, is_or_search = false)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 42 def search_team_posts(team_id, terms, is_or_search = false) post("/teams/#{team_id}/posts/search", :body => { :terms => terms, :is_or_search => is_or_search }.to_json) end
unpin_post(post_id)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 53 def unpin_post(post_id) post("/posts/#{post_id}/unpin") end
update_post(post_id, post)
click to toggle source
# File lib/mattermost/endpoint/posts.rb, line 18 def update_post(post_id, post) put("/posts/#{post_id}", :body => post.to_json) end