1+ from typing import Annotated
2+
3+ from rapid_api_client import Path , Query
4+
5+ from remnawave .enums import ClientType
6+ from remnawave .rapid import BaseController , get
7+ from remnawave .models import GetAllSubscriptionsResponseDto , GetSubscriptionByUsernameResponseDto , GetSubscriptionByShortUUIDResponseDto , GetSubscriptionByUUIDResponseDto
8+
9+
10+ class SubscriptionsController (BaseController ):
11+ @get ("/subscriptions" , response_class = GetAllSubscriptionsResponseDto )
12+ async def get_all_subscriptions (
13+ self ,
14+ start : Annotated [
15+ int , Query (default = 0 , ge = 0 , description = "Index to start pagination from" )
16+ ],
17+ size : Annotated [
18+ int , Query (default = 25 , ge = 1 , description = "Number of users per page" )
19+ ],
20+ ) -> GetAllSubscriptionsResponseDto :
21+ """None"""
22+ ...
23+
24+ @get ("/subscriptions/by-username/{username}" , response_class = GetSubscriptionByUsernameResponseDto )
25+ async def get_subscription_by_username (
26+ self ,
27+ username : Annotated [str , Path (description = "Username of the user" )],
28+ ) -> GetSubscriptionByUsernameResponseDto :
29+ """None"""
30+ ...
31+
32+ @get ("/subscriptions/by-short-uuid/{short_uuid}" , response_class = GetSubscriptionByShortUUIDResponseDto )
33+ async def get_subscription_by_short_uuid (
34+ self ,
35+ short_uuid : Annotated [str , Path (description = "Short UUID of the subscription" )],
36+ ) -> GetSubscriptionByShortUUIDResponseDto :
37+ """None"""
38+ ...
39+
40+ @get ("/subscriptions/by-uuid/{uuid}" , response_class = GetSubscriptionByUUIDResponseDto )
41+ async def get_subscription_by_uuid (
42+ self ,
43+ uuid : Annotated [str , Path (description = "UUID of the user" )],
44+ ) -> GetSubscriptionByUUIDResponseDto :
45+ """None"""
46+ ...
0 commit comments