mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-03 22:25:14 +00:00
56 lines
No EOL
1.9 KiB
Python
56 lines
No EOL
1.9 KiB
Python
from typing import Annotated
|
|
|
|
from rapid_api_client import Path
|
|
|
|
from remnawave.enums import ClientType
|
|
from remnawave.models import GetSubscriptionInfoResponseDto
|
|
from remnawave.rapid import BaseController, get
|
|
|
|
|
|
class SubscriptionController(BaseController):
|
|
# Public endpoints below
|
|
@get("/sub/{shortUuid}/info", response_class=GetSubscriptionInfoResponseDto)
|
|
async def get_subscription_info_by_short_uuid(
|
|
self,
|
|
short_uuid: Annotated[str, Path(description="Short UUID of the user", alias="shortUuid")],
|
|
) -> GetSubscriptionInfoResponseDto:
|
|
"""None"""
|
|
...
|
|
|
|
@get("/sub/{shortUuid}", response_class=str)
|
|
async def get_subscription(
|
|
self,
|
|
short_uuid: Annotated[str, Path(description="Short UUID of the user", alias="shortUuid")],
|
|
) -> str:
|
|
"""None"""
|
|
...
|
|
|
|
@get("/sub/{shortUuid}/{clientType}", response_class=str)
|
|
async def get_subscription_by_client_type(
|
|
self,
|
|
client_type: Annotated[ClientType, Path(description="Client type", alias="clientType")],
|
|
short_uuid: Annotated[str, Path(description="Short UUID of the user", alias="shortUuid")],
|
|
) -> str:
|
|
"""None"""
|
|
...
|
|
|
|
@get("/sub/outline/{shortUuid}/{type}/{encodedTag}", response_class=str)
|
|
async def get_subscription_with_type(
|
|
self,
|
|
short_uuid: Annotated[str, Path(description="Short UUID of the user", alias="shortUuid")],
|
|
type: Annotated[
|
|
str,
|
|
Path(
|
|
description="Subscription type (required if encodedTag is provided). Only SS is supported for now."
|
|
),
|
|
] = "ss",
|
|
encoded_tag: Annotated[
|
|
str,
|
|
Path(
|
|
description="Base64 encoded tag for Outline config. This paramter is optional. It is required only when type=ss.",
|
|
alias="encodedTag",
|
|
),
|
|
] = "VGVzdGVy",
|
|
) -> str:
|
|
"""None"""
|
|
... |