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

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.

  • :channels (Object)

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

  • :description (Object)

    A short description of the User Group.

  • :handle (Object)

    A mention handle. Must be unique among channels, users and User Groups.

  • :include_count (Object)

    Include the number of users in each User Group.

See Also:



24
25
26
27
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 24

def usergroups_create(options = {})
  throw ArgumentError.new('Required arguments :name missing') if options[:name].nil?
  post('usergroups.create', options)
end

#usergroups_disable(options = {}) ⇒ Object

Disable 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:



38
39
40
41
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 38

def usergroups_disable(options = {})
  throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
  post('usergroups.disable', options)
end

#usergroups_enable(options = {}) ⇒ Object

Enable a 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 enable.

  • :include_count (Object)

    Include the number of users in the User Group.

See Also:



52
53
54
55
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 52

def usergroups_enable(options = {})
  throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
  post('usergroups.enable', options)
end

#usergroups_list(options = {}) ⇒ Object

List all User Groups for a team

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :include_count (Object)

    Include the number of users in each User Group.

  • :include_disabled (Object)

    Include disabled User Groups.

  • :include_users (Object)

    Include the list of users for each User Group.

See Also:



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

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

#usergroups_update(options = {}) ⇒ Object

Update 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.

  • :channels (Object)

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

  • :description (Object)

    A short description of the User Group.

  • :handle (Object)

    A mention handle. Must be unique among channels, users and User Groups.

  • :include_count (Object)

    Include the number of users in the User Group.

  • :name (Object)

    A name for the User Group. Must be unique among User Groups.

See Also:



89
90
91
92
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 89

def usergroups_update(options = {})
  throw ArgumentError.new('Required arguments :usergroup missing') if options[:usergroup].nil?
  post('usergroups.update', options)
end