Module: Typetalk::Api::Notification
- Included in:
- Typetalk::Api
- Defined in:
- lib/typetalk/api/notification.rb
Instance Method Summary collapse
- #accept_team(team_id, invite_team_id, options = {}) ⇒ Object
- #accept_topic(topic_id, invite_topic_id, options = {}) ⇒ Object
- #decline_team(team_id, invite_team_id, options = {}) ⇒ Object
- #decline_topic(topic_id, invite_topic_id, options = {}) ⇒ Object
- #get_notifications(options = {}) ⇒ Object
- #get_notifications_status(options = {}) ⇒ Object
- #read_notifications(options = {}) ⇒ Object
Instance Method Details
#accept_team(team_id, invite_team_id, options = {}) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/typetalk/api/notification.rb', line 42 def accept_team(team_id, invite_team_id, ={}) = {token:nil}.merge() response = connection.post do |req| req.url "#{endpoint}/teams/#{team_id}/members/invite/#{invite_team_id}/accept" req.params[:access_token] = [:token] || access_token end parse_response(response) end |
#accept_topic(topic_id, invite_topic_id, options = {}) ⇒ Object
67 68 69 70 71 72 73 74 75 |
# File 'lib/typetalk/api/notification.rb', line 67 def accept_topic(topic_id, invite_topic_id, ={}) = {token:nil}.merge() response = connection.post do |req| req.url "#{endpoint}/topics/#{topic_id}/members/invite/#{invite_topic_id}/accept" req.params[:access_token] = [:token] || access_token end parse_response(response) end |
#decline_team(team_id, invite_team_id, options = {}) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/typetalk/api/notification.rb', line 53 def decline_team(team_id, invite_team_id, ={}) = {token:nil}.merge() response = connection.post do |req| req.url "#{endpoint}/teams/#{team_id}/members/invite/#{invite_team_id}/decline" req.params[:access_token] = [:token] || access_token end parse_response(response) end |
#decline_topic(topic_id, invite_topic_id, options = {}) ⇒ Object
78 79 80 81 82 83 84 85 86 |
# File 'lib/typetalk/api/notification.rb', line 78 def decline_topic(topic_id, invite_topic_id, ={}) = {token:nil}.merge() response = connection.post do |req| req.url "#{endpoint}/topics/#{topic_id}/members/invite/#{invite_topic_id}/decline" req.params[:access_token] = [:token] || access_token end parse_response(response) end |
#get_notifications(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/typetalk/api/notification.rb', line 6 def get_notifications(={}) = {token:nil}.merge() response = connection.get do |req| req.url "#{endpoint}/notifications" req.params[:access_token] = [:token] || access_token end parse_response(response) end |
#get_notifications_status(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/typetalk/api/notification.rb', line 17 def get_notifications_status(={}) = {token:nil}.merge() response = connection.get do |req| req.url "#{endpoint}/notifications/status" req.params[:access_token] = [:token] || access_token end parse_response(response) end |
#read_notifications(options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/typetalk/api/notification.rb', line 28 def read_notifications(={}) = {token:nil}.merge() response = connection.put do |req| req.url "#{endpoint}/notifications/open" req.params[:access_token] = [:token] || access_token end parse_response(response) end |