from pathlib import Path

from mmar_files.constants import ResourceId


class FileStorageAPI:
    def upload_maybe(self, content: bytes | str | None, fname: str) -> ResourceId | None:
        raise NotImplementedError

    def upload(self, content: bytes | str, fname: str, origin: str | None = None) -> ResourceId:
        raise NotImplementedError

    def get_metadata(self, resource_id: ResourceId) -> dict | None:
        raise NotImplementedError

    def get_fname(self, resource_id: ResourceId) -> str | None:
        raise NotImplementedError

    async def upload_async(self, content: bytes | str, fname: str) -> ResourceId:
        raise NotImplementedError

    def upload_dir(self, resource_ids: list[ResourceId], dir_name: str = "") -> ResourceId:
        raise NotImplementedError

    def download(self, resource_id: ResourceId) -> bytes:
        raise NotImplementedError

    async def download_async(self, resource_id: ResourceId) -> bytes:
        raise NotImplementedError

    def download_text(self, resource_id: ResourceId) -> str:
        raise NotImplementedError

    def read_dir_or_none(self, resource_id: ResourceId) -> list[ResourceId] | None:
        raise NotImplementedError

    def get_path(self, resource_id: ResourceId | None) -> Path | None:
        raise NotImplementedError

    def is_valid(self, resource_id: ResourceId | None) -> bool:
        raise NotImplementedError

    def is_file(self, resource_id: ResourceId | None) -> bool:
        raise NotImplementedError

    def is_dir(self, resource_id: ResourceId | None) -> bool:
        raise NotImplementedError

    def get_dtype(self, resource_id: ResourceId | None) -> str | None:
        raise NotImplementedError

    def unzip_file(self, resource_id: str) -> ResourceId:
        raise NotImplementedError
