mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-19 01:13:56 +00:00
feat: use objects for /socials and /donations (#51)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,13 +1,31 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class WalletFields(BaseModel):
|
||||
"""
|
||||
Implements the fields for a crypto wallet.
|
||||
"""
|
||||
|
||||
name: str
|
||||
address: str
|
||||
|
||||
|
||||
class LinkFields(BaseModel):
|
||||
"""
|
||||
Implements the fields for a donation link.
|
||||
"""
|
||||
|
||||
name: str
|
||||
url: str
|
||||
|
||||
|
||||
class DonationFields(BaseModel):
|
||||
"""
|
||||
A Pydantic BaseModel that represents all the donation links and wallets.
|
||||
"""
|
||||
|
||||
wallets: dict[str, str]
|
||||
links: dict[str, str]
|
||||
wallets: list[WalletFields]
|
||||
links: list[LinkFields]
|
||||
|
||||
|
||||
class DonationsResponseModel(BaseModel):
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class SocialField(BaseModel):
|
||||
"""
|
||||
Implements the fields for a social network link.
|
||||
"""
|
||||
|
||||
name: str
|
||||
url: str
|
||||
|
||||
|
||||
class SocialsResponseModel(BaseModel):
|
||||
"""
|
||||
A Pydantic BaseModel that represents a dictionary of social links.
|
||||
"""
|
||||
|
||||
socials: dict[str, str]
|
||||
socials: list[SocialField]
|
||||
"""
|
||||
A dictionary where the keys are the names of the social networks, and
|
||||
the values are the links to the profiles or pages.
|
||||
|
||||
Reference in New Issue
Block a user