Bases: Client
Asynchronous Gitea API client.
Initialize the asynchronous Gitea client.
Parameters:
| Name |
Type |
Description |
Default |
token
|
str | None
|
The API token for authentication.
|
None
|
base_url
|
str
|
The base URL of the Gitea instance.
|
'https://gitea.com'
|
Source code in src/gitea/client/async_gitea.py
| def __init__(self, token: str | None = None, base_url: str = "https://gitea.com") -> None:
"""Initialize the asynchronous Gitea client.
Args:
token: The API token for authentication.
base_url: The base URL of the Gitea instance.
"""
from gitea.actions.async_actions import AsyncActions # noqa: PLC0415
from gitea.comment.async_comment import AsyncComment # noqa: PLC0415
from gitea.issue.async_issue import AsyncIssue # noqa: PLC0415
from gitea.label.async_label import AsyncLabel # noqa: PLC0415
from gitea.milestone.async_milestone import AsyncMilestone # noqa: PLC0415
from gitea.notification.async_notification import AsyncNotification # noqa: PLC0415
from gitea.organization.async_organization import AsyncOrganization # noqa: PLC0415
from gitea.project.async_project import AsyncProject # noqa: PLC0415
from gitea.pull_request.async_pull_request import AsyncPullRequest # noqa: PLC0415
from gitea.repository import AsyncRepository # noqa: PLC0415
from gitea.user.async_user import AsyncUser # noqa: PLC0415
super().__init__(token=token, base_url=base_url)
self.session: ClientSession | None = None
# Resource handlers
self.actions = AsyncActions(client=self)
self.issue = AsyncIssue(client=self)
self.pull_request = AsyncPullRequest(client=self)
self.repository = AsyncRepository(client=self)
self.user = AsyncUser(client=self)
self.comment = AsyncComment(client=self)
self.label = AsyncLabel(client=self)
self.milestone = AsyncMilestone(client=self)
self.notification = AsyncNotification(client=self)
self.project = AsyncProject(client=self)
self.organization = AsyncOrganization(client=self)
|