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

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

  • :team_name (string)

    Team name (for example, Slack Softball Team).

  • :team_description (string)

    Description for the team.

  • :team_discoverability (string)

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

Raises:

  • (ArgumentError)

See Also:



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

def admin_teams_create(options = {})
  raise ArgumentError, 'Required arguments :team_domain missing' if options[:team_domain].nil?
  raise ArgumentError, '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 (string)

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

  • :limit (integer)

    The maximum number of items to return. Must be a positive integer no larger than 1000.

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