gitea.notification
notification
Gitea Notification resource.
Classes
gitea.notification.AsyncNotification
Bases: BaseNotification, AsyncResource
Asynchronous Gitea Notification resource.
Source code in src/gitea/resource/async_resource.py
Methods:
gitea.notification.AsyncNotification.list_notifications
async
list_notifications(
all_notifications: bool | None = None,
status_types: list[str] | None = None,
subject_type: list[str] | None = None,
since: datetime | None = None,
before: datetime | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List the authenticated user's notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_notifications
|
bool | None
|
If true, show notifications marked as read. |
None
|
status_types
|
list[str] | None
|
Show notifications with the provided status types. |
None
|
subject_type
|
list[str] | None
|
Filter notifications by subject type. |
None
|
since
|
datetime | None
|
Only show notifications updated after the given time. |
None
|
before
|
datetime | None
|
Only show notifications updated before the given time. |
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of notifications 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 notifications as dictionaries and a dictionary with metadata. |
Source code in src/gitea/notification/async_notification.py
gitea.notification.AsyncNotification.list_repo_notifications
async
list_repo_notifications(
owner: str,
repository: str,
all_notifications: bool | None = None,
status_types: list[str] | None = None,
subject_type: list[str] | None = None,
since: datetime | None = None,
before: datetime | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List a repository's notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
all_notifications
|
bool | None
|
If true, show notifications marked as read. |
None
|
status_types
|
list[str] | None
|
Show notifications with the provided status types. |
None
|
subject_type
|
list[str] | None
|
Filter notifications by subject type. |
None
|
since
|
datetime | None
|
Only show notifications updated after the given time. |
None
|
before
|
datetime | None
|
Only show notifications updated before the given time. |
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of notifications 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 notifications as dictionaries and a dictionary with metadata. |
Source code in src/gitea/notification/async_notification.py
gitea.notification.AsyncNotification.read_notifications
async
read_notifications(
last_read_at: datetime | None = None,
all_notifications: bool | None = None,
status_types: list[str] | None = None,
to_status: str | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
Mark notifications as read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
last_read_at
|
datetime | None
|
Describes the last point that notifications were checked. |
None
|
all_notifications
|
bool | None
|
If true, mark all notifications on this repo. |
None
|
status_types
|
list[str] | None
|
Mark notifications with the provided status types as read. |
None
|
to_status
|
str | None
|
Status to mark notifications as. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[list[dict[str, Any]], dict[str, Any]]
|
A tuple containing the changed notification threads as a list of dictionaries and a dictionary with metadata. |
Source code in src/gitea/notification/async_notification.py
gitea.notification.AsyncNotification.read_repo_notifications
async
read_repo_notifications(
owner: str,
repository: str,
last_read_at: datetime | None = None,
all_notifications: bool | None = None,
status_types: list[str] | None = None,
to_status: str | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
Mark a repository's notifications as read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
last_read_at
|
datetime | None
|
Describes the last point that notifications were checked. |
None
|
all_notifications
|
bool | None
|
If true, mark all notifications on this repo. |
None
|
status_types
|
list[str] | None
|
Mark notifications with the provided status types as read. |
None
|
to_status
|
str | None
|
Status to mark notifications as. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[list[dict[str, Any]], dict[str, Any]]
|
A tuple containing the changed notification threads as a list of dictionaries and a dictionary with metadata. |
Source code in src/gitea/notification/async_notification.py
gitea.notification.AsyncNotification.get_notification_thread
async
Get a notification thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thread_id
|
int
|
The ID of the notification thread. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the notification thread as a dictionary and a dictionary with metadata. |
Source code in src/gitea/notification/async_notification.py
gitea.notification.AsyncNotification.read_notification_thread
async
read_notification_thread(
thread_id: int,
to_status: str | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Mark a notification thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thread_id
|
int
|
The ID of the notification thread. |
required |
to_status
|
str | None
|
Status to mark notifications as. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the notification thread as a dictionary and a dictionary with metadata. |
Source code in src/gitea/notification/async_notification.py
gitea.notification.AsyncNotification.new_notifications
async
Count new notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the new notification count as a dictionary and a dictionary with metadata. |
Source code in src/gitea/notification/async_notification.py
gitea.notification.Notification
Bases: BaseNotification, Resource
Gitea Notification resource.
Source code in src/gitea/resource/resource.py
Methods:
gitea.notification.Notification.list_notifications
list_notifications(
all_notifications: bool | None = None,
status_types: list[str] | None = None,
subject_type: list[str] | None = None,
since: datetime | None = None,
before: datetime | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List the authenticated user's notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_notifications
|
bool | None
|
If true, show notifications marked as read. |
None
|
status_types
|
list[str] | None
|
Show notifications with the provided status types. |
None
|
subject_type
|
list[str] | None
|
Filter notifications by subject type. |
None
|
since
|
datetime | None
|
Only show notifications updated after the given time. |
None
|
before
|
datetime | None
|
Only show notifications updated before the given time. |
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of notifications 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 notifications as dictionaries and a dictionary with metadata. |
Source code in src/gitea/notification/notification.py
gitea.notification.Notification.list_repo_notifications
list_repo_notifications(
owner: str,
repository: str,
all_notifications: bool | None = None,
status_types: list[str] | None = None,
subject_type: list[str] | None = None,
since: datetime | None = None,
before: datetime | None = None,
page: int | None = None,
limit: int | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
List a repository's notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
all_notifications
|
bool | None
|
If true, show notifications marked as read. |
None
|
status_types
|
list[str] | None
|
Show notifications with the provided status types. |
None
|
subject_type
|
list[str] | None
|
Filter notifications by subject type. |
None
|
since
|
datetime | None
|
Only show notifications updated after the given time. |
None
|
before
|
datetime | None
|
Only show notifications updated before the given time. |
None
|
page
|
int | None
|
The page number for pagination. |
None
|
limit
|
int | None
|
The number of notifications 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 notifications as dictionaries and a dictionary with metadata. |
Source code in src/gitea/notification/notification.py
gitea.notification.Notification.read_notifications
read_notifications(
last_read_at: datetime | None = None,
all_notifications: bool | None = None,
status_types: list[str] | None = None,
to_status: str | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
Mark notifications as read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
last_read_at
|
datetime | None
|
Describes the last point that notifications were checked. |
None
|
all_notifications
|
bool | None
|
If true, mark all notifications on this repo. |
None
|
status_types
|
list[str] | None
|
Mark notifications with the provided status types as read. |
None
|
to_status
|
str | None
|
Status to mark notifications as. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[list[dict[str, Any]], dict[str, Any]]
|
A tuple containing the changed notification threads as a list of dictionaries and a dictionary with metadata. |
Source code in src/gitea/notification/notification.py
gitea.notification.Notification.read_repo_notifications
read_repo_notifications(
owner: str,
repository: str,
last_read_at: datetime | None = None,
all_notifications: bool | None = None,
status_types: list[str] | None = None,
to_status: str | None = None,
**kwargs: Any,
) -> tuple[list[dict[str, Any]], dict[str, Any]]
Mark a repository's notifications as read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
owner
|
str
|
The owner of the repository. |
required |
repository
|
str
|
The name of the repository. |
required |
last_read_at
|
datetime | None
|
Describes the last point that notifications were checked. |
None
|
all_notifications
|
bool | None
|
If true, mark all notifications on this repo. |
None
|
status_types
|
list[str] | None
|
Mark notifications with the provided status types as read. |
None
|
to_status
|
str | None
|
Status to mark notifications as. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[list[dict[str, Any]], dict[str, Any]]
|
A tuple containing the changed notification threads as a list of dictionaries and a dictionary with metadata. |
Source code in src/gitea/notification/notification.py
gitea.notification.Notification.get_notification_thread
Get a notification thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thread_id
|
int
|
The ID of the notification thread. |
required |
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the notification thread as a dictionary and a dictionary with metadata. |
Source code in src/gitea/notification/notification.py
gitea.notification.Notification.read_notification_thread
read_notification_thread(
thread_id: int,
to_status: str | None = None,
**kwargs: Any,
) -> tuple[dict[str, Any], dict[str, Any]]
Mark a notification thread.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thread_id
|
int
|
The ID of the notification thread. |
required |
to_status
|
str | None
|
Status to mark notifications as. |
None
|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the notification thread as a dictionary and a dictionary with metadata. |
Source code in src/gitea/notification/notification.py
gitea.notification.Notification.new_notifications
Count new notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Any
|
Additional arguments for the request. |
{}
|
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
A tuple containing the new notification count as a dictionary and a dictionary with metadata. |