mirror of
https://github.com/logos-storage/bittorrent-benchmarks.git
synced 2026-01-02 21:13:11 +00:00
22 lines
411 B
Python
22 lines
411 B
Python
from pydantic import BaseModel
|
|
|
|
API_VERSION = "v1"
|
|
|
|
Cid = str
|
|
|
|
|
|
class Manifest(BaseModel):
|
|
cid: Cid
|
|
treeCid: Cid
|
|
datasetSize: int
|
|
blockSize: int
|
|
filename: str
|
|
mimetype: str
|
|
protected: bool
|
|
|
|
@staticmethod
|
|
def from_codex_api_response(response: dict) -> "Manifest":
|
|
return Manifest.model_validate(
|
|
dict(cid=response["cid"], **response["manifest"])
|
|
)
|