Module: Mattermost::Endpoint::Posts

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

Instance Method Summary collapse

Instance Method Details

#create_post(post) ⇒ Object



6
7
8
# File 'lib/mattermost/endpoint/posts.rb', line 6

def create_post(post)
	post("/posts", :body => post.to_json)
end

#delete_post(post_id) ⇒ Object



14
15
16
# 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) ⇒ Object



34
35
36
# 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) ⇒ Object



30
31
32
# 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) ⇒ Object



10
11
12
# File 'lib/mattermost/endpoint/posts.rb', line 10

def get_post(post_id)
	get("/posts/#{post_id}")
end

#get_posts_for_channel(channel_id) ⇒ Object



38
39
40
# 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) ⇒ Object



26
27
28
# File 'lib/mattermost/endpoint/posts.rb', line 26

def get_thread(post_id)
	get("/posts/#{post_id}/thread")
end

#patch_post(post_id, patch) ⇒ Object



22
23
24
# 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) ⇒ Object



57
58
59
# 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) ⇒ Object



49
50
51
# 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) ⇒ Object



42
43
44
45
46
47
# 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) ⇒ Object



53
54
55
# File 'lib/mattermost/endpoint/posts.rb', line 53

def unpin_post(post_id)
	post("/posts/#{post_id}/unpin")
end

#update_post(post_id, post) ⇒ Object



18
19
20
# File 'lib/mattermost/endpoint/posts.rb', line 18

def update_post(post_id, post)
	put("/posts/#{post_id}", :body => post.to_json)
end