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, options = {}) ⇒ Object (also: #org_repositories, #org_repos)
- #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)
- #teams(org, options = {}) ⇒ Object
- #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("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("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("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("teams/#{team_id}", )['team'] end |
#organization(org, options = {}) ⇒ Object Also known as: org
5 6 7 |
# File 'lib/octokit/client/organizations.rb', line 5 def organization(org, ={}) get("organizations/#{org}", )['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, ={}) get("organizations/#{org}/public_members", )['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, ={}) if org get("organizations/#{org}/public_repositories", ) else get("organizations/repositories", ) 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, ={}) if user get("user/show/#{user}/organizations", ) else get("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("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("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("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("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("teams/#{team_id}/repositories", )['repositories'] end |
#teams(org, options = {}) ⇒ Object
41 42 43 |
# File 'lib/octokit/client/organizations.rb', line 41 def teams(org, ={}) get("organizations/#{org}/teams", )['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, ={}) put("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("teams/#{team_id}", .merge({:team => values}))['team'] end |