#[cfg(feature = "blob-storage-billing")]
mod billing;
mod gateway;
mod hash;
mod lifecycle;
#[cfg(test)]
mod tests;
use crate::{
dto::error::Error,
ops::blob_storage::{
conversion::BlobStorageConversionError, lifecycle::BlobStorageLifecycleError,
},
};
pub struct BlobStorageApi;
impl BlobStorageApi {
const fn map_conversion_error(_err: BlobStorageConversionError) -> Error {
Error::from_registered(crate::diagnostics::codes::REQUEST_INVALID)
}
const fn map_lifecycle_error(err: BlobStorageLifecycleError) -> Error {
match err {
BlobStorageLifecycleError::BlobNotLive => {
Error::from_registered(crate::diagnostics::codes::COLLECTION_UNAVAILABLE)
}
BlobStorageLifecycleError::BlobPendingDeletion => {
Error::from_registered(crate::diagnostics::codes::STATE_CONFLICT)
}
}
}
}