use super::Error;
use async_trait::async_trait;
use pbbson::Model;
use std::fs::File;

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