From 15cfb16c6745a082c0de5256dc86a093d6faeb84 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 24 Apr 2025 19:46:48 +0200 Subject: [PATCH] feat: Update README and pyproject.toml for version 1.0.4; enhance UsersController with pagination support --- README.md | 1 + pyproject.toml | 2 +- remnawave_api/controllers/users.py | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 451cce1..b581661 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ pip install git+https://github.com/sm1ky/remnawave-api.git ### Dependencies - `orjson` (>=3.10.15, <4.0.0) - `rapid-api-client` (==0.6.0) +- `httpx` (>=0.27.2, <0.28.0) ## 🚀 Usage diff --git a/pyproject.toml b/pyproject.toml index 37bd004..46ae223 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "remnawave-api" -version = "1.0.3" +version = "1.0.4" description = "A Python SDK for interacting with the Remnawave API." authors = [ {name = "Artem",email = "sm1ky@forestsnet.com"} diff --git a/remnawave_api/controllers/users.py b/remnawave_api/controllers/users.py index 2868ab2..5c66214 100644 --- a/remnawave_api/controllers/users.py +++ b/remnawave_api/controllers/users.py @@ -1,6 +1,6 @@ from typing import Annotated -from rapid_api_client import Path +from rapid_api_client import Path, Query from rapid_api_client.annotations import PydanticBody from remnawave_api.models import ( @@ -35,8 +35,19 @@ class UsersController(BaseController): @get("/users/v2", response_class=UsersResponseDto) async def get_all_users_v2( self, + size: Annotated[int, Query(100, description="Size of the page")], + start: Annotated[int, Query(0, description="Start index of the page")], ) -> UsersResponseDto: - """Get All Users""" + """ + Get a paginated list of users. + + Args: + size (int): Number of users per page. + start (int): Index to start pagination from. + + Returns: + UsersResponseDto: Paginated users list. + """ ... @patch("/users/revoke/{uuid}", response_class=UserResponseDto)