class Platforms::Yammer::Api::Users

Users in Yammer @author Benjamin Elias @since 0.1.0

Public Instance Methods

by_email(address, options={}) click to toggle source

Get a User by email @param address [#to_s] email of the User @param options [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/usersby_emailjsonemailuserdomaincom

# File lib/platforms/yammer/api/users.rb, line 51
def by_email address, options={}, headers={}
  params = options.merge({ email: address })
  @connection.get "users/by_email.json", params, headers
end
current(options={}) click to toggle source

Get current User @param options [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/userscurrentjson

# File lib/platforms/yammer/api/users.rb, line 27
def current options={}, headers={}
  @connection.get "users/current.json", options, headers
end
delete(user_id, options={}) click to toggle source

Delete an existing User (admins and verified admins only) @param user_id [#to_s] the id of the User to update @param options [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/usersidjson-2

# File lib/platforms/yammer/api/users.rb, line 101
def delete user_id, options={}, headers={}
  @connection.delete "users/#{user_id}.json", options, headers
end
get_user(id, options={}) click to toggle source

Get a User by id

@note Called get_user because of the potential confusion with GET /users.json

@param id [#to_s] id of the User @param options [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/usersidjson

# File lib/platforms/yammer/api/users.rb, line 41
def get_user id, options={}, headers={}
  @connection.get "users/#{id}.json", options, headers
end
get_users(options={}) click to toggle source

Get Users

@note Called get_users because of the potential confusion with GET /users/.json

@param options [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/usersjson

# File lib/platforms/yammer/api/users.rb, line 18
def get_users options={}, headers={}
  @connection.get "users.json", options, headers
end
in_group(group_id, options={}) click to toggle source

Get a Users in a Group @param group_id [#to_s] id of the Group @param options [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/usersin_groupidjson

# File lib/platforms/yammer/api/users.rb, line 62
def in_group group_id, options={}, headers={}
  @connection.get "users/in_group/#{group_id}.json", options, headers
end
liked_message(message_id, options={}) click to toggle source

Get Users who have liked a Message @param message_id [#to_s] id of the Message @param options [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/usersliked_messagemessage_idjson

# File lib/platforms/yammer/api/users.rb, line 72
def liked_message message_id, options={}, headers={}
  @connection.get "users/liked_message/#{message_id}.json", options, headers
end
post(body=nil, headers={}) click to toggle source

Create a new User (verified admins only) @param body [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/usersjson-1

# 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={}) click to toggle source

Update an existing User (verified admins only) @param user_id [#to_s] the id of the User to update @param options [Hash] Options for the request @param headers [Hash] Additional headers to send with the request @return [Faraday::Response] the API response @see developer.yammer.com/docs/usersidjson-1

# File lib/platforms/yammer/api/users.rb, line 91
def put user_id, options={}, headers={}
  @connection.put "users/#{user_id}.json", options, headers
end