gitlab-org--gitlab-foss/lib/mattermost/team.rb

19 lines
499 B
Ruby
Raw Normal View History

module Mattermost
2016-12-19 23:22:10 +00:00
class Team < Client
2017-02-02 14:04:02 +00:00
# Returns **all** teams for an admin
2016-12-19 23:22:10 +00:00
def all
2017-02-15 13:49:14 +00:00
session_get('/api/v3/teams/all').values
end
2017-02-02 14:04:02 +00:00
2017-02-03 10:29:56 +00:00
# Creates a team on the linked Mattermost instance, the team admin will be the
# `current_user` passed to the Mattermost::Client instance
2017-03-01 19:34:29 +00:00
def create(name:, display_name:, type:)
session_post('/api/v3/teams/create', body: {
name: name,
display_name: display_name,
type: type
}.to_json)
2017-02-02 14:04:02 +00:00
end
end
end