1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-22 06:28:53 +02:00

Add 'gitea_api' module

Co-authored-by: Dan Čermák <dcermak@suse.com>
This commit is contained in:
2024-07-08 21:18:53 +02:00
parent 50a203fedb
commit 699f4d860e
12 changed files with 735 additions and 5 deletions

17
osc/gitea_api/user.py Normal file
View File

@@ -0,0 +1,17 @@
from .connection import Connection
from .connection import GiteaHTTPResponse
class User:
@classmethod
def get(
cls,
conn: Connection,
) -> GiteaHTTPResponse:
"""
Retrieve details about the current user.
:param conn: Gitea ``Connection`` instance.
"""
url = conn.makeurl("user")
return conn.request("GET", url)