Skip to content

gitea.milestone

milestone

Gitea Milestone resource.

Classes

gitea.milestone.AsyncMilestone

AsyncMilestone(client: AsyncClientProtocol)

Bases: BaseMilestone, AsyncResource

Asynchronous Gitea Milestone 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.milestone.AsyncMilestone.list_milestones async
list_milestones(
    owner: str,
    repository: str,
    state: Literal["closed", "open", "all"] | None = None,
    name: str | None = None,
    page: int | None = None,
    limit: int | None = None,
    **kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]

List milestones in a repository.

Parameters:

Name Type Description Default
owner str

The owner of the repository.

required
repository str

The name of the repository.

required
state Literal['closed', 'open', 'all'] | None

Filter milestones by state.

None
name str | None

Filter milestones by name.

None
page int | None

The page number for pagination.

None
limit int | None

The number of milestones per page.

None
**kwargs Any

Additional arguments for the request.

{}

Returns:

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

A tuple containing a list of milestones as dictionaries and a dictionary with metadata.

Source code in src/gitea/milestone/async_milestone.py
async def list_milestones(
    self,
    owner: str,
    repository: str,
    state: Literal["closed", "open", "all"] | None = None,
    name: str | None = None,
    page: int | None = None,
    limit: int | None = None,
    **kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]:
    """List milestones in a repository.

    Args:
        owner: The owner of the repository.
        repository: The name of the repository.
        state: Filter milestones by state.
        name: Filter milestones by name.
        page: The page number for pagination.
        limit: The number of milestones per page.
        **kwargs: Additional arguments for the request.

    Returns:
        A tuple containing a list of milestones as dictionaries and a dictionary with metadata.

    """
    response = await self._list_milestones(
        owner=owner,
        repository=repository,
        state=state,
        name=name,
        page=page,
        limit=limit,
        **kwargs,
    )
    data, status_code = await process_async_response(response, default=[])
    return cast(list[dict[str, Any]], data), {"status_code": status_code}
gitea.milestone.AsyncMilestone.create_milestone async
create_milestone(
    owner: str,
    repository: str,
    title: str,
    description: str | None = None,
    due_on: datetime | None = None,
    state: Literal["closed", "open"] | None = None,
    **kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]

Create a milestone in a repository.

Parameters:

Name Type Description Default
owner str

The owner of the repository.

required
repository str

The name of the repository.

required
title str

The title of the milestone.

required
description str | None

The description of the milestone.

None
due_on datetime | None

The due date of the milestone.

None
state Literal['closed', 'open'] | None

The state of the milestone.

None
**kwargs Any

Additional arguments for the request.

{}

Returns:

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

A tuple containing the created milestone as a dictionary and a dictionary with metadata.

Source code in src/gitea/milestone/async_milestone.py
async def create_milestone(
    self,
    owner: str,
    repository: str,
    title: str,
    description: str | None = None,
    due_on: datetime | None = None,
    state: Literal["closed", "open"] | None = None,
    **kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]:
    """Create a milestone in a repository.

    Args:
        owner: The owner of the repository.
        repository: The name of the repository.
        title: The title of the milestone.
        description: The description of the milestone.
        due_on: The due date of the milestone.
        state: The state of the milestone.
        **kwargs: Additional arguments for the request.

    Returns:
        A tuple containing the created milestone as a dictionary and a dictionary with metadata.

    """
    response = await self._create_milestone(
        owner=owner,
        repository=repository,
        title=title,
        description=description,
        due_on=due_on,
        state=state,
        **kwargs,
    )
    data, status_code = await process_async_response(response, default={})
    return cast(dict[str, Any], data), {"status_code": status_code}

gitea.milestone.Milestone

Milestone(client: ClientProtocol)

Bases: BaseMilestone, Resource

Gitea Milestone 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.milestone.Milestone.list_milestones
list_milestones(
    owner: str,
    repository: str,
    state: Literal["closed", "open", "all"] | None = None,
    name: str | None = None,
    page: int | None = None,
    limit: int | None = None,
    **kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]

List milestones in a repository.

Parameters:

Name Type Description Default
owner str

The owner of the repository.

required
repository str

The name of the repository.

required
state Literal['closed', 'open', 'all'] | None

Filter milestones by state.

None
name str | None

Filter milestones by name.

None
page int | None

The page number for pagination.

None
limit int | None

The number of milestones per page.

None
**kwargs Any

Additional arguments for the request.

{}

Returns:

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

A tuple containing a list of milestones as dictionaries and a dictionary with metadata.

Source code in src/gitea/milestone/milestone.py
def list_milestones(
    self,
    owner: str,
    repository: str,
    state: Literal["closed", "open", "all"] | None = None,
    name: str | None = None,
    page: int | None = None,
    limit: int | None = None,
    **kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]:
    """List milestones in a repository.

    Args:
        owner: The owner of the repository.
        repository: The name of the repository.
        state: Filter milestones by state.
        name: Filter milestones by name.
        page: The page number for pagination.
        limit: The number of milestones per page.
        **kwargs: Additional arguments for the request.

    Returns:
        A tuple containing a list of milestones as dictionaries and a dictionary with metadata.

    """
    response = self._list_milestones(
        owner=owner,
        repository=repository,
        state=state,
        name=name,
        page=page,
        limit=limit,
        **kwargs,
    )
    data, status_code = process_response(response, default=[])
    return cast(list[dict[str, Any]], data), {"status_code": status_code}
gitea.milestone.Milestone.create_milestone
create_milestone(
    owner: str,
    repository: str,
    title: str,
    description: str | None = None,
    due_on: datetime | None = None,
    state: Literal["closed", "open"] | None = None,
    **kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]

Create a milestone in a repository.

Parameters:

Name Type Description Default
owner str

The owner of the repository.

required
repository str

The name of the repository.

required
title str

The title of the milestone.

required
description str | None

The description of the milestone.

None
due_on datetime | None

The due date of the milestone.

None
state Literal['closed', 'open'] | None

The state of the milestone.

None
**kwargs Any

Additional arguments for the request.

{}

Returns:

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

A tuple containing the created milestone as a dictionary and a dictionary with metadata.

Source code in src/gitea/milestone/milestone.py
def create_milestone(
    self,
    owner: str,
    repository: str,
    title: str,
    description: str | None = None,
    due_on: datetime | None = None,
    state: Literal["closed", "open"] | None = None,
    **kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]:
    """Create a milestone in a repository.

    Args:
        owner: The owner of the repository.
        repository: The name of the repository.
        title: The title of the milestone.
        description: The description of the milestone.
        due_on: The due date of the milestone.
        state: The state of the milestone.
        **kwargs: Additional arguments for the request.

    Returns:
        A tuple containing the created milestone as a dictionary and a dictionary with metadata.

    """
    response = self._create_milestone(
        owner=owner,
        repository=repository,
        title=title,
        description=description,
        due_on=due_on,
        state=state,
        **kwargs,
    )
    data, status_code = process_response(response, default={})
    return cast(dict[str, Any], data), {"status_code": status_code}

Functions:

Modules