Module: Slack::Web::Api::Endpoints::Usergroups

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/usergroups.rb

Instance Method Summary collapse

Instance Method Details

#usergroups_create(options = {}) ⇒ Object

This method is used to create a user group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :name (Object)

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

  • :handle (Object)

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

  • :description (Object)

    A short description of the user group.

  • :channels (Object)

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

  • :include_count (Object)

    Include the number of users in each user group.

See Also:



23
24
25
26
# 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 = {}) ⇒ Object

This method disables an existing user group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :usergroup (Object)

    The encoded ID of the user group to disable.

  • :include_count (Object)

    Include the number of users in the user group.

See Also:



37
38
39
40
# 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 = {}) ⇒ Object

This method enables a user group which was previously disabled.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :usergroup (Object)

    The encoded ID of the user group to enable.

  • :include_count (Object)

    Include the number of users in the user group.

See Also:



51
52
53
54
# 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 = {}) ⇒ Object

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

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :include_disabled (Object)

    Include disabled user groups.

  • :include_count (Object)

    Include the number of users in each user group.

  • :include_users (Object)

    Include the list of users for each user group.

See Also:



67
68
69
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 67

def usergroups_list(options = {})
  post('usergroups.list', options)
end

#usergroups_update(options = {}) ⇒ Object

This method updates the properties of an existing user group.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :usergroup (Object)

    The encoded ID of the user group to update.

  • :name (Object)

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

  • :handle (Object)

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

  • :description (Object)

    A short description of the user group.

  • :channels (Object)

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

  • :include_count (Object)

    Include the number of users in the user group.

See Also:



88
89
90
91
# 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 = {}) ⇒ 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.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :usergroup (Object)

    The encoded ID of the user group to update.

  • :users (Object)

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

  • :include_count (Object)

    Include the number of users in the user group.

See Also:



104
105
106
107
108
# 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