gitea.label
label
Gitea Label resource.
Classes
gitea.label.AsyncLabel
Bases: BaseLabel, AsyncResource
Asynchronous Gitea Label resource.
Source code in src/gitea/resource/async_resource.py
Methods:
gitea.label.AsyncLabel.list_labels
async
list_labels(
owner: str,
repository: str,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List labels in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of labels 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 labels as dictionaries and a dictionary with metadata. |
Source code in src/gitea/label/async_label.py
gitea.label.AsyncLabel.create_label
async
create_label(
owner: str,
repository: str,
name: str,
color: str,
description: str | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Create a label in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
name
|
str
|
The name of the label. |
required |
color
|
str
|
The color of the label in hexadecimal format (e.g. |
required |
description
|
str | None
|
The description of the label. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the created label as a dictionary and a dictionary with metadata. |
Source code in src/gitea/label/async_label.py
gitea.label.AsyncLabel.edit_label
async
edit_label(
owner: str,
repository: str,
label_id: int,
name: str | None = None,
color: str | None = None,
description: str | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Edit a label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
label_id
|
int
|
The ID of the label. |
required |
name
|
str | None
|
The new name of the label. |
None
|
color
|
str | None
|
The new color of the label in hexadecimal format. |
None
|
description
|
str | None
|
The new description of the label. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the updated label as a dictionary and a dictionary with metadata. |
Source code in src/gitea/label/async_label.py
gitea.label.AsyncLabel.delete_label
async
delete_label(
owner: str,
repository: str,
label_id: int,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Delete a label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
label_id
|
int
|
The ID of the label. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing an empty dictionary and a dictionary with metadata. |
Source code in src/gitea/label/async_label.py
gitea.label.Label
Gitea Label resource.
Source code in src/gitea/resource/resource.py
Methods:
gitea.label.Label.list_labels
list_labels(
owner: str,
repository: str,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List labels in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of labels 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 labels as dictionaries and a dictionary with metadata. |
Source code in src/gitea/label/label.py
gitea.label.Label.create_label
create_label(
owner: str,
repository: str,
name: str,
color: str,
description: str | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Create a label in a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
name
|
str
|
The name of the label. |
required |
color
|
str
|
The color of the label in hexadecimal format (e.g. |
required |
description
|
str | None
|
The description of the label. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the created label as a dictionary and a dictionary with metadata. |
Source code in src/gitea/label/label.py
gitea.label.Label.edit_label
edit_label(
owner: str,
repository: str,
label_id: int,
name: str | None = None,
color: str | None = None,
description: str | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Edit a label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
label_id
|
int
|
The ID of the label. |
required |
name
|
str | None
|
The new name of the label. |
None
|
color
|
str | None
|
The new color of the label in hexadecimal format. |
None
|
description
|
str | None
|
The new description of the label. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the updated label as a dictionary and a dictionary with metadata. |
Source code in src/gitea/label/label.py
gitea.label.Label.delete_label
delete_label(
owner: str,
repository: str,
label_id: int,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Delete a label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
label_id
|
int
|
The ID of the label. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing an empty dictionary and a dictionary with metadata. |