Team

class github.Team.Team

This class represents Teams.

The reference can be found here https://docs.github.com/en/rest/reference/teams

The OpenAPI schema can be found at - /components/schemas/nullable-team-simple - /components/schemas/team - /components/schemas/team-full - /components/schemas/team-simple

A CompletableGithubObject can be partially initialised (completed=False). Accessing attributes that are not initialized will then trigger a request to complete all attributes.

A partially initialized CompletableGithubObject (completed=False) can be completed via complete(). This requires the url to be given via parameter url or attributes.

With a requester where Requester.is_lazy == True, this CompletableGithubObjects is partially initialized. This requires the url to be given via parameter url or attributes. Any CompletableGithubObject created from this lazy object will be lazy itself if created with parameter url or attributes.

Parameters
  • requester – requester

  • headers – response headers

  • attributes – attributes to initialize

  • completed – do not update non-initialized attributes when True

  • url – url of this instance, overrides attributes[‘url’]

  • accept – use this accept header when completing this instance

add_to_members(member: NamedUser) → None

This API call is deprecated. Use add_membership instead. https://docs.github.com/en/rest/reference/teams#add-or-update-team-membership-for-a-user-legacy

Calls

PUT /teams/{id}/members/{user}

add_membership(member: NamedUser, role: Opt[str] = NotSet) → None
Calls

PUT /teams/{id}/memberships/{user}

get_team_membership(member: str | NamedUser) → Membership
Calls

GET /orgs/{org}/memberships/team/{team_id}/{username}

add_to_repos(repo: Repository) → None
Calls

PUT /teams/{id}/repos/{org}/{repo}

get_repo_permission(repo: Repository) → Permissions | None
Calls

GET /teams/{id}/repos/{org}/{repo}

set_repo_permission(repo: Repository, permission: str) → None
Calls

PUT /teams/{id}/repos/{org}/{repo}

Parameters
Return type

None

update_team_repository(repo: Repository, permission: str) → bool
Calls

PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}

delete() → None
Calls

DELETE /teams/{id}

edit(name: str, description: Union[str, github.GithubObject._NotSetType] = NotSet, permission: Union[str, github.GithubObject._NotSetType] = NotSet, privacy: Union[str, github.GithubObject._NotSetType] = NotSet, parent_team_id: Union[int, github.GithubObject._NotSetType] = NotSet, notification_setting: Union[str, github.GithubObject._NotSetType] = NotSet) → None
Calls

PATCH /teams/{id}

get_teams() → PaginatedList[Team]
Calls

GET /teams/{id}/teams

get_discussions() → PaginatedList[TeamDiscussion]
Calls

GET /teams/{id}/discussions

get_members(role: Opt[str] = NotSet) → PaginatedList[NamedUser]
Calls

GET /teams/{id}/members

get_repos() → PaginatedList[Repository]
Calls

GET /teams/{id}/repos

invitations() → PaginatedList[NamedUser]
Calls

GET /teams/{id}/invitations

has_in_members(member: NamedUser) → bool
Calls

GET /teams/{id}/members/{user}

has_in_repos(repo: Repository) → bool
Calls

GET /teams/{id}/repos/{owner}/{repo}

remove_membership(member: NamedUser) → None
Calls

DELETE /teams/{team_id}/memberships/{username}

remove_from_members(member: NamedUser) → None

This API call is deprecated. Use remove_membership instead: https://docs.github.com/en/rest/reference/teams#add-or-update-team-membership-for-a-user-legacy

Calls

DELETE /teams/{id}/members/{user}

remove_from_repos(repo: Repository) → None
Calls

DELETE /teams/{id}/repos/{owner}/{repo}