Module: Octokit::Client::Organizations
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/organizations.rb |
Overview
Methods for the Organizations
API
Instance Method Summary
-
#add_team_member(team_id, user, options = {}) ⇒ Boolean
Add team member.
-
#add_team_membership(team_id, user, options = {}) ⇒ Sawyer::Resource
Add or invite a user to a team.
-
#add_team_repo(team_id, repo, options = {})
Alias for #add_team_repository.
-
#add_team_repository(team_id, repo, options = {}) ⇒ Boolean
(also: #add_team_repo)
Add team repository.
-
#all_organizations(options = {}) ⇒ Array<Sawyer::Resource>
(also: #all_orgs)
List all GitHub organizations.
-
#all_orgs(options = {})
Alias for #all_organizations.
-
#billing_actions(org) ⇒ Sawyer::Resource
Get GitHub Actions billing for an organization.
-
#child_teams(team_id, options = {}) ⇒ Sawyer::Resource
List child teams.
-
#conceal_membership(org, user, options = {})
Alias for #unpublicize_membership.
-
#convert_to_outside_collaborator(org, user, options = {}) ⇒ Boolean
Converts an organization member to an outside collaborator.
-
#create_team(org, options = {}) ⇒ Sawyer::Resource
Create team.
-
#delete_migration_archive(org, id, options = {})
Deletes a previous migration archive.
-
#delete_org(org)
Alias for #delete_organization.
-
#delete_organization(org) ⇒ Boolean
(also: #delete_org)
Delete an organization.
-
#delete_team(team_id, options = {}) ⇒ Boolean
Delete team.
-
#list_organizations(user = nil, options = {})
Alias for #organizations.
-
#list_orgs(user = nil, options = {})
Alias for #organizations.
-
#migration_archive_url(org, id, options = {})
Fetches the URL to a migration archive.
-
#migration_status(org, id, options = {})
Fetches the status of a migration.
-
#migrations(org, options = {}) ⇒ Array<Sawyer::Resource>
Lists the most recent migrations.
-
#org(org, options = {})
Alias for #organization.
-
#org_invitations(org, options = {})
Alias for #organization_invitations.
-
#org_member?(org, user, options = {})
Alias for #organization_member?.
-
#org_members(org, options = {})
Alias for #organization_members.
-
#org_membership(org, options = {})
Alias for #organization_membership.
-
#org_memberships(options = {})
Alias for #organization_memberships.
-
#org_public_member?(org, user, options = {})
Alias for #organization_public_member?.
-
#org_public_members(org, options = {})
Alias for #organization_public_members.
-
#org_repos(org, options = {})
Alias for #organization_repositories.
-
#org_repositories(org, options = {})
Alias for #organization_repositories.
-
#org_teams(org, options = {})
Alias for #organization_teams.
-
#organization(org, options = {}) ⇒ Sawyer::Resource
(also: #org)
Get an organization.
-
#organization_audit_log(org, options = {}) ⇒ Array<Sawyer::Resource>
Get organization audit log.
-
#organization_invitations(org, options = {}) ⇒ Array<Sawyer::Resource>
(also: #org_invitations)
List pending organization invitations.
-
#organization_member?(org, user, options = {}) ⇒ Boolean
(also: #org_member?)
Check if a user is a member of an organization.
-
#organization_members(org, options = {}) ⇒ Array<Sawyer::Resource>
(also: #org_members)
Get organization members.
-
#organization_membership(org, options = {}) ⇒ Sawyer::Resource
(also: #org_membership)
Get an organization membership.
-
#organization_memberships(options = {}) ⇒ Array<Sawyer::Resource>
(also: #org_memberships)
List all organizations memberships for the authenticated user.
-
#organization_public_member?(org, user, options = {}) ⇒ Boolean
(also: #org_public_member?)
Check if a user is a public member of an organization.
-
#organization_public_members(org, options = {}) ⇒ Array<Sawyer::Resource>
(also: #org_public_members)
Get organization public members.
-
#organization_repositories(org, options = {}) ⇒ Array<Sawyer::Resource>
(also: #org_repositories, #org_repos)
List organization repositories.
-
#organization_teams(org, options = {}) ⇒ Array<Sawyer::Resource>
(also: #org_teams)
List teams.
-
#organizations(user = nil, options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_organizations, #list_orgs, #orgs)
Get organizations for a user.
-
#orgs(user = nil, options = {})
Alias for #organizations.
-
#outside_collaborators(org, options = {}) ⇒ Array<Sawyer::Resource>
List outside collaborators for an organization.
-
#publicize_membership(org, user, options = {}) ⇒ Boolean
Publicize a user's membership of an organization.
-
#remove_org_member(org, user, options = {})
Alias for #remove_organization_member.
-
#remove_org_membership(org, options = {})
Alias for #remove_organization_membership.
-
#remove_organization_member(org, user, options = {}) ⇒ Boolean
(also: #remove_org_member)
Remove organization member.
-
#remove_organization_membership(org, options = {}) ⇒ Boolean
(also: #remove_org_membership)
Remove an organization membership.
-
#remove_outside_collaborator(org, user, options = {}) ⇒ Boolean
Remove outside collaborator from an organization.
-
#remove_team_member(team_id, user, options = {}) ⇒ Boolean
Remove team member.
-
#remove_team_membership(team_id, user, options = {}) ⇒ Boolean
Remove team membership.
-
#remove_team_repo(team_id, repo, _options = {})
Alias for #remove_team_repository.
-
#remove_team_repository(team_id, repo, _options = {}) ⇒ Boolean
(also: #remove_team_repo)
Remove team repository.
-
#start_migration(org, repositories, options = {}) ⇒ Sawyer::Resource
Initiates the generation of a migration archive.
-
#team(team_id, options = {}) ⇒ Sawyer::Resource
Get team.
-
#team_by_name(org, team_slug, options = {}) ⇒ Sawyer::Resource
Get team by name and org.
-
#team_invitations(team_id, options = {}) ⇒ Array<Sawyer::Resource>
List pending team invitations.
-
#team_member?(team_id, user, options = {}) ⇒ Boolean
Check if a user is a member of a team.
-
#team_members(team_id, options = {}) ⇒ Array<Sawyer::Resource>
List team members.
-
#team_membership(team_id, user, options = {}) ⇒ Sawyer::Resource
Check if a user has a team membership.
-
#team_permissions_for_repo(org, team_slug_or_id, owner, repo, options = {}) ⇒ String, Sawyer::Resource
Check team permissions for a repository.
-
#team_repo?(team_id, repo, _options = {})
Alias for #team_repository?.
-
#team_repos(team_id, options = {})
Alias for #team_repositories.
-
#team_repositories(team_id, options = {}) ⇒ Array<Sawyer::Resource>
(also: #team_repos)
List team repositories.
-
#team_repository?(team_id, repo, _options = {}) ⇒ Boolean
(also: #team_repo?)
Check if a repo is managed by a specific team.
-
#unlock_repository(org, id, repo, options = {})
Unlock a previous migration archive.
-
#unpublicize_membership(org, user, options = {}) ⇒ Boolean
(also: #conceal_membership)
Conceal a user's membership of an organization.
-
#update_org(org, values, options = {})
Alias for #update_organization.
-
#update_org_membership(org, options = {})
Alias for #update_organization_membership.
-
#update_organization(org, values, options = {}) ⇒ Sawyer::Resource
(also: #update_org)
Update an organization.
-
#update_organization_membership(org, options = {}) ⇒ Sawyer::Resource
(also: #update_org_membership)
Edit an organization membership.
-
#update_team(team_id, options = {}) ⇒ Sawyer::Resource
Update team.
-
#user_teams(options = {}) ⇒ Array<Sawyer::Resource>
List all teams for the authenticated user across all their orgs.
Instance Method Details
#add_team_member(team_id, user, options = {}) ⇒ Boolean
Add team member
Requires authenticated organization owner or member with team
admin
permission.
# File 'lib/octokit/client/organizations.rb', line 458
def add_team_member(team_id, user, = {}) # There's a bug in this API call. The docs say to leave the body blank, # but it fails if the body is both blank and the content-length header # is not 0. boolean_from_response :put, "teams/#{team_id}/members/#{user}", .merge({ name: user }) end
#add_team_membership(team_id, user, options = {}) ⇒ Sawyer::Resource
Add or invite a user to a team
# File 'lib/octokit/client/organizations.rb', line 679
def add_team_membership(team_id, user, = {}) put "teams/#{team_id}/memberships/#{user}", end
#add_team_repo(team_id, repo, options = {})
Alias for #add_team_repository.
# File 'lib/octokit/client/organizations.rb', line 573
alias add_team_repo add_team_repository
#add_team_repository(team_id, repo, options = {}) ⇒ Boolean
Also known as: #add_team_repo
Add team repository
This can also be used to update the permission of an existing team
Requires authenticated user to be an owner of the organization that the team is associated with. Also, the repo must be owned by the organization, or a direct form of a repo owned by the organization.
# File 'lib/octokit/client/organizations.rb', line 570
def add_team_repository(team_id, repo, = {}) boolean_from_response :put, "teams/#{team_id}/repos/#{Repository.new(repo)}", end
#all_organizations(options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #all_orgs
List all GitHub organizations
This provides a list of every organization, in the order that they were created.
::Octokit::Organization
that you’ve seen.
# File 'lib/octokit/client/organizations.rb', line 116
def all_organizations( = {}) paginate 'organizations', end
#all_orgs(options = {})
Alias for #all_organizations.
# File 'lib/octokit/client/organizations.rb', line 119
alias all_orgs all_organizations
#billing_actions(org) ⇒ Sawyer::Resource
Get GitHub Actions billing for an organization
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 839
def billing_actions(org) get "#{Organization.path(org)}/settings/billing/actions" end
#child_teams(team_id, options = {}) ⇒ Sawyer::Resource
List child teams
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 384
def child_teams(team_id, = {}) paginate "teams/#{team_id}/teams", end
#conceal_membership(org, user, options = {})
Alias for #unpublicize_membership.
# File 'lib/octokit/client/organizations.rb', line 643
alias conceal_membership unpublicize_membership
#convert_to_outside_collaborator(org, user, options = {}) ⇒ Boolean
Converts an organization member to an outside collaborator
Requires authenticated organization members.
# File 'lib/octokit/client/organizations.rb', line 284
def convert_to_outside_collaborator(org, user, = {}) boolean_from_response :put, "#{Organization.path org}/outside_collaborators/#{user}", end
#create_team(org, options = {}) ⇒ Sawyer::Resource
Create team
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 320
def create_team(org, = {}) if .key?(: ) octokit_warn 'Deprecated: Passing :permission option to #create_team. Assign team repository permission by passing :permission to #add_team_repository instead.' end post "#{Organization.path org}/teams", end
#delete_migration_archive(org, id, options = {})
Deletes a previous migration archive.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 813
def delete_migration_archive(org, id, = {}) delete "#{Organization.path(org)}/migrations/#{id}/archive", end
#delete_org(org)
Alias for #delete_organization.
# File 'lib/octokit/client/organizations.rb', line 67
alias delete_org delete_organization
#delete_organization(org) ⇒ Boolean
Also known as: #delete_org
Delete an organization.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 64
def delete_organization(org) boolean_from_response :delete, Organization.path(org) end
#delete_team(team_id, options = {}) ⇒ Boolean
Delete team
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 420
def delete_team(team_id, = {}) boolean_from_response :delete, "teams/#{team_id}", end
#list_organizations(user = nil, options = {})
Alias for #organizations.
# File 'lib/octokit/client/organizations.rb', line 100
alias list_organizations organizations
#list_orgs(user = nil, options = {})
Alias for #organizations.
# File 'lib/octokit/client/organizations.rb', line 101
alias list_orgs organizations
#migration_archive_url(org, id, options = {})
Fetches the URL to a migration archive.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 799
def migration_archive_url(org, id, = {}) url = "#{Organization.path(org)}/migrations/#{id}/archive" response = client_without_redirects( ).get(url) response.headers['location'] end
#migration_status(org, id, options = {})
Fetches the status of a migration.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 788
def migration_status(org, id, = {}) get "#{Organization.path(org)}/migrations/#{id}", end
#migrations(org, options = {}) ⇒ Array
<Sawyer::Resource
>
Lists the most recent migrations.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 777
def migrations(org, = {}) paginate "#{Organization.path(org)}/migrations", end
#org(org, options = {})
Alias for #organization.
# File 'lib/octokit/client/organizations.rb', line 21
alias org organization
#org_invitations(org, options = {})
Alias for #organization_invitations.
# File 'lib/octokit/client/organizations.rb', line 242
alias org_invitations organization_invitations
#org_member?(org, user, options = {})
Alias for #organization_member?.
# File 'lib/octokit/client/organizations.rb', line 207
alias org_member? organization_member?
#org_members(org, options = {})
Alias for #organization_members.
# File 'lib/octokit/client/organizations.rb', line 165
alias org_members organization_members
#org_membership(org, options = {})
Alias for #organization_membership.
# File 'lib/octokit/client/organizations.rb', line 719
alias org_membership organization_membership
#org_memberships(options = {})
Alias for #organization_memberships.
# File 'lib/octokit/client/organizations.rb', line 702
alias org_memberships organization_memberships
#org_public_member?(org, user, options = {})
Alias for #organization_public_member?.
# File 'lib/octokit/client/organizations.rb', line 227
alias org_public_member? organization_public_member?
#org_public_members(org, options = {})
Alias for #organization_public_members.
# File 'lib/octokit/client/organizations.rb', line 181
alias org_public_members organization_public_members
#org_repos(org, options = {})
Alias for #organization_repositories.
# File 'lib/octokit/client/organizations.rb', line 145
alias org_repos organization_repositories
#org_repositories(org, options = {})
Alias for #organization_repositories.
# File 'lib/octokit/client/organizations.rb', line 144
alias org_repositories organization_repositories
#org_teams(org, options = {})
Alias for #organization_teams.
# File 'lib/octokit/client/organizations.rb', line 302
alias org_teams organization_teams
#organization(org, options = {}) ⇒ Sawyer::Resource
Also known as: #org
Get an organization
# File 'lib/octokit/client/organizations.rb', line 18
def organization(org, = {}) get Organization.path(org), end
#organization_audit_log(org, options = {}) ⇒ Array
<Sawyer::Resource
>
Get organization audit log.
Gets the audit log for an organization.
To list oldest events first, specify asc.
# File 'lib/octokit/client/organizations.rb', line 859
def organization_audit_log(org, = {}) paginate "#{Organization.path org}/audit-log", end
#organization_invitations(org, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #org_invitations
List pending organization invitations
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 239
def organization_invitations(org, = {}) get "#{Organization.path org}/invitations", end
#organization_member?(org, user, options = {}) ⇒ Boolean
Also known as: #org_member?
Check if a user is a member of an organization.
Use this to check if another user is a member of an organization that you are a member. If you are not in the organization you are checking, use .organization_public_member? instead.
# File 'lib/octokit/client/organizations.rb', line 199
def organization_member?(org, user, = {}) result = boolean_from_response(:get, "#{Organization.path org}/members/#{user}", ) if !result && last_response && last_response.status == 302 boolean_from_response :get, last_response.headers['Location'] else result end end
#organization_members(org, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #org_members
Get organization members
Public members of the organization are returned by default. An authenticated client that is a member of the GitHub organization is required to get private members.
# File 'lib/octokit/client/organizations.rb', line 160
def organization_members(org, = {}) = .dup path = 'public_' if .delete(:public) paginate "#{Organization.path org}/#{path}members", end
#organization_membership(org, options = {}) ⇒ Sawyer::Resource
Also known as: #org_membership
Get an organization membership
# File 'lib/octokit/client/organizations.rb', line 711
def organization_membership(org, = {}) = .dup if user = .delete(:user) get "#{Organization.path(org)}/memberships/#{user}", else get "user/memberships/orgs/#{org}", end end
#organization_memberships(options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #org_memberships
List all organizations memberships for the authenticated user
# File 'lib/octokit/client/organizations.rb', line 699
def organization_memberships( = {}) paginate 'user/memberships/orgs', end
#organization_public_member?(org, user, options = {}) ⇒ Boolean
Also known as: #org_public_member?
Check if a user is a public member of an organization.
If you are checking for membership of a user of an organization that you are in, use .organization_member? instead.
# File 'lib/octokit/client/organizations.rb', line 224
def organization_public_member?(org, user, = {}) boolean_from_response :get, "#{Organization.path org}/public_members/#{user}", end
#organization_public_members(org, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #org_public_members
Get organization public members
Lists the public members of an organization
# File 'lib/octokit/client/organizations.rb', line 178
def organization_public_members(org, = {}) organization_members org, .merge(public: true) end
#organization_repositories(org, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #org_repositories, #org_repos
List organization repositories
Public repositories are available without authentication. Private repos require authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 141
def organization_repositories(org, = {}) paginate "#{Organization.path org}/repos", end
#organization_teams(org, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #org_teams
List teams
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 299
def organization_teams(org, = {}) paginate "#{Organization.path org}/teams", end
#organizations(user = nil, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #list_organizations, #list_orgs, #orgs
Get organizations for a user.
Nonauthenticated calls to this method will return organizations that the user is a public member.
Use an authenticated client to get both public and private organizations for a user.
Calling this method on a @client
will return that users organizations.
Private organizations are included only if the @client
is authenticated.
#orgs(user = nil, options = {})
Alias for #organizations.
# File 'lib/octokit/client/organizations.rb', line 102
alias orgs organizations
#outside_collaborators(org, options = {}) ⇒ Array
<Sawyer::Resource
>
List outside collaborators for an organization
Requires authenticated organization members.
# File 'lib/octokit/client/organizations.rb', line 254
def outside_collaborators(org, = {}) paginate "#{Organization.path org}/outside_collaborators", end
#publicize_membership(org, user, options = {}) ⇒ Boolean
Publicize a user's membership of an organization
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 624
def publicize_membership(org, user, = {}) boolean_from_response :put, "#{Organization.path org}/public_members/#{user}", end
#remove_org_member(org, user, options = {})
Alias for #remove_organization_member.
# File 'lib/octokit/client/organizations.rb', line 612
alias remove_org_member remove_organization_member
#remove_org_membership(org, options = {})
Alias for #remove_organization_membership.
# File 'lib/octokit/client/organizations.rb', line 752
alias remove_org_membership remove_organization_membership
#remove_organization_member(org, user, options = {}) ⇒ Boolean
Also known as: #remove_org_member
Remove organization member
Requires authenticated organization owner or member with team admin
access.
# File 'lib/octokit/client/organizations.rb', line 607
def remove_organization_member(org, user, = {}) # this is a synonym for: for team in org.teams: remove_team_member(team.id, user) # provided in the GH API v3 boolean_from_response :delete, "#{Organization.path org}/members/#{user}", end
#remove_organization_membership(org, options = {}) ⇒ Boolean
Also known as: #remove_org_membership
Remove an organization membership
# File 'lib/octokit/client/organizations.rb', line 747
def remove_organization_membership(org, = {}) = .dup user = .delete(:user) user && boolean_from_response(:delete, "#{Organization.path(org)}/memberships/#{user}", ) end
#remove_outside_collaborator(org, user, options = {}) ⇒ Boolean
Remove outside collaborator from an organization
Requires authenticated organization members.
# File 'lib/octokit/client/organizations.rb', line 269
def remove_outside_collaborator(org, user, = {}) boolean_from_response :delete, "#{Organization.path org}/outside_collaborators/#{user}", end
#remove_team_member(team_id, user, options = {}) ⇒ Boolean
Remove team member
Requires authenticated organization owner or member with team
admin
permission.
# File 'lib/octokit/client/organizations.rb', line 476
def remove_team_member(team_id, user, = {}) boolean_from_response :delete, "teams/#{team_id}/members/#{user}", end
#remove_team_membership(team_id, user, options = {}) ⇒ Boolean
Remove team membership
# File 'lib/octokit/client/organizations.rb', line 691
def remove_team_membership(team_id, user, = {}) boolean_from_response :delete, "teams/#{team_id}/memberships/#{user}", end
#remove_team_repo(team_id, repo, _options = {})
Alias for #remove_team_repository.
# File 'lib/octokit/client/organizations.rb', line 593
alias remove_team_repo remove_team_repository
#remove_team_repository(team_id, repo, _options = {}) ⇒ Boolean
Also known as: #remove_team_repo
Remove team repository
Removes repository from team. Does not delete the repository.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 590
def remove_team_repository(team_id, repo, = {}) boolean_from_response :delete, "teams/#{team_id}/repos/#{Repository.new(repo)}" end
#start_migration(org, repositories, options = {}) ⇒ Sawyer::Resource
Initiates the generation of a migration archive.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 765
def start_migration(org, repositories, = {}) [:repositories] = repositories post "#{Organization.path(org)}/migrations", end
#team(team_id, options = {}) ⇒ Sawyer::Resource
Get team
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 336
def team(team_id, = {}) get "teams/#{team_id}", end
#team_by_name(org, team_slug, options = {}) ⇒ Sawyer::Resource
Get team by name and org
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 350
def team_by_name(org, team_slug, = {}) get "#{Organization.path(org)}/teams/#{team_slug}", end
#team_invitations(team_id, options = {}) ⇒ Array
<Sawyer::Resource
>
List pending team invitations
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 509
def team_invitations(team_id, = {}) get "teams/#{team_id}/invitations", end
#team_member?(team_id, user, options = {}) ⇒ Boolean
Check if a user is a member of a team.
Use this to check if another user is a member of a team that you are a member.
# File 'lib/octokit/client/organizations.rb', line 495
def team_member?(team_id, user, = {}) boolean_from_response :get, "teams/#{team_id}/members/#{user}", end
#team_members(team_id, options = {}) ⇒ Array
<Sawyer::Resource
>
List team members
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 433
def team_members(team_id, = {}) paginate "teams/#{team_id}/members", end
#team_membership(team_id, user, options = {}) ⇒ Sawyer::Resource
Check if a user has a team membership.
# File 'lib/octokit/client/organizations.rb', line 664
def team_membership(team_id, user, = {}) get "teams/#{team_id}/memberships/#{user}", end
#team_permissions_for_repo(org, team_slug_or_id, owner, repo, options = {}) ⇒ String
, Sawyer::Resource
Check team permissions for a repository
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 371
def (org, team_slug_or_id, owner, repo, = {}) get "#{Organization.path(org)}/teams/#{team_slug_or_id}/repos/#{owner}/#{repo}", end
#team_repo?(team_id, repo, _options = {})
Alias for #team_repository?.
# File 'lib/octokit/client/organizations.rb', line 544
alias team_repo? team_repository?
#team_repos(team_id, options = {})
Alias for #team_repositories.
# File 'lib/octokit/client/organizations.rb', line 527
alias team_repos team_repositories
#team_repositories(team_id, options = {}) ⇒ Array
<Sawyer::Resource
>
Also known as: #team_repos
List team repositories
Requires authenticated organization member.
# File 'lib/octokit/client/organizations.rb', line 524
def team_repositories(team_id, = {}) paginate "teams/#{team_id}/repos", end
#team_repository?(team_id, repo, _options = {}) ⇒ Boolean
Also known as: #team_repo?
Check if a repo is managed by a specific team
# File 'lib/octokit/client/organizations.rb', line 541
def team_repository?(team_id, repo, = {}) boolean_from_response :get, "teams/#{team_id}/repos/#{Repository.new(repo)}" end
#unlock_repository(org, id, repo, options = {})
Unlock a previous migration archive.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 825
def unlock_repository(org, id, repo, = {}) delete "#{Organization.path(org)}/migrations/#{id}/repos/#{repo}/lock", end
#unpublicize_membership(org, user, options = {}) ⇒ Boolean
Also known as: #conceal_membership
Conceal a user's membership of an organization.
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 640
def unpublicize_membership(org, user, = {}) boolean_from_response :delete, "#{Organization.path org}/public_members/#{user}", end
#update_org(org, values, options = {})
Alias for #update_organization.
# File 'lib/octokit/client/organizations.rb', line 51
alias update_org update_organization
#update_org_membership(org, options = {})
Alias for #update_organization_membership.
# File 'lib/octokit/client/organizations.rb', line 740
alias update_org_membership update_organization_membership
#update_organization(org, values, options = {}) ⇒ Sawyer::Resource
Also known as: #update_org
Update an organization.
Requires authenticated client with proper organization permissions.
# File 'lib/octokit/client/organizations.rb', line 48
def update_organization(org, values, = {}) patch Organization.path(org), .merge(values) end
#update_organization_membership(org, options = {}) ⇒ Sawyer::Resource
Also known as: #update_org_membership
Edit an organization membership
# File 'lib/octokit/client/organizations.rb', line 730
def update_organization_membership(org, = {}) = .dup if user = .delete(:user) .delete(:state) put "#{Organization.path(org)}/memberships/#{user}", else .delete(:role) patch "user/memberships/orgs/#{org}", end end
#update_team(team_id, options = {}) ⇒ Sawyer::Resource
Update team
Requires authenticated organization owner.
# File 'lib/octokit/client/organizations.rb', line 407
def update_team(team_id, = {}) patch "teams/#{team_id}", end
#user_teams(options = {}) ⇒ Array
<Sawyer::Resource
>
List all teams for the authenticated user across all their orgs
# File 'lib/octokit/client/organizations.rb', line 649
def user_teams( = {}) paginate 'user/teams', end