2025-02-14 11:00:17 -03:00

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"])
)