Module: Slack::Web::Api::Endpoints::Users
- Included in:
- Slack::Web::Api::Endpoints
- Defined in:
- lib/slack/web/api/endpoints/users.rb
Instance Method Summary collapse
-
#users_conversations(options = {}) ⇒ Object
List conversations the calling user may access.
-
#users_deletePhoto(options = {}) ⇒ Object
Delete the user profile photo.
-
#users_getPresence(options = {}) ⇒ Object
Gets user presence information.
-
#users_identity(options = {}) ⇒ Object
Get a user’s identity.
-
#users_info(options = {}) ⇒ Object
Gets information about a user.
-
#users_list(options = {}) ⇒ Object
Lists all users in a Slack team.
-
#users_lookupByEmail(options = {}) ⇒ Object
Find a user with an email address.
-
#users_setActive(options = {}) ⇒ Object
Marked a user as active.
-
#users_setPhoto(options = {}) ⇒ Object
Set the user profile photo.
-
#users_setPresence(options = {}) ⇒ Object
Manually sets user presence.
Instance Method Details
#users_conversations(options = {}) ⇒ Object
List conversations the calling user may access.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/slack/web/api/endpoints/users.rb', line 26 def users_conversations( = {}) = .merge(user: users_id()['user']['id']) if [:user] if block_given? Pagination::Cursor.new(self, :users_conversations, ).each do |page| yield page end else post('users.conversations', ) end end |
#users_deletePhoto(options = {}) ⇒ Object
Delete the user profile photo
42 43 44 |
# File 'lib/slack/web/api/endpoints/users.rb', line 42 def users_deletePhoto( = {}) post('users.deletePhoto', ) end |
#users_getPresence(options = {}) ⇒ Object
Gets user presence information.
53 54 55 56 |
# File 'lib/slack/web/api/endpoints/users.rb', line 53 def users_getPresence( = {}) = .merge(user: users_id()['user']['id']) if [:user] post('users.getPresence', ) end |
#users_identity(options = {}) ⇒ Object
Get a user’s identity.
63 64 65 |
# File 'lib/slack/web/api/endpoints/users.rb', line 63 def users_identity( = {}) post('users.identity', ) end |
#users_info(options = {}) ⇒ Object
Gets information about a user.
76 77 78 79 80 |
# File 'lib/slack/web/api/endpoints/users.rb', line 76 def users_info( = {}) throw ArgumentError.new('Required arguments :user missing') if [:user].nil? = .merge(user: users_id()['user']['id']) if [:user] post('users.info', ) end |
#users_list(options = {}) ⇒ Object
Lists all users in a Slack team.
95 96 97 98 99 100 101 102 103 |
# File 'lib/slack/web/api/endpoints/users.rb', line 95 def users_list( = {}) if block_given? Pagination::Cursor.new(self, :users_list, ).each do |page| yield page end else post('users.list', ) end end |
#users_lookupByEmail(options = {}) ⇒ Object
Find a user with an email address.
112 113 114 115 |
# File 'lib/slack/web/api/endpoints/users.rb', line 112 def users_lookupByEmail( = {}) throw ArgumentError.new('Required arguments :email missing') if [:email].nil? post('users.lookupByEmail', ) end |
#users_setActive(options = {}) ⇒ Object
Marked a user as active. Deprecated and non-functional.
122 123 124 |
# File 'lib/slack/web/api/endpoints/users.rb', line 122 def users_setActive( = {}) post('users.setActive', ) end |
#users_setPhoto(options = {}) ⇒ Object
Set the user profile photo
139 140 141 |
# File 'lib/slack/web/api/endpoints/users.rb', line 139 def users_setPhoto( = {}) post('users.setPhoto', ) end |
#users_setPresence(options = {}) ⇒ Object
Manually sets user presence.
150 151 152 153 |
# File 'lib/slack/web/api/endpoints/users.rb', line 150 def users_setPresence( = {}) throw ArgumentError.new('Required arguments :presence missing') if [:presence].nil? post('users.setPresence', ) end |