Module: Teamlab::ProjectsTeam

Included in:
Project
Defined in:
lib/teamlab/modules/projects/projects_team.rb

Overview

Module for projects team methods

Instance Method Summary collapse

Instance Method Details

#add_to_team(project_id, user_id) ⇒ Object



14
15
16
# File 'lib/teamlab/modules/projects/projects_team.rb', line 14

def add_to_team(project_id, user_id)
  @request.post([project_id.to_s, 'team'], userid: user_id)
end

#get_project_team(project_id) ⇒ Object



6
7
8
# File 'lib/teamlab/modules/projects/projects_team.rb', line 6

def get_project_team(project_id)
  @request.get([project_id.to_s, 'team'])
end

#get_projects_teams(*project_ids) ⇒ Object



10
11
12
# File 'lib/teamlab/modules/projects/projects_team.rb', line 10

def get_projects_teams(*project_ids)
  @request.post(%w[team], ids: project_ids.flatten)
end

#remove_from_team(project_id, user_id) ⇒ Object



26
27
28
# File 'lib/teamlab/modules/projects/projects_team.rb', line 26

def remove_from_team(project_id, user_id)
  @request.delete([project_id.to_s, 'team'], userId: user_id)
end

#set_team_security(project_id, user_id, security, options = {}) ⇒ Object



22
23
24
# File 'lib/teamlab/modules/projects/projects_team.rb', line 22

def set_team_security(project_id, user_id, security, options = {})
  @request.put([project_id.to_s, 'team', 'security'], { userId: user_id, security: security }.merge(options))
end

#update_project_team(project_id, participants_ids, options = {}) ⇒ Object



18
19
20
# File 'lib/teamlab/modules/projects/projects_team.rb', line 18

def update_project_team(project_id, participants_ids, options = {})
  @request.put([project_id.to_s, 'team'], { participants: participants_ids }.merge(options))
end