Source code for contree_sdk.sdk.objects.image_fs._async

from __future__ import annotations

from dataclasses import dataclass
from pathlib import Path

from contree_sdk.sdk.objects.image_fs._base import _ImageDirectoryBase, _ImageFileBase


[docs] @dataclass class ImageFile(_ImageFileBase):
[docs] async def read(self) -> bytes: return await self._image._read_file(self.full_path)
[docs] async def download(self, local_path: str | Path | None = None) -> Path: return await self._image._download(self.full_path, local_path)
[docs] @dataclass class ImageDirectory(_ImageDirectoryBase):
[docs] async def ls(self, path: str | Path = "") -> list[ImageFile | ImageDirectory]: return await self._ls(path, ImageFile, ImageDirectory)