Module: Octokit::Client::Organizations
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/organizations.rb
Instance Method Summary collapse
- #add_team_member(team_id, user, options = {}) ⇒ Object
- #add_team_repository(team_id, repo, options = {}) ⇒ Object (also: #add_team_repo)
- #create_team(org, values, options = {}) ⇒ Object
- #delete_team(team_id, options = {}) ⇒ Object
- #organization(org, options = {}) ⇒ Object (also: #org)
- #organization_members(org, options = {}) ⇒ Object (also: #org_members)
- #organization_repositories(org = nil, options = {}) ⇒ Object (also: #org_repositories, #org_repos)
- #organization_teams(org, options = {}) ⇒ Object (also: #org_teams)
- #organizations(user = nil, options = {}) ⇒ Object (also: #list_organizations, #list_orgs, #orgs)
- #remove_team_member(team_id, user, options = {}) ⇒ Object
- #remove_team_repository(team_id, repo, options = {}) ⇒ Object (also: #remove_team_repo)
- #team(team_id, options = {}) ⇒ Object
- #team_members(team_id, options = {}) ⇒ Object
- #team_repositories(team_id, options = {}) ⇒ Object (also: #team_repos)
- #update_organization(org, values, options = {}) ⇒ Object (also: #update_org)
- #update_team(team_id, values, options = {}) ⇒ Object
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, ={}) post("/api/v2/json/teams/#{team_id}/members", .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, ={}) post("/api/v2/json/teams/#{team_id}/repositories", .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, ={}) post("/api/v2/json/organizations/#{org}/teams", .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, ={}) delete("/api/v2/json/teams/#{team_id}", )['team'] end |
#organization(org, options = {}) ⇒ Object Also known as: org
4 5 6 |
# File 'lib/octokit/client/organizations.rb', line 4 def organization(org, ={}) get("/api/v2/json/organizations/#{org}", )['organization'] end |
#organization_members(org, options = {}) ⇒ Object Also known as: org_members
35 36 37 |
# File 'lib/octokit/client/organizations.rb', line 35 def organization_members(org, ={}) get("/api/v2/json/organizations/#{org}/public_members", )['users'] end |
#organization_repositories(org = nil, options = {}) ⇒ Object Also known as: org_repositories, org_repos
25 26 27 28 29 30 31 |
# File 'lib/octokit/client/organizations.rb', line 25 def organization_repositories(org=nil, ={}) if org get("/api/v2/json/organizations/#{org}/public_repositories", ) else get("/api/v2/json/organizations/repositories", ) end['repositories'] end |
#organization_teams(org, options = {}) ⇒ Object Also known as: org_teams
40 41 42 |
# File 'lib/octokit/client/organizations.rb', line 40 def organization_teams(org, ={}) get("/api/v2/json/organizations/#{org}/teams", )['teams'] end |
#organizations(user = nil, options = {}) ⇒ Object Also known as: list_organizations, list_orgs, orgs
14 15 16 17 18 19 20 |
# File 'lib/octokit/client/organizations.rb', line 14 def organizations(user=nil, ={}) if user get("/api/v2/json/user/show/#{user}/organizations", ) else get("/api/v2/json/organizations", ) 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, ={}) delete("/api/v2/json/teams/#{team_id}/members", .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, ={}) delete("/api/v2/json/teams/#{team_id}/repositories", .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, ={}) get("/api/v2/json/teams/#{team_id}", )['team'] end |
#team_members(team_id, options = {}) ⇒ Object
61 62 63 |
# File 'lib/octokit/client/organizations.rb', line 61 def team_members(team_id, ={}) get("/api/v2/json/teams/#{team_id}/members", )['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, ={}) get("/api/v2/json/teams/#{team_id}/repositories", )['repositories'] end |
#update_organization(org, values, options = {}) ⇒ Object Also known as: update_org
9 10 11 |
# File 'lib/octokit/client/organizations.rb', line 9 def update_organization(org, values, ={}) put("/api/v2/json/organizations/#{org}", .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, ={}) put("/api/v2/json/teams/#{team_id}", .merge({:team => values}))['team'] end |