use super::Error;
use async_trait::async_trait;
use pbbson::Model;
use std::path::Path;
use tempfile::NamedTempFile;

#[async_trait]
pub trait ObjectStore: Sync + Send {
    async fn create(&self, metadata: Model, path: &Path) -> Result<Model, Error>;
    async fn delete(&self, id: &str, by_account_id: Option<String>) -> Result<(), Error>;
    async fn download(&self, id: &str) -> Result<NamedTempFile, Error>;
    async fn find(&self, id: &str) -> Result<Model, Error>;
    async fn find_many(&self, filter: Model, ordering: Option<Model>) -> Result<Vec<Model>, Error>;
    async fn update(&self, metadata: Model) -> Result<Model, Error>;
}
