Remnawave_python-sdk/remnawave/controllers/subscriptions_template.py
Artem 950a7ffab3
Add Pydantic models for nodes usage history, subscriptions, and user management
- 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.
2025-07-03 12:22:16 +02:00

31 lines
950 B
Python

from typing import Annotated
from rapid_api_client.annotations import Path, PydanticBody
from remnawave.enums import TemplateType
from remnawave.models import GetTemplateResponseDto, UpdateTemplateRequestDto, UpdateTemplateResponseDto
from remnawave.rapid import BaseController, get, put
class SubscriptionsTemplateController(BaseController):
@get(
"/subscription-templates/{template_type}",
response_class=GetTemplateResponseDto,
)
async def get_template(
self,
template_type: Annotated[TemplateType, Path(description="Template type")],
) -> GetTemplateResponseDto:
"""Get Template"""
...
@put(
"/subscription-templates",
response_class=UpdateTemplateResponseDto,
)
async def update_template(
self,
body: Annotated[UpdateTemplateRequestDto, PydanticBody()],
) -> UpdateTemplateResponseDto:
"""Update Template"""
...