Remnawave_python-sdk/remnawave_api/controllers/hwid.py

38 lines
No EOL
1.1 KiB
Python

from typing import Annotated
from uuid import UUID
from rapid_api_client import PydanticBody
from remnawave_api.models import (
HWIDUserResponseDto,
HWIDUserResponseDtoList,
CreateHWIDUser,
HWIDDeleteRequest
)
from remnawave_api.rapid import AttributeBody, BaseController, post
class HWIDUserController(BaseController):
@post("/hwid/devices", response_class=HWIDUserResponseDtoList)
async def add_hwid_to_users(
self,
body: Annotated[CreateHWIDUser, PydanticBody()],
) -> HWIDUserResponseDtoList:
"""Create a user HWID device"""
...
@post("/hwid/devices/delete", response_class=HWIDUserResponseDtoList)
async def delete_hwid_to_user(
self,
body: Annotated[HWIDDeleteRequest, PydanticBody()],
) -> HWIDUserResponseDtoList:
"""Delete a user HWID device"""
...
@post("/hwid/devices/{uuid}", response_class=HWIDUserResponseDto)
async def get_hwid_user(
self,
uuid: Annotated[UUID, AttributeBody()],
) -> HWIDUserResponseDto:
"""Get a user HWID device"""
...