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 (string)

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

  • :channels (array)

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

  • :description (string)

    A short description of the User Group.

  • :handle (string)

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

  • :include_count (boolean)

    Include the number of users in each User Group.

  • :team_id (string)

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

Raises:

  • (ArgumentError)

See Also:



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

def usergroups_create(options = {})
  raise ArgumentError, '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 (boolean)

    Include the number of users in the User Group.

  • :team_id (Object)

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

Raises:

  • (ArgumentError)

See Also:



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

def usergroups_disable(options = {})
  raise ArgumentError, '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 (string)

    The encoded ID of the User Group to enable.

  • :include_count (boolean)

    Include the number of users in the User Group.

  • :team_id (string)

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

Raises:

  • (ArgumentError)

See Also:



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

def usergroups_enable(options = {})
  raise ArgumentError, '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 (boolean)

    Include the number of users in each User Group.

  • :include_disabled (boolean)

    Include disabled User Groups.

  • :include_users (boolean)

    Include the list of users for each User Group.

  • :team_id (string)

    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 (array)

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

  • :description (string)

    A short description of the User Group.

  • :handle (string)

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

  • :include_count (boolean)

    Include the number of users in the User Group.

  • :name (string)

    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.

Raises:

  • (ArgumentError)

See Also:



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

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