Module: Slack::Endpoint::Usergroups
- Included in:
- Slack::Endpoint
- Defined in:
- lib/slack/endpoint/usergroups.rb
Instance Method Summary collapse
-
#usergroups_create(options = {}) ⇒ Object
This method is used to create a User Group.
-
#usergroups_disable(options = {}) ⇒ Object
This method disables an existing User Group.
-
#usergroups_enable(options = {}) ⇒ Object
This method enables a User Group which was previously disabled.
-
#usergroups_list(options = {}) ⇒ Object
This method returns a list of all User Groups in the team.
-
#usergroups_update(options = {}) ⇒ Object
This method updates the properties of an existing User Group.
-
#usergroups_users(options = {}) ⇒ Object
This method updates the list of users that belong to a User Group.
Instance Method Details
#usergroups_create(options = {}) ⇒ Object
This method is used to create a User Group.
22 23 24 25 26 |
# File 'lib/slack/endpoint/usergroups.rb', line 22 def usergroups_create(={}) throw ArgumentError.new("Required arguments :name missing") if [:name].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("usergroups.create", ) end |
#usergroups_disable(options = {}) ⇒ Object
This method disables an existing User Group.
38 39 40 41 42 |
# File 'lib/slack/endpoint/usergroups.rb', line 38 def usergroups_disable(={}) throw ArgumentError.new("Required arguments :usergroup missing") if [:usergroup].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("usergroups.disable", ) end |
#usergroups_enable(options = {}) ⇒ Object
This method enables a User Group which was previously disabled.
54 55 56 57 58 |
# File 'lib/slack/endpoint/usergroups.rb', line 54 def usergroups_enable(={}) throw ArgumentError.new("Required arguments :usergroup missing") if [:usergroup].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("usergroups.enable", ) end |
#usergroups_list(options = {}) ⇒ Object
This method returns a list of all User Groups in the team. This can optionally include disabled User Groups.
72 73 74 75 |
# File 'lib/slack/endpoint/usergroups.rb', line 72 def usergroups_list(={}) [:attachments] = [:attachments].to_json if Hash === [:attachments] post("usergroups.list", ) end |
#usergroups_update(options = {}) ⇒ Object
This method updates the properties of an existing User Group.
95 96 97 98 99 |
# File 'lib/slack/endpoint/usergroups.rb', line 95 def usergroups_update(={}) throw ArgumentError.new("Required arguments :usergroup missing") if [:usergroup].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("usergroups.update", ) end |
#usergroups_users(options = {}) ⇒ Object
This method updates the list of users that belong to a User Group. This method replaces all users in a User Group with the list of users provided in the users parameter.
113 114 115 116 117 118 |
# File 'lib/slack/endpoint/usergroups.rb', line 113 def usergroups_users(={}) throw ArgumentError.new("Required arguments :usergroup missing") if [:usergroup].nil? throw ArgumentError.new("Required arguments :users missing") if [:users].nil? [:attachments] = [:attachments].to_json if Hash === [:attachments] post("usergroups.users", ) end |