mirror of
https://github.com/revanced/revanced-releases-api.git
synced 2025-05-04 08:04:24 +02:00

* feat: resolves #5, resolves #4 (#7) * Implements client generation and management * fix announcements endpoints * change annoucements model * bump deps * sync with main * refactor: adopt some functional standards in Releases.py * feat: add new workflows * chore: remove unused files * refactor: update build badge * refactor: move files around and delete unused ones * feat: add authentication endpoints * refactor: clean up code on Clients.py controller * fix: fix the client secret update endpoint * refactor: clean up authentication code * feat: add authentication to client endpoints * chore: bump deps * feat: add admin user generation * feature: add /changelogs endpoint (#10)
51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
from pydantic import BaseModel
|
|
|
|
class InternalServerError(BaseModel):
|
|
"""Implements the response fields for when an internal server error occurs.
|
|
|
|
Args:
|
|
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
|
"""
|
|
|
|
error: str = "Internal Server Error"
|
|
message: str = "An internal server error occurred. Please try again later."
|
|
|
|
class AnnouncementNotFound(BaseModel):
|
|
"""Implements the response fields for when an item is not found.
|
|
|
|
Args:
|
|
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
|
"""
|
|
|
|
error: str = "Not Found"
|
|
message: str = "No announcement was found."
|
|
|
|
class ClientNotFound(BaseModel):
|
|
"""Implements the response fields for when a client is not found.
|
|
|
|
Args:
|
|
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
|
"""
|
|
|
|
error: str = "Not Found"
|
|
message: str = "No client matches the given ID"
|
|
|
|
class IdNotProvided(BaseModel):
|
|
"""Implements the response fields for when the id is not provided.
|
|
|
|
Args:
|
|
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
|
"""
|
|
|
|
error: str = "Bad Request"
|
|
message: str = "Missing client id"
|
|
|
|
class Unauthorized(BaseModel):
|
|
"""Implements the response fields for when the client is unauthorized.
|
|
|
|
Args:
|
|
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
|
"""
|
|
|
|
error: str = "Unauthorized"
|
|
message: str = "The client is unauthorized to access this resource" |