Module: Slack::Web::Api::Endpoints::AdminTeams

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

Instance Method Summary collapse

Instance Method Details

#admin_teams_create(options = {}) ⇒ Object

Create an Enterprise team.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :team_domain (Object)

    Team domain (for example, slacksoftballteam). Domains are limited to 21 characters.

  • :team_name (Object)

    Team name (for example, Slack Softball Team).

  • :team_description (Object)

    Description for the team.

  • :team_discoverability (Object)

    Who can join the team. A team’s discoverability can be open, closed, invite_only, or unlisted.

See Also:



22
23
24
25
26
# File 'lib/slack/web/api/endpoints/admin_teams.rb', line 22

def admin_teams_create(options = {})
  throw ArgumentError.new('Required arguments :team_domain missing') if options[:team_domain].nil?
  throw ArgumentError.new('Required arguments :team_name missing') if options[:team_name].nil?
  post('admin.teams.create', options)
end

#admin_teams_list(options = {}) ⇒ Object

List all teams on an Enterprise organization

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :cursor (Object)

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

  • :limit (Object)

    The maximum number of items to return. Must be between 1 - 100 both inclusive.

See Also:



37
38
39
40
41
42
43
44
45
# File 'lib/slack/web/api/endpoints/admin_teams.rb', line 37

def admin_teams_list(options = {})
  if block_given?
    Pagination::Cursor.new(self, :admin_teams_list, options).each do |page|
      yield page
    end
  else
    post('admin.teams.list', options)
  end
end