Module: Octokit::Client::Organizations

Included in:
Octokit::Client
Defined in:
lib/octokit/client/organizations.rb

Instance Method Summary collapse

Instance Method Details

#add_team_member(team_id, user, options = {}) ⇒ Object



65
66
67
# File 'lib/octokit/client/organizations.rb', line 65

def add_team_member(team_id, user, options={})
  post("teams/#{team_id}/members", options.merge({:name => user}))['user']
end

#add_team_repository(team_id, repo, options = {}) ⇒ Object Also known as: add_team_repo



78
79
80
# File 'lib/octokit/client/organizations.rb', line 78

def add_team_repository(team_id, repo, options={})
  post("teams/#{team_id}/repositories", options.merge(:name => Repository.new(repo)))['repositories']
end

#create_team(org, values, options = {}) ⇒ Object



45
46
47
# File 'lib/octokit/client/organizations.rb', line 45

def create_team(org, values, options={})
  post("organizations/#{org}/teams", options.merge({:team => values}))['team']
end

#delete_team(team_id, options = {}) ⇒ Object



57
58
59
# File 'lib/octokit/client/organizations.rb', line 57

def delete_team(team_id, options={})
  delete("teams/#{team_id}", options)['team']
end

#organization(org, options = {}) ⇒ Object Also known as: org



5
6
7
# File 'lib/octokit/client/organizations.rb', line 5

def organization(org, options={})
  get("organizations/#{org}", options)['organization']
end

#organization_members(org, options = {}) ⇒ Object Also known as: org_members



36
37
38
# File 'lib/octokit/client/organizations.rb', line 36

def organization_members(org, options={})
  get("organizations/#{org}/public_members", options)['users']
end

#organization_repositories(org, options = {}) ⇒ Object Also known as: org_repositories, org_repos



26
27
28
29
30
31
32
# File 'lib/octokit/client/organizations.rb', line 26

def organization_repositories(org, options={})
  if org
    get("organizations/#{org}/public_repositories", options)
  else
    get("organizations/repositories", options)
  end['repositories']
end

#organizations(user = nil, options = {}) ⇒ Object Also known as: list_organizations, list_orgs, orgs



15
16
17
18
19
20
21
# File 'lib/octokit/client/organizations.rb', line 15

def organizations(user=nil, options={})
  if user
    get("user/show/#{user}/organizations", options)
  else
    get("organizations", options)
  end['organizations']
end

#remove_team_member(team_id, user, options = {}) ⇒ Object



69
70
71
# File 'lib/octokit/client/organizations.rb', line 69

def remove_team_member(team_id, user, options={})
  delete("teams/#{team_id}/members", options.merge({:name => user}))['user']
end

#remove_team_repository(team_id, repo, options = {}) ⇒ Object Also known as: remove_team_repo



83
84
85
# File 'lib/octokit/client/organizations.rb', line 83

def remove_team_repository(team_id, repo, options={})
  delete("teams/#{team_id}/repositories", options.merge(:name => Repository.new(repo)))['repositories']
end

#team(team_id, options = {}) ⇒ Object



49
50
51
# File 'lib/octokit/client/organizations.rb', line 49

def team(team_id, options={})
  get("teams/#{team_id}", options)['team']
end

#team_members(team_id, options = {}) ⇒ Object



61
62
63
# File 'lib/octokit/client/organizations.rb', line 61

def team_members(team_id, options={})
  get("teams/#{team_id}/members", options)['users']
end

#team_repositories(team_id, options = {}) ⇒ Object Also known as: team_repos



73
74
75
# File 'lib/octokit/client/organizations.rb', line 73

def team_repositories(team_id, options={})
  get("teams/#{team_id}/repositories", options)['repositories']
end

#teams(org, options = {}) ⇒ Object



41
42
43
# File 'lib/octokit/client/organizations.rb', line 41

def teams(org, options={})
  get("organizations/#{org}/teams", options)['teams']
end

#update_organization(org, values, options = {}) ⇒ Object Also known as: update_org



10
11
12
# File 'lib/octokit/client/organizations.rb', line 10

def update_organization(org, values, options={})
  put("organizations/#{org}", options.merge({:organization => values}))['organization']
end

#update_team(team_id, values, options = {}) ⇒ Object



53
54
55
# File 'lib/octokit/client/organizations.rb', line 53

def update_team(team_id, values, options={})
  put("teams/#{team_id}", options.merge({:team => values}))['team']
end