use crate::models::vault::VaultItem;
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct VaultStorageResponse {
pub uuid: Option<String>,
}
impl From<Result<VaultItem, anyhow::Error>> for VaultStorageResponse {
fn from(item: Result<VaultItem, anyhow::Error>) -> Self {
VaultStorageResponse {
uuid: item.ok().map(|x| x.uuid),
}
}
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct VaultRetrievalItem {
pub created_at: String,
pub updated_at: String,
pub uuid: String,
pub remote_actor: String,
pub data: String,
}