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.

  • :team_id (Object)

    Encoded team id where the user group has to be created, required if org token is used.

See Also:



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

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.

  • :team_id (Object)

    Encoded team id where the user group is, required if org token is used.

See Also:



42
43
44
45
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 42

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.

  • :team_id (Object)

    Encoded team id where the user group is, required if org token is used.

See Also:



58
59
60
61
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 58

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.

  • :team_id (Object)

    encoded team id to list user groups in, required if org token is used.

See Also:



76
77
78
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 76

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.

  • :team_id (Object)

    encoded team id where the user group exists, required if org token is used.

See Also:



99
100
101
102
# File 'lib/slack/web/api/endpoints/usergroups.rb', line 99

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