module Slack::Web::Api::Endpoints::Usergroups

Public Instance Methods

usergroups_create(options = {}) click to toggle source

This method is used to create a user group.

@option options [Object] :name

A name for the user group. Must be unique among user groups.

@option options [Object] :handle

A mention handle. Must be unique among channels, users and user groups.

@option options [Object] :description

A short description of the user group.

@option options [Object] :channels

A comma separated string of encoded channel IDs for which the user group uses as a default.

@option options [Object] :include_count

Include the number of users in each user group.

@see api.slack.com/methods/usergroups.create @see github.com/dblock/slack-api-ref/blob/master/methods/usergroups.create.json

# File lib/slack/web/api/endpoints/usergroups.rb, line 23
def usergroups_create(options = {})
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
  post('usergroups.create', options)
end
usergroups_disable(options = {}) click to toggle source

This method disables an existing user group.

@option options [Object] :usergroup

The encoded ID of the user group to disable.

@option options [Object] :include_count

Include the number of users in the user group.

@see api.slack.com/methods/usergroups.disable @see github.com/dblock/slack-api-ref/blob/master/methods/usergroups.disable.json

# File lib/slack/web/api/endpoints/usergroups.rb, line 37
def usergroups_disable(options = {})
  throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
  post('usergroups.disable', options)
end
usergroups_enable(options = {}) click to toggle source

This method enables a user group which was previously disabled.

@option options [Object] :usergroup

The encoded ID of the user group to enable.

@option options [Object] :include_count

Include the number of users in the user group.

@see api.slack.com/methods/usergroups.enable @see github.com/dblock/slack-api-ref/blob/master/methods/usergroups.enable.json

# File lib/slack/web/api/endpoints/usergroups.rb, line 51
def usergroups_enable(options = {})
  throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
  post('usergroups.enable', options)
end
usergroups_list(options = {}) click to toggle source

This method returns a list of all user groups in the team. This can optionally include disabled user groups.

@option options [Object] :include_disabled

Include disabled user groups.

@option options [Object] :include_count

Include the number of users in each user group.

@option options [Object] :include_users

Include the list of users for each user group.

@see api.slack.com/methods/usergroups.list @see github.com/dblock/slack-api-ref/blob/master/methods/usergroups.list.json

# File lib/slack/web/api/endpoints/usergroups.rb, line 67
def usergroups_list(options = {})
  post('usergroups.list', options)
end
usergroups_update(options = {}) click to toggle source

This method updates the properties of an existing user group.

@option options [Object] :usergroup

The encoded ID of the user group to update.

@option options [Object] :name

A name for the user group. Must be unique among user groups.

@option options [Object] :handle

A mention handle. Must be unique among channels, users and user groups.

@option options [Object] :description

A short description of the user group.

@option options [Object] :channels

A comma separated string of encoded channel IDs for which the user group uses as a default.

@option options [Object] :include_count

Include the number of users in the user group.

@see api.slack.com/methods/usergroups.update @see github.com/dblock/slack-api-ref/blob/master/methods/usergroups.update.json

# File lib/slack/web/api/endpoints/usergroups.rb, line 88
def usergroups_update(options = {})
  throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
  post('usergroups.update', options)
end
usergroups_users(options = {}) click to toggle source

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.

@option options [Object] :usergroup

The encoded ID of the user group to update.

@option options [Object] :users

A comma separated string of encoded user IDs that represent the entire list of users for the user group.

@option options [Object] :include_count

Include the number of users in the user group.

@see api.slack.com/methods/usergroups.users @see github.com/dblock/slack-api-ref/blob/master/methods/usergroups.users.json

# File lib/slack/web/api/endpoints/usergroups.rb, line 104
def usergroups_users(options = {})
  throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
  throw ArgumentError.new('Required arguments :users missing') if options[:users].nil?
  post('usergroups.users', options)
end