mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-03 22:25:14 +00:00
- Updated NodeUsageDto to include node_uuid and changed date to datetime. - Changed total fields in subscription and subscription request history models from float to int. - Introduced response rules and conditions for subscription settings, including new models for response modifications. - Added external squads management with CRUD operations and associated models. - Implemented passkey management with registration and verification endpoints. - Enhanced snippets management with full CRUD operations and validation. - Added OAuth2 provider enum for better authentication handling.
45 lines
No EOL
1.3 KiB
Python
45 lines
No EOL
1.3 KiB
Python
from typing import Annotated
|
|
|
|
from rapid_api_client.annotations import PydanticBody
|
|
|
|
from remnawave.models import (
|
|
CreateSnippetRequestDto,
|
|
CreateSnippetResponseDto,
|
|
DeleteSnippetRequestDto,
|
|
DeleteSnippetResponseDto,
|
|
GetSnippetsResponseDto,
|
|
UpdateSnippetRequestDto,
|
|
UpdateSnippetResponseDto,
|
|
)
|
|
from remnawave.rapid import BaseController, delete, get, post, patch
|
|
|
|
|
|
class SnippetsController(BaseController):
|
|
@get("/snippets", response_class=GetSnippetsResponseDto)
|
|
async def get_snippets(self) -> GetSnippetsResponseDto:
|
|
"""Get snippets"""
|
|
...
|
|
|
|
@post("/snippets", response_class=CreateSnippetResponseDto)
|
|
async def create_snippet(
|
|
self,
|
|
body: Annotated[CreateSnippetRequestDto, PydanticBody()],
|
|
) -> CreateSnippetResponseDto:
|
|
"""Create snippet"""
|
|
...
|
|
|
|
@patch("/snippets", response_class=UpdateSnippetResponseDto)
|
|
async def update_snippet(
|
|
self,
|
|
body: Annotated[UpdateSnippetRequestDto, PydanticBody()],
|
|
) -> UpdateSnippetResponseDto:
|
|
"""Update snippet"""
|
|
...
|
|
|
|
@delete("/snippets", response_class=DeleteSnippetResponseDto)
|
|
async def delete_snippet_by_name(
|
|
self,
|
|
body: Annotated[DeleteSnippetRequestDto, PydanticBody()],
|
|
) -> DeleteSnippetResponseDto:
|
|
"""Delete snippet"""
|
|
... |