mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-05-13 12:16:42 +00:00
- Implemented models for nodes usage history including NodeInfoDto, GetUserAccessibleNodesResponse, and usage statistics. - Created subscription-related models such as UserSubscription, SubscriptionInfoData, and various response DTOs for subscription information. - Developed models for subscription settings, templates, and system statistics, enhancing the API's capability to manage and retrieve subscription configurations. - Introduced user management models including CreateUserRequestDto, UpdateUserRequestDto, and various response DTOs for user actions. - Added bulk actions for user updates and statistics tracking, improving the efficiency of user management operations. - Established a base controller for handling API requests and responses, along with decorators for HTTP methods to streamline API interactions. - Included utility functions for serialization using orjson for better performance with Pydantic models.
30 lines
922 B
Python
30 lines
922 B
Python
from typing import Annotated
|
|
|
|
from rapid_api_client.annotations import PydanticBody
|
|
|
|
from remnawave.models import (
|
|
GetSubscriptionSettingsResponseDto,
|
|
UpdateSubscriptionSettingsRequestDto,
|
|
UpdateSubscriptionSettingsResponseDto,
|
|
)
|
|
from remnawave.rapid import BaseController, get, patch
|
|
|
|
|
|
class SubscriptionsSettingsController(BaseController):
|
|
@get("/subscription-settings", response_class=GetSubscriptionSettingsResponseDto)
|
|
async def get_settings(
|
|
self,
|
|
) -> GetSubscriptionSettingsResponseDto:
|
|
"""Get Subscription Settings"""
|
|
...
|
|
|
|
@patch(
|
|
"/subscription-settings",
|
|
response_class=UpdateSubscriptionSettingsResponseDto,
|
|
)
|
|
async def update_settings(
|
|
self,
|
|
body: Annotated[UpdateSubscriptionSettingsRequestDto, PydanticBody()],
|
|
) -> UpdateSubscriptionSettingsResponseDto:
|
|
"""Update Subscription Settings"""
|
|
...
|