revanced-api/api/models/donations.py
Ushie d4eac5c757
feat: use objects for /socials and /donations (#51)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-05 15:45:05 -03:00

37 lines
633 B
Python

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: list[WalletFields]
links: list[LinkFields]
class DonationsResponseModel(BaseModel):
"""
A Pydantic BaseModel that represents a dictionary of donation links.
"""
donations: DonationFields