mirror of
https://github.com/revanced/revanced-releases-api.git
synced 2025-06-12 20:57:37 +02:00
* feat: add cdn mirror endpoints * refactor: change API version in docs * docs: fix titles on API docs page
This commit is contained in:
@ -48,4 +48,24 @@ class Unauthorized(BaseModel):
|
||||
"""
|
||||
|
||||
error: str = "Unauthorized"
|
||||
message: str = "The client is unauthorized to access this resource"
|
||||
message: str = "The client is unauthorized to access this resource"
|
||||
|
||||
class MirrorNotFoundError(BaseModel):
|
||||
"""Implements the response fields for when a mirror is not found.
|
||||
|
||||
Args:
|
||||
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
||||
"""
|
||||
|
||||
error: str = "Not Found"
|
||||
message: str = "No mirror was found for the organization, repository, and version provided."
|
||||
|
||||
class MirrorAlreadyExistsError(BaseModel):
|
||||
"""Implements the response fields for when a mirror already exists.
|
||||
|
||||
Args:
|
||||
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
||||
"""
|
||||
|
||||
error: str = "Conflict"
|
||||
message: str = "A mirror already exists for the organization, repository, and version provided. Please use the PUT method to update the mirror."
|
52
app/models/MirrorModels.py
Normal file
52
app/models/MirrorModels.py
Normal file
@ -0,0 +1,52 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
class MirrorModel(BaseModel):
|
||||
"""Implements the response fields for the CDN mirror.
|
||||
|
||||
Args:
|
||||
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
||||
"""
|
||||
|
||||
repository: str
|
||||
version: str
|
||||
cid: str
|
||||
filenames: list[str]
|
||||
|
||||
class MirrorStoreModel(BaseModel):
|
||||
"""Implements the fields for storing CDN mirror information.
|
||||
|
||||
Args:
|
||||
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
||||
"""
|
||||
|
||||
cid: str
|
||||
filenames: list[str]
|
||||
|
||||
class MirrorCreatedResponseModel(BaseModel):
|
||||
"""Implements the response fields for stored CDN mirrors.
|
||||
|
||||
Args:
|
||||
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
||||
"""
|
||||
|
||||
created: bool
|
||||
key: str
|
||||
|
||||
class MirrorUpdatedResponseModel(BaseModel):
|
||||
"""Implements the response fields for updated CDN mirrors.
|
||||
|
||||
Args:
|
||||
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
||||
"""
|
||||
|
||||
updated: bool
|
||||
key: str
|
||||
|
||||
class MirrorDeletedResponseModel(BaseModel):
|
||||
"""Implements the response fields for deleted CDN mirrors.
|
||||
|
||||
Args:
|
||||
BaseModel (pydantic.BaseModel): BaseModel from pydantic
|
||||
"""
|
||||
deleted: bool
|
||||
key: str
|
Reference in New Issue
Block a user