Class: Platforms::Yammer::Api::Users
- Defined in:
- lib/platforms/yammer/api/users.rb
Overview
Users in Yammer
Instance Method Summary collapse
-
#by_email(address, options = {}, headers = {}) ⇒ Faraday::Response
Get a User by email.
-
#current(options = {}, headers = {}) ⇒ Faraday::Response
Get current User.
-
#delete(user_id, options = {}, headers = {}) ⇒ Faraday::Response
Delete an existing User (admins and verified admins only).
-
#get_user(id, options = {}, headers = {}) ⇒ Faraday::Response
Get a User by id.
-
#get_users(options = {}, headers = {}) ⇒ Faraday::Response
Get Users.
-
#in_group(group_id, options = {}, headers = {}) ⇒ Faraday::Response
Get a Users in a Group.
-
#liked_message(message_id, options = {}, headers = {}) ⇒ Faraday::Response
Get Users who have liked a Message.
-
#post(body = nil, headers = {}) ⇒ Faraday::Response
Create a new User (verified admins only).
-
#put(user_id, options = {}, headers = {}) ⇒ Faraday::Response
Update an existing User (verified admins only).
Methods inherited from Base
Constructor Details
This class inherits a constructor from Platforms::Yammer::Api::Base
Instance Method Details
#by_email(address, options = {}, headers = {}) ⇒ Faraday::Response
Get a User by email
51 52 53 54 |
# File 'lib/platforms/yammer/api/users.rb', line 51 def by_email address, ={}, headers={} params = .merge({ email: address }) @connection.get "users/by_email.json", params, headers end |
#current(options = {}, headers = {}) ⇒ Faraday::Response
Get current User
27 28 29 |
# File 'lib/platforms/yammer/api/users.rb', line 27 def current ={}, headers={} @connection.get "users/current.json", , headers end |
#delete(user_id, options = {}, headers = {}) ⇒ Faraday::Response
Delete an existing User (admins and verified admins only)
101 102 103 |
# File 'lib/platforms/yammer/api/users.rb', line 101 def delete user_id, ={}, headers={} @connection.delete "users/#{user_id}.json", , headers end |
#get_user(id, options = {}, headers = {}) ⇒ Faraday::Response
Note:
Called #get_user because of the potential confusion with
Get a User by id
GET /users.json
41 42 43 |
# File 'lib/platforms/yammer/api/users.rb', line 41 def get_user id, ={}, headers={} @connection.get "users/#{id}.json", , headers end |
#get_users(options = {}, headers = {}) ⇒ Faraday::Response
18 19 20 |
# File 'lib/platforms/yammer/api/users.rb', line 18 def get_users ={}, headers={} @connection.get "users.json", , headers end |
#in_group(group_id, options = {}, headers = {}) ⇒ Faraday::Response
Get a Users in a Group
62 63 64 |
# File 'lib/platforms/yammer/api/users.rb', line 62 def in_group group_id, ={}, headers={} @connection.get "users/in_group/#{group_id}.json", , headers end |
#liked_message(message_id, options = {}, headers = {}) ⇒ Faraday::Response
Get Users who have liked a Message
72 73 74 |
# File 'lib/platforms/yammer/api/users.rb', line 72 def , ={}, headers={} @connection.get "users/liked_message/#{}.json", , headers end |
#post(body = nil, headers = {}) ⇒ Faraday::Response
Create a new User (verified admins only)
81 82 83 |
# File 'lib/platforms/yammer/api/users.rb', line 81 def post body=nil, headers={} @connection.post "users.json", body, headers end |
#put(user_id, options = {}, headers = {}) ⇒ Faraday::Response
Update an existing User (verified admins only)
91 92 93 |
# File 'lib/platforms/yammer/api/users.rb', line 91 def put user_id, ={}, headers={} @connection.put "users/#{user_id}.json", , headers end |