Module: Slack::Endpoint::Usergroups

Included in:
Slack::Endpoint
Defined in:
lib/slack/endpoint/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:



22
23
24
25
# File 'lib/slack/endpoint/usergroups.rb', line 22

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/endpoint/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:



52
53
54
55
# File 'lib/slack/endpoint/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:



69
70
71
# File 'lib/slack/endpoint/usergroups.rb', line 69

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:



91
92
93
94
# File 'lib/slack/endpoint/usergroups.rb', line 91

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

#usergroups_users_list(options = {}) ⇒ Object

List all users in 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 update.

  • :include_disabled (Object)

    Allow results that involve disabled User Groups.

See Also:



106
107
108
109
# File 'lib/slack/endpoint/usergroups.rb', line 106

def usergroups_users_list(options={})
  throw ArgumentError.new("Required arguments :usergroup missing") if options[:usergroup].nil?
  post("usergroups.users.list", options)
end

#usergroups_users_update(options = {}) ⇒ Object

Update the list of users for 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 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:



123
124
125
126
127
# File 'lib/slack/endpoint/usergroups.rb', line 123

def usergroups_users_update(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.update", options)
end