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:



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

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:



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

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:



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

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:



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

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:



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