mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-27 03:42:04 +00:00
feat: добавить поддержку версий в генерации Happ Crypto Link
This commit is contained in:
parent
8979e2a588
commit
e429a51c89
1 changed files with 8 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from datetime import datetime
|
||||
from typing import Annotated, List, Optional
|
||||
from typing import Annotated, List, Literal, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import (
|
||||
|
|
@ -177,6 +177,13 @@ class UserResponseDto(BaseModel):
|
|||
"""Generate Happ Crypto Link"""
|
||||
crypto_link = create_happ_crypto_link(self.subscription_url)
|
||||
return HappCrypto(cryptoLink=crypto_link)
|
||||
|
||||
def happ_with_version(self, version: Literal["v3", "v4"] = "v4") -> HappCrypto:
|
||||
return self._generate_happ(version=version)
|
||||
|
||||
def _generate_happ(self, version):
|
||||
crypto_link = create_happ_crypto_link(content=self.subscription_url, method=version)
|
||||
return HappCrypto(cryptoLink=crypto_link)
|
||||
|
||||
|
||||
class RevokeUserRequestDto(BaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue