BigW Consortium Gitlab

team.rb 499 Bytes
Newer Older
1
module Mattermost
Kamil Trzcinski committed
2
  class Team < Client
3
    # Returns **all** teams for an admin
Kamil Trzcinski committed
4
    def all
5
      session_get('/api/v3/teams/all').values
6
    end
7

8 9
    # Creates a team on the linked Mattermost instance, the team admin will be the
    # `current_user` passed to the Mattermost::Client instance
Z.J. van de Weg committed
10 11 12 13 14 15
    def create(name:, display_name:, type:)
      session_post('/api/v3/teams/create', body: {
        name: name,
        display_name: display_name,
        type: type
      }.to_json)
16
    end
17 18
  end
end