Remnawave_python-sdk/remnawave/controllers/subscriptions_request.py
Artem 3f0b5af2cf
Refactor tests for HWID, subscriptions, system, and users; add subscription request history functionality
- Restructured HWID tests into classes for better organization and clarity.
- Enhanced subscription tests to cover additional scenarios and improved assertions.
- Introduced new tests for system statistics and monitoring.
- Implemented CRUD operations for user management with comprehensive test coverage.
- Added new controllers and models for handling subscription request history.
- Created tests for subscription request history, including pagination and statistics.
- Improved error handling in tests to skip when exceptions occur.
2025-10-02 01:46:17 +02:00

34 lines
No EOL
1.1 KiB
Python

from typing import Annotated
from rapid_api_client import Query
from remnawave.models import (
GetAllSubscriptionRequestHistoryResponseDto,
GetSubscriptionRequestHistoryStatsResponseDto,
)
from remnawave.rapid import BaseController, get
class SubscriptionRequestHistoryController(BaseController):
@get("/subscription-request-history", response_class=GetAllSubscriptionRequestHistoryResponseDto)
async def get_all_subscription_request_history(
self,
size: Annotated[
int, Query(default=25, ge=1, description="Page size for pagination")
] = 25,
start: Annotated[
int, Query(default=0, ge=0, description="Offset for pagination")
] = 0,
) -> GetAllSubscriptionRequestHistoryResponseDto:
"""Get all subscription request history"""
...
@get(
"/subscription-request-history/stats",
response_class=GetSubscriptionRequestHistoryStatsResponseDto,
)
async def get_subscription_request_history_stats(
self,
) -> GetSubscriptionRequestHistoryStatsResponseDto:
"""Get subscription request history stats"""
...