repos
Accessed as client.repos; the async client mirrors it.
Repos
The repos namespace.
accept_transfer
accept_transfer(owner: str, repo: str) -> Repository
Accept a repo transfer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to transfer |
required |
repo
|
str
|
name of the repo to transfer |
required |
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
PayloadTooLargeError
|
|
Operation ID: acceptRepoTransfer
apply_diff_patch
apply_diff_patch(
owner: str,
repo: str,
*,
author: Identity | None = None,
branch: str | None = None,
committer: Identity | None = None,
content: str,
dates: CommitDateOptions | None = None,
force_overwrite_new_branch: bool | None = None,
from_path: str | None = None,
message: str | None = None,
new_branch: str | None = None,
sha: str,
signoff: bool | None = None,
) -> FileResponse
Apply diff patch to repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
author
|
Identity | None
|
|
None
|
branch
|
str | None
|
branch (optional) to base this file from. if not given, the default branch is used |
None
|
committer
|
Identity | None
|
|
None
|
content
|
str
|
content must be base64 encoded |
required |
dates
|
CommitDateOptions | None
|
|
None
|
force_overwrite_new_branch
|
bool | None
|
(optional) will do a force-push if the new branch already exists |
None
|
from_path
|
str | None
|
from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL |
None
|
message
|
str | None
|
message (optional) for the commit of this file. if not supplied, a default message will be used |
None
|
new_branch
|
str | None
|
new_branch (optional) will make a new branch from |
None
|
sha
|
str
|
sha is the SHA for the file that already exists |
required |
signoff
|
bool | None
|
Add a Signed-off-by trailer by the committer at the end of the commit log message. |
None
|
Returns:
| Type | Description |
|---|---|
FileResponse
|
FileResponse. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
PayloadTooLargeError
|
|
LockedError
|
|
Operation ID: repoApplyDiffPatch
assignees
assignees(owner: str, repo: str) -> list[User]
Return all users that have write access and can be assigned to issues.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
list[User]
|
UserList. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGetAssignees
compare
compare(owner: str, repo: str, basehead: str) -> Compare
Get commit comparison information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
basehead
|
str
|
compare two branches or commits |
required |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoCompareDiff
convert
convert(owner: str, repo: str) -> Repository
Convert a mirror repo to a normal repo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to convert |
required |
repo
|
str
|
name of the repo to convert |
required |
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
UnprocessableEntityError
|
|
Operation ID: repoConvert
delete
delete(owner: str, repo: str) -> None
Delete a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to delete |
required |
repo
|
str
|
name of the repo to delete |
required |
Returns:
| Type | Description |
|---|---|
None
|
No content. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
Operation ID: repoDelete
generate
generate(
template_owner: str,
template_repo: str,
*,
avatar: bool | None = None,
default_branch: str | None = None,
description: str | None = None,
git_content: bool | None = None,
git_hooks: bool | None = None,
labels: bool | None = None,
name: str,
owner: str,
private: bool | None = None,
protected_branch: bool | None = None,
topics: bool | None = None,
webhooks: bool | None = None,
) -> Repository
Create a repository using a template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_owner
|
str
|
name of the template repository owner |
required |
template_repo
|
str
|
name of the template repository |
required |
avatar
|
bool | None
|
include avatar of the template repo |
None
|
default_branch
|
str | None
|
Default branch of the new repository |
None
|
description
|
str | None
|
Description of the repository to create |
None
|
git_content
|
bool | None
|
include git content of default branch in template repo |
None
|
git_hooks
|
bool | None
|
include git hooks in template repo |
None
|
labels
|
bool | None
|
include labels in template repo |
None
|
name
|
str
|
Name of the repository to create |
required |
owner
|
str
|
The organization or person who will own the new repository |
required |
private
|
bool | None
|
Whether the repository is private |
None
|
protected_branch
|
bool | None
|
include protected branches in template repo |
None
|
topics
|
bool | None
|
include topics in template repo |
None
|
webhooks
|
bool | None
|
include webhooks in template repo |
None
|
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
ConflictError
|
|
PayloadTooLargeError
|
|
UnprocessableEntityError
|
|
Operation ID: generateRepo
get
get(owner: str, repo: str) -> Repository
Get a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGet
issue_templates
issue_templates(owner: str, repo: str) -> list[IssueTemplate]
Get available issue templates for a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
list[IssueTemplate]
|
IssueTemplates. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGetIssueTemplates
languages
languages(owner: str, repo: str) -> dict[str, int]
Get languages and number of bytes of code written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
LanguageStatistics. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGetLanguages
migrate
migrate(
*,
auth_password: str | None = None,
auth_token: str | None = None,
auth_username: str | None = None,
clone_addr: str,
description: str | None = None,
issues: bool | None = None,
labels: bool | None = None,
lfs: bool | None = None,
lfs_endpoint: str | None = None,
milestones: bool | None = None,
mirror: bool | None = None,
mirror_interval: str | None = None,
private: bool | None = None,
pull_requests: bool | None = None,
releases: bool | None = None,
repo_name: str,
repo_owner: str | None = None,
service: MigrateRepoOptionsService | None = None,
uid: int | None = None,
wiki: bool | None = None,
) -> Repository
Migrate a remote git repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth_password
|
str | None
|
|
None
|
auth_token
|
str | None
|
|
None
|
auth_username
|
str | None
|
|
None
|
clone_addr
|
str
|
|
required |
description
|
str | None
|
|
None
|
issues
|
bool | None
|
|
None
|
labels
|
bool | None
|
|
None
|
lfs
|
bool | None
|
|
None
|
lfs_endpoint
|
str | None
|
|
None
|
milestones
|
bool | None
|
|
None
|
mirror
|
bool | None
|
|
None
|
mirror_interval
|
str | None
|
|
None
|
private
|
bool | None
|
|
None
|
pull_requests
|
bool | None
|
|
None
|
releases
|
bool | None
|
|
None
|
repo_name
|
str
|
|
required |
repo_owner
|
str | None
|
Name of User or Organisation who will own Repo after migration |
None
|
service
|
MigrateRepoOptionsService | None
|
|
None
|
uid
|
int | None
|
deprecated (only for backwards compatibility) |
None
|
wiki
|
bool | None
|
|
None
|
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
ConflictError
|
|
PayloadTooLargeError
|
|
UnprocessableEntityError
|
|
Operation ID: repoMigrate
mirror_sync
mirror_sync(owner: str, repo: str) -> None
Sync a mirrored repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to sync |
required |
repo
|
str
|
name of the repo to sync |
required |
Returns:
| Type | Description |
|---|---|
None
|
No content. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
PayloadTooLargeError
|
|
Operation ID: repoMirrorSync
new_pin_allowed
new_pin_allowed(owner: str, repo: str) -> NewIssuePinsAllowed
Returns if new Issue Pins are allowed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
NewIssuePinsAllowed
|
RepoNewIssuePinsAllowed. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoNewPinAllowed
push_mirrors_sync
push_mirrors_sync(owner: str, repo: str) -> None
Sync all push mirrored repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to sync |
required |
repo
|
str
|
name of the repo to sync |
required |
Returns:
| Type | Description |
|---|---|
None
|
No content. |
Raises:
| Type | Description |
|---|---|
BadRequestError
|
|
ForbiddenError
|
|
NotFoundError
|
|
PayloadTooLargeError
|
|
Operation ID: repoPushMirrorSync
reject_transfer
reject_transfer(owner: str, repo: str) -> Repository
Reject a repo transfer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to transfer |
required |
repo
|
str
|
name of the repo to transfer |
required |
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
Operation ID: rejectRepoTransfer
reviewers
reviewers(owner: str, repo: str) -> list[User]
Return all users that can be requested to review in this repo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
list[User]
|
UserList. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGetReviewers
search
search(
*,
q: str | None = None,
topic: bool | None = None,
include_desc: bool | None = None,
uid: int | None = None,
priority_owner_id: int | None = None,
team_id: int | None = None,
starred_by: int | None = None,
private: bool | None = None,
is_private: bool | None = None,
template: bool | None = None,
archived: bool | None = None,
mode: str | None = None,
exclusive: bool | None = None,
sort: Literal["alpha", "created", "updated", "size", "git_size", "lfs_size", "id", "stars", "forks"] | None = None,
order: Literal["asc", "desc"] | None = None,
page: int | None = None,
limit: int | None = None,
) -> SearchResults
Search for repositories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
str | None
|
keyword |
None
|
topic
|
bool | None
|
Limit search to repositories with keyword as topic |
None
|
include_desc
|
bool | None
|
include search of keyword within repository description |
None
|
uid
|
int | None
|
search only for repos that the user with the given id owns or contributes to |
None
|
priority_owner_id
|
int | None
|
repo owner to prioritize in the results |
None
|
team_id
|
int | None
|
search only for repos that belong to the given team id |
None
|
starred_by
|
int | None
|
search only for repos that the user with the given id has starred |
None
|
private
|
bool | None
|
include private repositories this user has access to (defaults to true) |
None
|
is_private
|
bool | None
|
show only public, private or all repositories (defaults to all) |
None
|
template
|
bool | None
|
show only template, non-template or all repositories (defaults to all) |
None
|
archived
|
bool | None
|
show only archived, non-archived or all repositories (defaults to all) |
None
|
mode
|
str | None
|
type of repository to search for. Supported values are "fork", "source", "mirror" and "collaborative" |
None
|
exclusive
|
bool | None
|
if |
None
|
sort
|
Literal['alpha', 'created', 'updated', 'size', 'git_size', 'lfs_size', 'id', 'stars', 'forks'] | None
|
sort repos by attribute. Supported values are "alpha", "created", "updated", "size", "git_size", "lfs_size", "stars", "forks" and "id". Default is "alpha" |
None
|
order
|
Literal['asc', 'desc'] | None
|
sort order, either "asc" (ascending) or "desc" (descending). Default is "asc", ignored if "sort" is not specified. |
None
|
page
|
int | None
|
page number of results to return (1-based) |
None
|
limit
|
int | None
|
page size of results |
None
|
Returns:
| Type | Description |
|---|---|
SearchResults
|
SearchResults. |
Raises:
| Type | Description |
|---|---|
UnprocessableEntityError
|
|
Operation ID: repoSearch
signing_key_gpg
signing_key_gpg(owner: str, repo: str) -> str
Get signing-key.gpg for given repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
str
|
GPG armored public key. |
Operation ID: repoSigningKey
stargazers
stargazers(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> Paginated[User]
List a repo's stargazers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
page
|
int | None
|
1-based page to start iteration at. |
None
|
limit
|
int | None
|
Page size; the instance caps it server-side. |
None
|
Returns:
| Type | Description |
|---|---|
Paginated[User]
|
UserList. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoListStargazers
subscribers
subscribers(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> Paginated[User]
List a repo's watchers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
page
|
int | None
|
1-based page to start iteration at. |
None
|
limit
|
int | None
|
Page size; the instance caps it server-side. |
None
|
Returns:
| Type | Description |
|---|---|
Paginated[User]
|
UserList. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoListSubscribers
transfer
transfer(owner: str, repo: str, *, new_owner: str, team_ids: list[int] | None = None) -> Repository
Transfer a repo ownership.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to transfer |
required |
repo
|
str
|
name of the repo to transfer |
required |
new_owner
|
str
|
|
required |
team_ids
|
list[int] | None
|
ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. |
None
|
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
PayloadTooLargeError
|
|
UnprocessableEntityError
|
|
Operation ID: repoTransfer
update
update(
owner: str,
repo: str,
*,
allow_fast_forward_only_merge: bool | None = None,
allow_manual_merge: bool | None = None,
allow_merge_commits: bool | None = None,
allow_rebase: bool | None = None,
allow_rebase_explicit: bool | None = None,
allow_rebase_update: bool | None = None,
allow_squash_merge: bool | None = None,
archived: bool | None = None,
autodetect_manual_merge: bool | None = None,
default_allow_maintainer_edit: bool | None = None,
default_branch: str | None = None,
default_delete_branch_after_merge: bool | None = None,
default_merge_style: str | None = None,
default_update_style: str | None = None,
description: str | None = None,
enable_prune: bool | None = None,
external_tracker: ExternalTracker | None = None,
external_wiki: ExternalWiki | None = None,
globally_editable_wiki: bool | None = None,
has_actions: bool | None = None,
has_issues: bool | None = None,
has_packages: bool | None = None,
has_projects: bool | None = None,
has_pull_requests: bool | None = None,
has_releases: bool | None = None,
has_wiki: bool | None = None,
ignore_whitespace_conflicts: bool | None = None,
internal_tracker: InternalTracker | None = None,
mirror_interval: str | None = None,
name: str | None = None,
private: bool | None = None,
template: bool | None = None,
website: str | None = None,
wiki_branch: str | None = None,
) -> Repository
Edit a repository's properties. Only fields that are set will be changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to edit |
required |
repo
|
str
|
name of the repo to edit |
required |
allow_fast_forward_only_merge
|
bool | None
|
either |
None
|
allow_manual_merge
|
bool | None
|
either |
None
|
allow_merge_commits
|
bool | None
|
either |
None
|
allow_rebase
|
bool | None
|
either |
None
|
allow_rebase_explicit
|
bool | None
|
either |
None
|
allow_rebase_update
|
bool | None
|
either |
None
|
allow_squash_merge
|
bool | None
|
either |
None
|
archived
|
bool | None
|
set to |
None
|
autodetect_manual_merge
|
bool | None
|
either |
None
|
default_allow_maintainer_edit
|
bool | None
|
set to |
None
|
default_branch
|
str | None
|
sets the default branch for this repository. |
None
|
default_delete_branch_after_merge
|
bool | None
|
set to |
None
|
default_merge_style
|
str | None
|
set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", "squash", "fast-forward-only", "manually-merged", or "rebase-update-only". |
None
|
default_update_style
|
str | None
|
set to a update style to be used by this repository: "rebase" or "merge" |
None
|
description
|
str | None
|
a short description of the repository. |
None
|
enable_prune
|
bool | None
|
enable prune - remove obsolete remote-tracking references when mirroring |
None
|
external_tracker
|
ExternalTracker | None
|
|
None
|
external_wiki
|
ExternalWiki | None
|
|
None
|
globally_editable_wiki
|
bool | None
|
set the globally editable state of the wiki |
None
|
has_actions
|
bool | None
|
either |
None
|
has_issues
|
bool | None
|
either |
None
|
has_packages
|
bool | None
|
either |
None
|
has_projects
|
bool | None
|
either |
None
|
has_pull_requests
|
bool | None
|
either |
None
|
has_releases
|
bool | None
|
either |
None
|
has_wiki
|
bool | None
|
either |
None
|
ignore_whitespace_conflicts
|
bool | None
|
either |
None
|
internal_tracker
|
InternalTracker | None
|
|
None
|
mirror_interval
|
str | None
|
set to a string like |
None
|
name
|
str | None
|
name of the repository |
None
|
private
|
bool | None
|
either |
None
|
template
|
bool | None
|
either |
None
|
website
|
str | None
|
a URL with more information about the repository. |
None
|
wiki_branch
|
str | None
|
sets the branch used for this repository's wiki. |
None
|
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
UnprocessableEntityError
|
|
Operation ID: repoEdit
AsyncRepos
The repos namespace.
branch_protections
branch_protections: AsyncReposBranchProtections = AsyncReposBranchProtections(client)
accept_transfer
accept_transfer(owner: str, repo: str) -> Repository
Accept a repo transfer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to transfer |
required |
repo
|
str
|
name of the repo to transfer |
required |
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
PayloadTooLargeError
|
|
Operation ID: acceptRepoTransfer
apply_diff_patch
apply_diff_patch(
owner: str,
repo: str,
*,
author: Identity | None = None,
branch: str | None = None,
committer: Identity | None = None,
content: str,
dates: CommitDateOptions | None = None,
force_overwrite_new_branch: bool | None = None,
from_path: str | None = None,
message: str | None = None,
new_branch: str | None = None,
sha: str,
signoff: bool | None = None,
) -> FileResponse
Apply diff patch to repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
author
|
Identity | None
|
|
None
|
branch
|
str | None
|
branch (optional) to base this file from. if not given, the default branch is used |
None
|
committer
|
Identity | None
|
|
None
|
content
|
str
|
content must be base64 encoded |
required |
dates
|
CommitDateOptions | None
|
|
None
|
force_overwrite_new_branch
|
bool | None
|
(optional) will do a force-push if the new branch already exists |
None
|
from_path
|
str | None
|
from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL |
None
|
message
|
str | None
|
message (optional) for the commit of this file. if not supplied, a default message will be used |
None
|
new_branch
|
str | None
|
new_branch (optional) will make a new branch from |
None
|
sha
|
str
|
sha is the SHA for the file that already exists |
required |
signoff
|
bool | None
|
Add a Signed-off-by trailer by the committer at the end of the commit log message. |
None
|
Returns:
| Type | Description |
|---|---|
FileResponse
|
FileResponse. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
PayloadTooLargeError
|
|
LockedError
|
|
Operation ID: repoApplyDiffPatch
assignees
assignees(owner: str, repo: str) -> list[User]
Return all users that have write access and can be assigned to issues.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
list[User]
|
UserList. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGetAssignees
compare
compare(owner: str, repo: str, basehead: str) -> Compare
Get commit comparison information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
basehead
|
str
|
compare two branches or commits |
required |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoCompareDiff
convert
convert(owner: str, repo: str) -> Repository
Convert a mirror repo to a normal repo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to convert |
required |
repo
|
str
|
name of the repo to convert |
required |
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
UnprocessableEntityError
|
|
Operation ID: repoConvert
delete
delete(owner: str, repo: str) -> None
Delete a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to delete |
required |
repo
|
str
|
name of the repo to delete |
required |
Returns:
| Type | Description |
|---|---|
None
|
No content. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
Operation ID: repoDelete
generate
generate(
template_owner: str,
template_repo: str,
*,
avatar: bool | None = None,
default_branch: str | None = None,
description: str | None = None,
git_content: bool | None = None,
git_hooks: bool | None = None,
labels: bool | None = None,
name: str,
owner: str,
private: bool | None = None,
protected_branch: bool | None = None,
topics: bool | None = None,
webhooks: bool | None = None,
) -> Repository
Create a repository using a template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_owner
|
str
|
name of the template repository owner |
required |
template_repo
|
str
|
name of the template repository |
required |
avatar
|
bool | None
|
include avatar of the template repo |
None
|
default_branch
|
str | None
|
Default branch of the new repository |
None
|
description
|
str | None
|
Description of the repository to create |
None
|
git_content
|
bool | None
|
include git content of default branch in template repo |
None
|
git_hooks
|
bool | None
|
include git hooks in template repo |
None
|
labels
|
bool | None
|
include labels in template repo |
None
|
name
|
str
|
Name of the repository to create |
required |
owner
|
str
|
The organization or person who will own the new repository |
required |
private
|
bool | None
|
Whether the repository is private |
None
|
protected_branch
|
bool | None
|
include protected branches in template repo |
None
|
topics
|
bool | None
|
include topics in template repo |
None
|
webhooks
|
bool | None
|
include webhooks in template repo |
None
|
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
ConflictError
|
|
PayloadTooLargeError
|
|
UnprocessableEntityError
|
|
Operation ID: generateRepo
get
get(owner: str, repo: str) -> Repository
Get a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGet
issue_templates
issue_templates(owner: str, repo: str) -> list[IssueTemplate]
Get available issue templates for a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
list[IssueTemplate]
|
IssueTemplates. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGetIssueTemplates
languages
languages(owner: str, repo: str) -> dict[str, int]
Get languages and number of bytes of code written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
LanguageStatistics. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGetLanguages
migrate
migrate(
*,
auth_password: str | None = None,
auth_token: str | None = None,
auth_username: str | None = None,
clone_addr: str,
description: str | None = None,
issues: bool | None = None,
labels: bool | None = None,
lfs: bool | None = None,
lfs_endpoint: str | None = None,
milestones: bool | None = None,
mirror: bool | None = None,
mirror_interval: str | None = None,
private: bool | None = None,
pull_requests: bool | None = None,
releases: bool | None = None,
repo_name: str,
repo_owner: str | None = None,
service: MigrateRepoOptionsService | None = None,
uid: int | None = None,
wiki: bool | None = None,
) -> Repository
Migrate a remote git repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth_password
|
str | None
|
|
None
|
auth_token
|
str | None
|
|
None
|
auth_username
|
str | None
|
|
None
|
clone_addr
|
str
|
|
required |
description
|
str | None
|
|
None
|
issues
|
bool | None
|
|
None
|
labels
|
bool | None
|
|
None
|
lfs
|
bool | None
|
|
None
|
lfs_endpoint
|
str | None
|
|
None
|
milestones
|
bool | None
|
|
None
|
mirror
|
bool | None
|
|
None
|
mirror_interval
|
str | None
|
|
None
|
private
|
bool | None
|
|
None
|
pull_requests
|
bool | None
|
|
None
|
releases
|
bool | None
|
|
None
|
repo_name
|
str
|
|
required |
repo_owner
|
str | None
|
Name of User or Organisation who will own Repo after migration |
None
|
service
|
MigrateRepoOptionsService | None
|
|
None
|
uid
|
int | None
|
deprecated (only for backwards compatibility) |
None
|
wiki
|
bool | None
|
|
None
|
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
ConflictError
|
|
PayloadTooLargeError
|
|
UnprocessableEntityError
|
|
Operation ID: repoMigrate
mirror_sync
mirror_sync(owner: str, repo: str) -> None
Sync a mirrored repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to sync |
required |
repo
|
str
|
name of the repo to sync |
required |
Returns:
| Type | Description |
|---|---|
None
|
No content. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
PayloadTooLargeError
|
|
Operation ID: repoMirrorSync
new_pin_allowed
new_pin_allowed(owner: str, repo: str) -> NewIssuePinsAllowed
Returns if new Issue Pins are allowed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
NewIssuePinsAllowed
|
RepoNewIssuePinsAllowed. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoNewPinAllowed
push_mirrors_sync
push_mirrors_sync(owner: str, repo: str) -> None
Sync all push mirrored repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to sync |
required |
repo
|
str
|
name of the repo to sync |
required |
Returns:
| Type | Description |
|---|---|
None
|
No content. |
Raises:
| Type | Description |
|---|---|
BadRequestError
|
|
ForbiddenError
|
|
NotFoundError
|
|
PayloadTooLargeError
|
|
Operation ID: repoPushMirrorSync
reject_transfer
reject_transfer(owner: str, repo: str) -> Repository
Reject a repo transfer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to transfer |
required |
repo
|
str
|
name of the repo to transfer |
required |
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
Operation ID: rejectRepoTransfer
reviewers
reviewers(owner: str, repo: str) -> list[User]
Return all users that can be requested to review in this repo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
list[User]
|
UserList. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoGetReviewers
search
search(
*,
q: str | None = None,
topic: bool | None = None,
include_desc: bool | None = None,
uid: int | None = None,
priority_owner_id: int | None = None,
team_id: int | None = None,
starred_by: int | None = None,
private: bool | None = None,
is_private: bool | None = None,
template: bool | None = None,
archived: bool | None = None,
mode: str | None = None,
exclusive: bool | None = None,
sort: Literal["alpha", "created", "updated", "size", "git_size", "lfs_size", "id", "stars", "forks"] | None = None,
order: Literal["asc", "desc"] | None = None,
page: int | None = None,
limit: int | None = None,
) -> SearchResults
Search for repositories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
str | None
|
keyword |
None
|
topic
|
bool | None
|
Limit search to repositories with keyword as topic |
None
|
include_desc
|
bool | None
|
include search of keyword within repository description |
None
|
uid
|
int | None
|
search only for repos that the user with the given id owns or contributes to |
None
|
priority_owner_id
|
int | None
|
repo owner to prioritize in the results |
None
|
team_id
|
int | None
|
search only for repos that belong to the given team id |
None
|
starred_by
|
int | None
|
search only for repos that the user with the given id has starred |
None
|
private
|
bool | None
|
include private repositories this user has access to (defaults to true) |
None
|
is_private
|
bool | None
|
show only public, private or all repositories (defaults to all) |
None
|
template
|
bool | None
|
show only template, non-template or all repositories (defaults to all) |
None
|
archived
|
bool | None
|
show only archived, non-archived or all repositories (defaults to all) |
None
|
mode
|
str | None
|
type of repository to search for. Supported values are "fork", "source", "mirror" and "collaborative" |
None
|
exclusive
|
bool | None
|
if |
None
|
sort
|
Literal['alpha', 'created', 'updated', 'size', 'git_size', 'lfs_size', 'id', 'stars', 'forks'] | None
|
sort repos by attribute. Supported values are "alpha", "created", "updated", "size", "git_size", "lfs_size", "stars", "forks" and "id". Default is "alpha" |
None
|
order
|
Literal['asc', 'desc'] | None
|
sort order, either "asc" (ascending) or "desc" (descending). Default is "asc", ignored if "sort" is not specified. |
None
|
page
|
int | None
|
page number of results to return (1-based) |
None
|
limit
|
int | None
|
page size of results |
None
|
Returns:
| Type | Description |
|---|---|
SearchResults
|
SearchResults. |
Raises:
| Type | Description |
|---|---|
UnprocessableEntityError
|
|
Operation ID: repoSearch
signing_key_gpg
signing_key_gpg(owner: str, repo: str) -> str
Get signing-key.gpg for given repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
Returns:
| Type | Description |
|---|---|
str
|
GPG armored public key. |
Operation ID: repoSigningKey
stargazers
stargazers(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[User]
List a repo's stargazers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
page
|
int | None
|
1-based page to start iteration at. |
None
|
limit
|
int | None
|
Page size; the instance caps it server-side. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncPaginated[User]
|
UserList. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoListStargazers
subscribers
subscribers(owner: str, repo: str, *, page: int | None = None, limit: int | None = None) -> AsyncPaginated[User]
List a repo's watchers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo |
required |
repo
|
str
|
name of the repo |
required |
page
|
int | None
|
1-based page to start iteration at. |
None
|
limit
|
int | None
|
Page size; the instance caps it server-side. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncPaginated[User]
|
UserList. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
|
Operation ID: repoListSubscribers
transfer
transfer(owner: str, repo: str, *, new_owner: str, team_ids: list[int] | None = None) -> Repository
Transfer a repo ownership.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to transfer |
required |
repo
|
str
|
name of the repo to transfer |
required |
new_owner
|
str
|
|
required |
team_ids
|
list[int] | None
|
ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. |
None
|
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
PayloadTooLargeError
|
|
UnprocessableEntityError
|
|
Operation ID: repoTransfer
update
update(
owner: str,
repo: str,
*,
allow_fast_forward_only_merge: bool | None = None,
allow_manual_merge: bool | None = None,
allow_merge_commits: bool | None = None,
allow_rebase: bool | None = None,
allow_rebase_explicit: bool | None = None,
allow_rebase_update: bool | None = None,
allow_squash_merge: bool | None = None,
archived: bool | None = None,
autodetect_manual_merge: bool | None = None,
default_allow_maintainer_edit: bool | None = None,
default_branch: str | None = None,
default_delete_branch_after_merge: bool | None = None,
default_merge_style: str | None = None,
default_update_style: str | None = None,
description: str | None = None,
enable_prune: bool | None = None,
external_tracker: ExternalTracker | None = None,
external_wiki: ExternalWiki | None = None,
globally_editable_wiki: bool | None = None,
has_actions: bool | None = None,
has_issues: bool | None = None,
has_packages: bool | None = None,
has_projects: bool | None = None,
has_pull_requests: bool | None = None,
has_releases: bool | None = None,
has_wiki: bool | None = None,
ignore_whitespace_conflicts: bool | None = None,
internal_tracker: InternalTracker | None = None,
mirror_interval: str | None = None,
name: str | None = None,
private: bool | None = None,
template: bool | None = None,
website: str | None = None,
wiki_branch: str | None = None,
) -> Repository
Edit a repository's properties. Only fields that are set will be changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
owner of the repo to edit |
required |
repo
|
str
|
name of the repo to edit |
required |
allow_fast_forward_only_merge
|
bool | None
|
either |
None
|
allow_manual_merge
|
bool | None
|
either |
None
|
allow_merge_commits
|
bool | None
|
either |
None
|
allow_rebase
|
bool | None
|
either |
None
|
allow_rebase_explicit
|
bool | None
|
either |
None
|
allow_rebase_update
|
bool | None
|
either |
None
|
allow_squash_merge
|
bool | None
|
either |
None
|
archived
|
bool | None
|
set to |
None
|
autodetect_manual_merge
|
bool | None
|
either |
None
|
default_allow_maintainer_edit
|
bool | None
|
set to |
None
|
default_branch
|
str | None
|
sets the default branch for this repository. |
None
|
default_delete_branch_after_merge
|
bool | None
|
set to |
None
|
default_merge_style
|
str | None
|
set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", "squash", "fast-forward-only", "manually-merged", or "rebase-update-only". |
None
|
default_update_style
|
str | None
|
set to a update style to be used by this repository: "rebase" or "merge" |
None
|
description
|
str | None
|
a short description of the repository. |
None
|
enable_prune
|
bool | None
|
enable prune - remove obsolete remote-tracking references when mirroring |
None
|
external_tracker
|
ExternalTracker | None
|
|
None
|
external_wiki
|
ExternalWiki | None
|
|
None
|
globally_editable_wiki
|
bool | None
|
set the globally editable state of the wiki |
None
|
has_actions
|
bool | None
|
either |
None
|
has_issues
|
bool | None
|
either |
None
|
has_packages
|
bool | None
|
either |
None
|
has_projects
|
bool | None
|
either |
None
|
has_pull_requests
|
bool | None
|
either |
None
|
has_releases
|
bool | None
|
either |
None
|
has_wiki
|
bool | None
|
either |
None
|
ignore_whitespace_conflicts
|
bool | None
|
either |
None
|
internal_tracker
|
InternalTracker | None
|
|
None
|
mirror_interval
|
str | None
|
set to a string like |
None
|
name
|
str | None
|
name of the repository |
None
|
private
|
bool | None
|
either |
None
|
template
|
bool | None
|
either |
None
|
website
|
str | None
|
a URL with more information about the repository. |
None
|
wiki_branch
|
str | None
|
sets the branch used for this repository's wiki. |
None
|
Returns:
| Type | Description |
|---|---|
Repository
|
Repository. |
Raises:
| Type | Description |
|---|---|
ForbiddenError
|
|
NotFoundError
|
|
UnprocessableEntityError
|
|
Operation ID: repoEdit