antimatter 2.0.13

antimatter.io Rust library for data control
Documentation
use super::Session;
use crate::session::session::SessionError;
use crate::session::RUNTIME;
use antimatter_api::apis::encryption_api::{self as api};
use serde_json::Value;

impl Session {
    /// Flushes the encryption keys cached for this domain.
    pub fn flush_encryption_keys(&mut self) -> Result<(), SessionError> {
        let conf = self.get_configuration()?;

        RUNTIME
            .block_on(api::domain_flush_encryption_keys(
                &conf,
                self.get_domain_id().as_str(),
                Some(Value::Object(Default::default())),
            ))
            .map_err(|e| SessionError::APIError(format!("{}", e)))?;

        Ok(())
    }
}