Module: Slack::Web::Api::Endpoints::AdminUsers

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/admin_users.rb

Instance Method Summary collapse

Instance Method Details

#admin_users_assign(options = {}) ⇒ Object

Add an Enterprise user to a workspace.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :team_id (Object)

    The ID (T1234) of the workspace.

  • :user_id (Object)

    The ID of the user to add to the workspace.

  • :channel_ids (Object)

    Comma separated values of channel IDs to add user in the new workspace.

  • :is_restricted (Object)

    True if user should be added to the workspace as a guest.

  • :is_ultra_restricted (Object)

    True if user should be added to the workspace as a single-channel guest.

See Also:



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

def admin_users_assign(options = {})
  throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
  throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
  post('admin.users.assign', options)
end

#admin_users_invite(options = {}) ⇒ Object

Invite a user to a workspace.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :channel_ids (Object)

    A comma-separated list of channel_ids for this user to join. At least one channel is required.

  • :email (Object)

    The email address of the person to invite.

  • :team_id (Object)

    The ID (T1234) of the workspace.

  • :custom_message (Object)

    An optional message to send to the user in the invite email.

  • :guest_expiration_ts (Object)

    Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.

  • :is_restricted (Object)

    Is this user a multi-channel guest user? (default: false).

  • :is_ultra_restricted (Object)

    Is this user a single channel guest user? (default: false).

  • :real_name (Object)

    Full name of the user.

  • :resend (Object)

    Allow this invite to be resent in the future if a user has not signed up yet. (default: false).

See Also:



53
54
55
56
57
58
# File 'lib/slack/web/api/endpoints/admin_users.rb', line 53

def admin_users_invite(options = {})
  throw ArgumentError.new('Required arguments :channel_ids missing') if options[:channel_ids].nil?
  throw ArgumentError.new('Required arguments :email missing') if options[:email].nil?
  throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
  post('admin.users.invite', options)
end

#admin_users_list(options = {}) ⇒ Object

List users on a workspace

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :team_id (Object)

    The ID (T1234) of the workspace.

  • :cursor (Object)

    Set cursor to next_cursor returned by the previous call to list items in the next page.

  • :limit (Object)

    Limit for how many users to be retrieved per page.

See Also:



71
72
73
74
75
76
77
78
79
80
# File 'lib/slack/web/api/endpoints/admin_users.rb', line 71

def admin_users_list(options = {})
  throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
  if block_given?
    Pagination::Cursor.new(self, :admin_users_list, options).each do |page|
      yield page
    end
  else
    post('admin.users.list', options)
  end
end

#admin_users_remove(options = {}) ⇒ Object

Remove a user from a workspace.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :team_id (Object)

    The ID (T1234) of the workspace.

  • :user_id (Object)

    The ID of the user to remove.

See Also:



91
92
93
94
95
# File 'lib/slack/web/api/endpoints/admin_users.rb', line 91

def admin_users_remove(options = {})
  throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
  throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
  post('admin.users.remove', options)
end

#admin_users_setAdmin(options = {}) ⇒ Object

Set an existing guest, regular user, or owner to be an admin user.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :team_id (Object)

    The ID (T1234) of the workspace.

  • :user_id (Object)

    The ID of the user to designate as an admin.

See Also:



106
107
108
109
110
# File 'lib/slack/web/api/endpoints/admin_users.rb', line 106

def admin_users_setAdmin(options = {})
  throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
  throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
  post('admin.users.setAdmin', options)
end

#admin_users_setExpiration(options = {}) ⇒ Object

Set an expiration for a guest user

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :expiration_ts (Object)

    Timestamp when guest account should be disabled.

  • :team_id (Object)

    The ID (T1234) of the workspace.

  • :user_id (Object)

    The ID of the user to set an expiration for.

See Also:



123
124
125
126
127
128
# File 'lib/slack/web/api/endpoints/admin_users.rb', line 123

def admin_users_setExpiration(options = {})
  throw ArgumentError.new('Required arguments :expiration_ts missing') if options[:expiration_ts].nil?
  throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
  throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
  post('admin.users.setExpiration', options)
end

#admin_users_setOwner(options = {}) ⇒ Object

Set an existing guest, regular user, or admin user to be a workspace owner.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :team_id (Object)

    The ID (T1234) of the workspace.

  • :user_id (Object)

    Id of the user to promote to owner.

See Also:



139
140
141
142
143
# File 'lib/slack/web/api/endpoints/admin_users.rb', line 139

def admin_users_setOwner(options = {})
  throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
  throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
  post('admin.users.setOwner', options)
end

#admin_users_setRegular(options = {}) ⇒ Object

Set an existing guest user, admin user, or owner to be a regular user.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :team_id (Object)

    The ID (T1234) of the workspace.

  • :user_id (Object)

    The ID of the user to designate as a regular user.

See Also:



154
155
156
157
158
# File 'lib/slack/web/api/endpoints/admin_users.rb', line 154

def admin_users_setRegular(options = {})
  throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
  throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
  post('admin.users.setRegular', options)
end