Skip to content

gitea.organization

organization

Organization package.

Classes

gitea.organization.AsyncOrganization

AsyncOrganization(client: AsyncClientProtocol)

Bases: AsyncResource, BaseOrganization

Asynchronous Gitea Organization resource.

Source code in src/gitea/resource/async_resource.py
def __init__(self, client: AsyncClientProtocol) -> None:
    """Initialize the Resource with a AsyncGitea client.

    Args:
        client: An instance of the AsyncGitea client.

    """
    self.client = client
Methods:
gitea.organization.AsyncOrganization.list_organizations async
list_organizations(
    username: str | None = None,
    page: int | None = None,
    limit: int | None = None,
    **kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]

List the organizations of an account, or of the authenticated account.

Parameters:

Name Type Description Default
username str | None

The account whose organizations are listed.

None
page int | None

The page number for pagination.

None
limit int | None

The number of organizations per page.

None
**kwargs Any

Additional arguments to pass to the request.

{}

Returns:

Type Description
tuple[list[dict[str, Any]], dict[str, Any]]

A tuple containing a list of organizations and the status code.

Source code in src/gitea/organization/async_organization.py
async def list_organizations(
    self,
    username: str | None = None,
    page: int | None = None,
    limit: int | None = None,
    **kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]:
    """List the organizations of an account, or of the authenticated account.

    Args:
        username: The account whose organizations are listed.
        page: The page number for pagination.
        limit: The number of organizations per page.
        **kwargs: Additional arguments to pass to the request.

    Returns:
        A tuple containing a list of organizations and the status code.

    """
    response = await self._list_organizations(
        username=username,
        page=page,
        limit=limit,
        **kwargs,
    )
    data, status_code = await process_async_response(response=response, default=[])
    return cast(list[dict[str, Any]], data), {"status_code": status_code}

gitea.organization.Organization

Organization(client: ClientProtocol)

Bases: Resource, BaseOrganization

Gitea Organization resource.

Source code in src/gitea/resource/resource.py
def __init__(self, client: ClientProtocol) -> None:
    """Initialize the Resource with a Gitea client.

    Args:
        client: An instance of the Gitea client.

    """
    self.client = client
Methods:
gitea.organization.Organization.list_organizations
list_organizations(
    username: str | None = None,
    page: int | None = None,
    limit: int | None = None,
    **kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]

List the organizations of an account, or of the authenticated account.

Parameters:

Name Type Description Default
username str | None

The account whose organizations are listed.

None
page int | None

The page number for pagination.

None
limit int | None

The number of organizations per page.

None
**kwargs Any

Additional arguments to pass to the request.

{}

Returns:

Type Description
tuple[list[dict[str, Any]], dict[str, Any]]

A tuple containing a list of organizations and the status code.

Source code in src/gitea/organization/organization.py
def list_organizations(
    self,
    username: str | None = None,
    page: int | None = None,
    limit: int | None = None,
    **kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]:
    """List the organizations of an account, or of the authenticated account.

    Args:
        username: The account whose organizations are listed.
        page: The page number for pagination.
        limit: The number of organizations per page.
        **kwargs: Additional arguments to pass to the request.

    Returns:
        A tuple containing a list of organizations and the status code.

    """
    response = self._list_organizations(
        username=username,
        page=page,
        limit=limit,
        **kwargs,
    )
    data, status_code = process_response(response=response, default=[])
    return cast(list[dict[str, Any]], data), {"status_code": status_code}

Functions:

Modules