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



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

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



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

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



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

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

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



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

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 = nil, 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=nil, options={})
  if org
    get("organizations/#{org}/public_repositories", options)
  else
    get("organizations/repositories", options)
  end['repositories']
end

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



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

def organization_teams(org, options={})
  get("organizations/#{org}/teams", options)['teams']
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



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

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



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

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



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

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

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



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

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



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

def team_repositories(team_id, options={})
  get("teams/#{team_id}/repositories", options)['repositories']
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



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

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