revanced-api/api/models/compat.py
Alexandre Teles (afterSt0rm) b18097e030
feat: API Fixes and Adjustments (#23)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-19 23:32:48 -03:00

50 lines
1.1 KiB
Python

from pydantic import BaseModel
from api.models.github import ContributorsFields
class ToolsResponseFields(BaseModel):
"""Implements the fields for the /tools endpoint.
Args:
BaseModel (pydantic.BaseModel): BaseModel from pydantic
"""
repository: str
version: str
timestamp: str
name: str
size: str | None = None
browser_download_url: str
content_type: str
class ToolsResponseModel(BaseModel):
"""Implements the JSON response model for the /tools endpoint.
Args:
BaseModel (pydantic.BaseModel): BaseModel from pydantic
"""
tools: list[ToolsResponseFields]
class ContributorsResponseFields(BaseModel):
"""Implements the fields for the /contributors endpoint.
Args:
BaseModel (pydantic.BaseModel): BaseModel from pydantic
"""
name: str
contributors: list[ContributorsFields]
class ContributorsResponseModel(BaseModel):
"""Implements the JSON response model for the /contributors endpoint.
Args:
BaseModel (pydantic.BaseModel): BaseModel from pydantic
"""
repositories: list[ContributorsResponseFields]